qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
6,864,799
I have a lots of calculated columns and they keep repeating themselves, one inside of the others, including nested cases statements. There is a really simplified version of something that I've searching a way to do. ``` SELECT (1+2) AS A, A + 3 AS B, B * 7 AS C FROM MYTABLE ```
2011/07/28
[ "https://Stackoverflow.com/questions/6864799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/825693/" ]
You could try something like this. ``` SELECT A.Val AS A, B.Val AS B, C.Val AS C FROM MYTABLE cross apply(select 1 + 2) as A(Val) cross apply(select A.Val + 3) as B(Val) cross apply(select B.Val * 7) as C(Val) ```
You can't reference just-created expressions by later referencing their column aliases. Think of the entire select list as being materialized at the same time or in random order - A doesn't exist yet when you're trying to make an expression to create B. You need to repeat the expressions - I don't think you'll be able ...
12,384,287
I'm using some REST Webservice calls in my iOS app, in response i'm getting pdf,ppt,.mp4 & etc documents list & on selection i'm fetching respective data from server & rendering it on screen. 1. Now When a user selects a particular file say, a .pdf doc then when he comes back and selects the same file then again i'm ...
2012/09/12
[ "https://Stackoverflow.com/questions/12384287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409471/" ]
The semicolon warning come courtesy of the `-pedantic` (or `-pedantic-errors`) option; I don't think you can disable it separately. I'd recommend removing the semicolon rather than the warning.
The extra semicolon in the sample code you showed us: ``` if(...) { ... }; ``` is perfectly legal; it's a null statement. The error you're getting is actually about an extra semicolon on an `extern "C"`. The following appears in three source files in the `zziplib` library: ``` #ifdef __cplusplus extern "C" { #endi...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
According to a story I know, Arjuna was so desperate of being a great archer as his guru Dronacharya blessed him so.He started practicing archery in the night without caring about sleep and tiredness. So he conquered sleep in that way I think. This story I found somewhere on the web.Now I could not find it anywhere.S...
Gudakesha = gudaka + isha = sleep + lord = one who conquered sleep (refers to Arjuna) Since a Sanskrit word can have different meanings, we need to take the context to determine the correct one. Take this verse for e.g. : > > evam uktva hrishikesham gudakesha: parantapa > > > Hrishikesha = hrishika + isha = sens...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
According to a story I know, Arjuna was so desperate of being a great archer as his guru Dronacharya blessed him so.He started practicing archery in the night without caring about sleep and tiredness. So he conquered sleep in that way I think. This story I found somewhere on the web.Now I could not find it anywhere.S...
Vishwanath Chakravarty gives two explanations of Gudakesa in Sarartha Varshini, his commentary on bhagavadgita. In one explanation, he took sleep as maya. > > Here is the significance of the word Gudakesa. Akesa means Visnu (a), > Brahma (ka) and Siva (isa). Gudakesa means Arjuna who gives them > (akesa) the experien...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
According to a story I know, Arjuna was so desperate of being a great archer as his guru Dronacharya blessed him so.He started practicing archery in the night without caring about sleep and tiredness. So he conquered sleep in that way I think. This story I found somewhere on the web.Now I could not find it anywhere.S...
The dictionary meaning of Gudakesha is :'a person with thick hair': [http://sanskritdictionary.com/?iencoding=iast&q=गुड](http://sanskritdictionary.com/?iencoding=iast&q=%E0%A4%97%E0%A5%81%E0%A4%A1)ाकेश&lang=sans&action=Search But so far as my limited knowledge goes, it can mean the one who has perfect control over ...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
[Another literal meaning](http://spokensanskrit.de/index.php?tinput=guDAkeza&direction=SE&script=HK&link=yes&beginning=) of 'Gudakesha' is 'he of the curly hair': [![enter image description here](https://i.stack.imgur.com/lEtAo.jpg)](https://i.stack.imgur.com/lEtAo.jpg) If you notice the [Ganguli translation](http://...
Gudakesha = gudaka + isha = sleep + lord = one who conquered sleep (refers to Arjuna) Since a Sanskrit word can have different meanings, we need to take the context to determine the correct one. Take this verse for e.g. : > > evam uktva hrishikesham gudakesha: parantapa > > > Hrishikesha = hrishika + isha = sens...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
[Another literal meaning](http://spokensanskrit.de/index.php?tinput=guDAkeza&direction=SE&script=HK&link=yes&beginning=) of 'Gudakesha' is 'he of the curly hair': [![enter image description here](https://i.stack.imgur.com/lEtAo.jpg)](https://i.stack.imgur.com/lEtAo.jpg) If you notice the [Ganguli translation](http://...
Vishwanath Chakravarty gives two explanations of Gudakesa in Sarartha Varshini, his commentary on bhagavadgita. In one explanation, he took sleep as maya. > > Here is the significance of the word Gudakesa. Akesa means Visnu (a), > Brahma (ka) and Siva (isa). Gudakesa means Arjuna who gives them > (akesa) the experien...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
[Another literal meaning](http://spokensanskrit.de/index.php?tinput=guDAkeza&direction=SE&script=HK&link=yes&beginning=) of 'Gudakesha' is 'he of the curly hair': [![enter image description here](https://i.stack.imgur.com/lEtAo.jpg)](https://i.stack.imgur.com/lEtAo.jpg) If you notice the [Ganguli translation](http://...
The dictionary meaning of Gudakesha is :'a person with thick hair': [http://sanskritdictionary.com/?iencoding=iast&q=गुड](http://sanskritdictionary.com/?iencoding=iast&q=%E0%A4%97%E0%A5%81%E0%A4%A1)ाकेश&lang=sans&action=Search But so far as my limited knowledge goes, it can mean the one who has perfect control over ...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
Gudakesha = gudaka + isha = sleep + lord = one who conquered sleep (refers to Arjuna) Since a Sanskrit word can have different meanings, we need to take the context to determine the correct one. Take this verse for e.g. : > > evam uktva hrishikesham gudakesha: parantapa > > > Hrishikesha = hrishika + isha = sens...
Vishwanath Chakravarty gives two explanations of Gudakesa in Sarartha Varshini, his commentary on bhagavadgita. In one explanation, he took sleep as maya. > > Here is the significance of the word Gudakesa. Akesa means Visnu (a), > Brahma (ka) and Siva (isa). Gudakesa means Arjuna who gives them > (akesa) the experien...
11,215
Arjuna is also known as **Gudakesha** meaning **The one who has conquered sleep and who is not affected by sleep**. From B.G. 10.20 > > अहं आत्मा गुडाकेश > सर्व भूतस्य स्थितः > अहं अदिश्च् मध्यंच > भूतानांन्त एव च > > > aham atma gudakesa > sarva-bhutasaya-sthitah > aham adis ca madhyam ca > bhutanam an...
2016/03/31
[ "https://hinduism.stackexchange.com/questions/11215", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/489/" ]
Gudakesha = gudaka + isha = sleep + lord = one who conquered sleep (refers to Arjuna) Since a Sanskrit word can have different meanings, we need to take the context to determine the correct one. Take this verse for e.g. : > > evam uktva hrishikesham gudakesha: parantapa > > > Hrishikesha = hrishika + isha = sens...
The dictionary meaning of Gudakesha is :'a person with thick hair': [http://sanskritdictionary.com/?iencoding=iast&q=गुड](http://sanskritdictionary.com/?iencoding=iast&q=%E0%A4%97%E0%A5%81%E0%A4%A1)ाकेश&lang=sans&action=Search But so far as my limited knowledge goes, it can mean the one who has perfect control over ...
42,834,675
I have a image i'm using in my GUI and i dont want it as an external resource when i compile the .exe or to my .py. I figured i should encode it to a string, copy the string in the code and decode it and serve it to Tkinter. Tried a bunch of solutions but still doesnt work, here is the code: ``` import tkinter as tk ...
2017/03/16
[ "https://Stackoverflow.com/questions/42834675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7592705/" ]
If you have base64-encoded data, you need to use the `data` argument. However, I don't think this will work for jpg. It will work for .gif images though. This is what the [canonical documentation](http://tcl.tk/man/tcl8.5/TkCmd/photo.htm#M6) says for the data option: > > Specifies the contents of the image as a str...
Got a way: Say image='abc' is the string of the image coded in b64. ``` def install(): if not os.path.isfile("logo.jpg"): open('logo.jpg','wb').write(base64.b64decode(image)) ``` Gonna run this in my main() function and if the image doesnt exist in the folder, it will be created. Afterwords you'll just ...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
I found this on another website and it worked for me: "When more than one network connection is available, Windows uses the one with the lowest metric value. By default, it automatically assigns a metric value based on the network connection's rated speed. See An explanation of the Automatic Metric feature for Interne...
Windows 7 will instantly disconnect the Internet and reconnect when a better connection presents itself. However, the wireless adapter should still be enabled and available. If what you want is to use both connections in parallel in order to speed-up Internet transfer, then this is not possible. Windows 7 will always ...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Are you trying to hook a PC with no internet connection up through your laptop with the bridging built into Windows? I've done itin XP, but not needed to in Win 7 yet. It should still work though. Many laptops have settings to automatically disable the WiFi chipset when a connection is made on the Ethernet port. It's...
Windows 7 will instantly disconnect the Internet and reconnect when a better connection presents itself. However, the wireless adapter should still be enabled and available. If what you want is to use both connections in parallel in order to speed-up Internet transfer, then this is not possible. Windows 7 will always ...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Some computer have a setting in the BIOS that disconnects WiFi when an Ethernet connection is present. Or if you have the HP utilities installed check for this setting in Windows.
Windows 7 will instantly disconnect the Internet and reconnect when a better connection presents itself. However, the wireless adapter should still be enabled and available. If what you want is to use both connections in parallel in order to speed-up Internet transfer, then this is not possible. Windows 7 will always ...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Although OP is using HP, I am adding this answer for Dell (Latitude and Precision) owners who might come across the same problem. Dell stations have ["Automatic Disabling of Wireless when a Wired Connection is Detected"](http://www.dell.com/support/article/uk/en/ukbsdt1/sln285316/how-to-disable-wireless-when-connecte...
Windows 7 will instantly disconnect the Internet and reconnect when a better connection presents itself. However, the wireless adapter should still be enabled and available. If what you want is to use both connections in parallel in order to speed-up Internet transfer, then this is not possible. Windows 7 will always ...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
I found this on another website and it worked for me: "When more than one network connection is available, Windows uses the one with the lowest metric value. By default, it automatically assigns a metric value based on the network connection's rated speed. See An explanation of the Automatic Metric feature for Interne...
Are you trying to hook a PC with no internet connection up through your laptop with the bridging built into Windows? I've done itin XP, but not needed to in Win 7 yet. It should still work though. Many laptops have settings to automatically disable the WiFi chipset when a connection is made on the Ethernet port. It's...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
I found this on another website and it worked for me: "When more than one network connection is available, Windows uses the one with the lowest metric value. By default, it automatically assigns a metric value based on the network connection's rated speed. See An explanation of the Automatic Metric feature for Interne...
Some computer have a setting in the BIOS that disconnects WiFi when an Ethernet connection is present. Or if you have the HP utilities installed check for this setting in Windows.
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
I found this on another website and it worked for me: "When more than one network connection is available, Windows uses the one with the lowest metric value. By default, it automatically assigns a metric value based on the network connection's rated speed. See An explanation of the Automatic Metric feature for Interne...
Although OP is using HP, I am adding this answer for Dell (Latitude and Precision) owners who might come across the same problem. Dell stations have ["Automatic Disabling of Wireless when a Wired Connection is Detected"](http://www.dell.com/support/article/uk/en/ukbsdt1/sln285316/how-to-disable-wireless-when-connecte...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Some computer have a setting in the BIOS that disconnects WiFi when an Ethernet connection is present. Or if you have the HP utilities installed check for this setting in Windows.
Are you trying to hook a PC with no internet connection up through your laptop with the bridging built into Windows? I've done itin XP, but not needed to in Win 7 yet. It should still work though. Many laptops have settings to automatically disable the WiFi chipset when a connection is made on the Ethernet port. It's...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Are you trying to hook a PC with no internet connection up through your laptop with the bridging built into Windows? I've done itin XP, but not needed to in Win 7 yet. It should still work though. Many laptops have settings to automatically disable the WiFi chipset when a connection is made on the Ethernet port. It's...
Although OP is using HP, I am adding this answer for Dell (Latitude and Precision) owners who might come across the same problem. Dell stations have ["Automatic Disabling of Wireless when a Wired Connection is Detected"](http://www.dell.com/support/article/uk/en/ukbsdt1/sln285316/how-to-disable-wireless-when-connecte...
241,997
I want to Bridge my Windows 7 laptop's wireless and wired adapters. I just select my ethernet and WIFI adapter, and choose create bridge. However when plugging in ethernet cable, instantly my WIFI disconnects. How to prevent this? I have a HP nx6310 laptop with latest WIFI drivers.
2011/02/05
[ "https://superuser.com/questions/241997", "https://superuser.com", "https://superuser.com/users/59101/" ]
Some computer have a setting in the BIOS that disconnects WiFi when an Ethernet connection is present. Or if you have the HP utilities installed check for this setting in Windows.
Although OP is using HP, I am adding this answer for Dell (Latitude and Precision) owners who might come across the same problem. Dell stations have ["Automatic Disabling of Wireless when a Wired Connection is Detected"](http://www.dell.com/support/article/uk/en/ukbsdt1/sln285316/how-to-disable-wireless-when-connecte...
25,064,093
I'm using Jenkins for CI on my project. Right now, I have a "Dev" build, which is triggered by Stash (git server) any time a commit is made to any branch. I'm trying to incorporate my release workflow as well. Here's the plan: * Dev job uses the Promoted Builds plugin to promote all builds to `master` * Release job i...
2014/07/31
[ "https://Stackoverflow.com/questions/25064093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2045366/" ]
Finally figured it out. Added a String build parameter called `IS_RELEASE_CANDIDATE` with a default value of `0`. I'm using "Promote immediately once the build is complete based on build parameters" with the condition that `IS_RELEASE_CANDIDATE` is `1`. In my build steps, I've added a Conditional step using the [Condi...
I was able to do this by using the `Custom Groovy Script` option, which is provided a `build` object from which you can access environment variables. This script will only allow promotions on builds that match the `origin/master` branch. [![Screenshot of configuration](https://i.stack.imgur.com/IDbgN.png)](https://i.s...
604,903
I am looking to grab the value of a form input. I think my problem is on this line: ``` var vid = $(this).next(".pid").val(); ``` I need to send the value of the input box named 'pid' to a php page, however there are several forms on the page, all with input boxes named 'pid'. When i merely have: ``` next(".pi...
2009/03/03
[ "https://Stackoverflow.com/questions/604903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54259/" ]
Replace this: ``` var vid = $(this).next(".pid").val(); var formdata = $('form#addToCart'+ vid).serialize(); ``` With this: ``` var formdata = $(this).parents('form').serialize(); ``` Tested and works.
Why are you using next()? You should try searching in the **context**: ``` $(".pid", this) // if "this" is the current form ``` Anyway I recommend to make every input with unique id attribute. So you don't have to guess which element will be processed.
52,070,297
Laravel Eloquent `->whereHas()` uses an`exists()` subquery - <https://dev.mysql.com/doc/refman/8.0/en/exists-and-not-exists-subqueries.html> - in order to return your results. I would like to write my own subquery, but I do not know how to tell Eloquent to ->where it. If I do: ``` $query->where( DB::raw(' exists( su...
2018/08/29
[ "https://Stackoverflow.com/questions/52070297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2019965/" ]
Use [`whereRaw()`](https://laravel.com/docs/5.6/queries#raw-expressions): ``` $query->whereRaw('exists( subquery )') ```
[Read WhereHas Description Here](https://laravel.com/docs/5.6/eloquent-relationships#querying-relationship-existence) You can find this code example there. You can also add a closure for you custom query in whereHas. ``` // Retrieve all posts with at least one comment containing words like foo% $posts = App\Post::whe...
61,824,502
I'm passing an object of data from a Python/Django App to the front end using AJAX in JSON form. Everything is working correctly, except that I cannot parse the JSON object once in Javascript. I keep getting undefined. I've tried every approach I could think of and I am super stuck so I wanted to see if someone might b...
2020/05/15
[ "https://Stackoverflow.com/questions/61824502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7901491/" ]
You're serializing you data multiple times, just put `products` into `response` without serializing it. ``` response = {'product_data': products, 'product_count': product_count} return HttpResponse(json.dumps(response), content_type='application/json') ```
I believe you need to `JSON.parse(data.product_data)` first.
61,824,502
I'm passing an object of data from a Python/Django App to the front end using AJAX in JSON form. Everything is working correctly, except that I cannot parse the JSON object once in Javascript. I keep getting undefined. I've tried every approach I could think of and I am super stuck so I wanted to see if someone might b...
2020/05/15
[ "https://Stackoverflow.com/questions/61824502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7901491/" ]
Use JSONResponse instead of HttpResponse. That way you don't need to handle anything in between. ``` return JSONResponse(products) ``` :) "json.dumps" would've been sufficient tho, no need for another call to the serializer.
I believe you need to `JSON.parse(data.product_data)` first.
61,824,502
I'm passing an object of data from a Python/Django App to the front end using AJAX in JSON form. Everything is working correctly, except that I cannot parse the JSON object once in Javascript. I keep getting undefined. I've tried every approach I could think of and I am super stuck so I wanted to see if someone might b...
2020/05/15
[ "https://Stackoverflow.com/questions/61824502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7901491/" ]
Use JSONResponse instead of HttpResponse. That way you don't need to handle anything in between. ``` return JSONResponse(products) ``` :) "json.dumps" would've been sufficient tho, no need for another call to the serializer.
You're serializing you data multiple times, just put `products` into `response` without serializing it. ``` response = {'product_data': products, 'product_count': product_count} return HttpResponse(json.dumps(response), content_type='application/json') ```
168,757
While trying to set up a server, I appear to have disabled user logins and now when I start my MacBook I only get the "Name" input field (followed by a red dot), the error message “Network accounts are unavailable” and a password field. All external access has been shut off to this server. I have run Disk Utility and ...
2015/01/24
[ "https://apple.stackexchange.com/questions/168757", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/110876/" ]
You can enter the username and password of the local administrator account at the login window you are seeing. The local administrator would be the user account that was created when first setting up OS X on the MacBook and is not associated with any network account server. Once logged in to the local admin, open Syst...
"Network Accounts unavailable" is an indication that the device is unable to communicate with Directory Services (Open Directory). You need to make sure that you are on the same subnet as the server (the subnet that was used when the Open Directory was created as this seems to be a MacBook and mobile). You also nee...
276,249
I have a web app which has users, forms, and volunteers signed up on those forms. Currently I am using MongoDB and have it setup with a collection for admins, and a collection for forms with volunteers attached to the forms. It is not very efficient because I have to render the forms on two pages, so I have form data...
2015/03/13
[ "https://softwareengineering.stackexchange.com/questions/276249", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/171207/" ]
We can't answer that. It depends on more than just your schema or lack thereof. It depends also on how you hit the service (in code), how your users hit the application, what sort of caching you're prepared to implement, etc. Use the storage mechanism that is more well suited to how you think and code. Keep interactio...
Based on the data you provided I would say this could be made to work both ways. However, since you started off with MongoDB, I will highlight that: First of all, I think you are starting off on the wrong premise: you are trying to cut down on the reads to the database. But MongoDB is designed for fast access to larg...
7,990,083
I am trying the following in order to display the sql table data inside a gridview ``` try { SqlConnection xconn = new SqlConnection(); xconn.ConnectionString = @"Data Source=servername;Integrated Security=True;Initial Catalog=master"; xconn.Open(); string s = "select * from tablen...
2011/11/03
[ "https://Stackoverflow.com/questions/7990083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/751161/" ]
change the Catch section with ``` catch (Exception ex) { lblresult.Text = ex.Message &"\n" & ex.StackTrace; } ``` Now you will get a valid exception description. use that to fix it yourself... :) If not, post the detailed exception information from the `lblresult.Text` in your post.
You must fill the request result in a varible which you can use as itemsource. ``` GridView.ItemsSource = ContainerClass.AllItems; ``` The ContainerClass is a help class and contains a IEnumerable AllItems variable. The gridview can show the values on this way!!
31,712
I am installing sitecore commerce in development environment, encountered some errors prior to this error, all those are fixed, now i am getting this error. seems some issue with the Identity Server. any help would be much appreciated. i can give more details if required. [![enter image description here](https://i.sta...
2022/05/02
[ "https://sitecore.stackexchange.com/questions/31712", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/11695/" ]
I have assumed that you mean in .NET and not SPE. If an item has a workflow state, you will be able access the name of that state by using one of the following ways: 1. Through use of the Sitecore workflow state field directly: ``` var workflowState = (Sitecore.Data.Fields.ReferenceField)Sitecore.Context.Item.Fields...
To get the workflow state you can use : ``` var workflowStateItemid=currentItem["__Workflow state"]; var workflowStateItem=Sitecore.Context.Dabase.GetItem(new ID(workflowStateItemid)); var workflowStateItemName=workflowStateItem.Name; ```
31,712
I am installing sitecore commerce in development environment, encountered some errors prior to this error, all those are fixed, now i am getting this error. seems some issue with the Identity Server. any help would be much appreciated. i can give more details if required. [![enter image description here](https://i.sta...
2022/05/02
[ "https://sitecore.stackexchange.com/questions/31712", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/11695/" ]
If you are looking for Sitecore PowerShell script then you try this :- ``` $contentItem = Get-Item "master:path.." (Get-Item master: -ID $contentItem."__Workflow state").Name ```
To get the workflow state you can use : ``` var workflowStateItemid=currentItem["__Workflow state"]; var workflowStateItem=Sitecore.Context.Dabase.GetItem(new ID(workflowStateItemid)); var workflowStateItemName=workflowStateItem.Name; ```
31,712
I am installing sitecore commerce in development environment, encountered some errors prior to this error, all those are fixed, now i am getting this error. seems some issue with the Identity Server. any help would be much appreciated. i can give more details if required. [![enter image description here](https://i.sta...
2022/05/02
[ "https://sitecore.stackexchange.com/questions/31712", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/11695/" ]
You can get the workflow state using the below `PowerShell` script: ``` $item = Get-Item master:/sitecore/content/Home | Get-ItemField -IncludeStandardFields -ReturnType Field -Name "*" $item | ForEach-Object { if ($_.Name -eq '__Workflow state') { (Get-Item -Path "master:" -ID $_.Value).Name } } `...
To get the workflow state you can use : ``` var workflowStateItemid=currentItem["__Workflow state"]; var workflowStateItem=Sitecore.Context.Dabase.GetItem(new ID(workflowStateItemid)); var workflowStateItemName=workflowStateItem.Name; ```
47,701,074
I am trying to [install the capybara-webkit gem](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#debian--ubuntu) on Amazon Linux AMI release 2017.09. I tried following the [install instructions for CentOS](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-a...
2017/12/07
[ "https://Stackoverflow.com/questions/47701074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8712097/" ]
Amazon AMI doesn’t have a yum repo for the `libgtk-x11-2.0.so.0`. So you need to install other distro packages. In this case, did used CentOS. ``` $ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/x86_64/Packages/hicolor-icon-theme-0.11-1.1.el6.noarch.rpm $ sudo yum install ftp://ftp.riken.jp/Linux/centos/6/os/...
I'm using chef but this is where I got the necessary dependencies. just add this repo to yum repos, and then do the install ``` yum_repository 'centos-base' do url 'http://mirror.centos.org/centos/6/os/x86_64/' gpgkey 'http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6' action :add end package 'qt5-qtwebkit-deve...
6,468,713
I'm trying to write some code which recursively adds TestSuites in a project to a suite of suites located at the root of the package hierarcy. I've already written the code which returns a Collection object which contains a File object for each Test Suite found in my project. I'm now trying to loop through them and...
2011/06/24
[ "https://Stackoverflow.com/questions/6468713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653708/" ]
`TestSuite.addTest` needs a Test class instance; not just a Class object. You could try using `Class.newInstance()` if your tests can be (they should) instantiated without parameters. -- A maybe better strategy is to start using Maven; which automatically runs all Test classes in the src/test/java source folder. But...
Method you are using expects instance of Test (sub)class. The one you are after is probably addTestSuite(Class testClass) which allows adding classes.
6,468,713
I'm trying to write some code which recursively adds TestSuites in a project to a suite of suites located at the root of the package hierarcy. I've already written the code which returns a Collection object which contains a File object for each Test Suite found in my project. I'm now trying to loop through them and...
2011/06/24
[ "https://Stackoverflow.com/questions/6468713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653708/" ]
Yes, you are making a fundamental mistake by assuming that a Class< Test > reference and a Test reference are one and the same. You need an **instance of a Class that extends `Test`**, not an instance of a Class object whose definition extends `Test` (Classes are objects too in java).
`TestSuite.addTest` needs a Test class instance; not just a Class object. You could try using `Class.newInstance()` if your tests can be (they should) instantiated without parameters. -- A maybe better strategy is to start using Maven; which automatically runs all Test classes in the src/test/java source folder. But...
6,468,713
I'm trying to write some code which recursively adds TestSuites in a project to a suite of suites located at the root of the package hierarcy. I've already written the code which returns a Collection object which contains a File object for each Test Suite found in my project. I'm now trying to loop through them and...
2011/06/24
[ "https://Stackoverflow.com/questions/6468713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653708/" ]
Yes, you are making a fundamental mistake by assuming that a Class< Test > reference and a Test reference are one and the same. You need an **instance of a Class that extends `Test`**, not an instance of a Class object whose definition extends `Test` (Classes are objects too in java).
Method you are using expects instance of Test (sub)class. The one you are after is probably addTestSuite(Class testClass) which allows adding classes.
6,468,713
I'm trying to write some code which recursively adds TestSuites in a project to a suite of suites located at the root of the package hierarcy. I've already written the code which returns a Collection object which contains a File object for each Test Suite found in my project. I'm now trying to loop through them and...
2011/06/24
[ "https://Stackoverflow.com/questions/6468713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653708/" ]
`Class<Test>` describes the concept of class `Test` -- its fields, methods, and other stuff described by the Java code when defining class `Test`. There is *generally* (to keep classloaders out of this discussion) one instance of `Class<Test>` across the JVM, since there is basically just one `Test` class. The same ap...
Method you are using expects instance of Test (sub)class. The one you are after is probably addTestSuite(Class testClass) which allows adding classes.
6,468,713
I'm trying to write some code which recursively adds TestSuites in a project to a suite of suites located at the root of the package hierarcy. I've already written the code which returns a Collection object which contains a File object for each Test Suite found in my project. I'm now trying to loop through them and...
2011/06/24
[ "https://Stackoverflow.com/questions/6468713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653708/" ]
Yes, you are making a fundamental mistake by assuming that a Class< Test > reference and a Test reference are one and the same. You need an **instance of a Class that extends `Test`**, not an instance of a Class object whose definition extends `Test` (Classes are objects too in java).
`Class<Test>` describes the concept of class `Test` -- its fields, methods, and other stuff described by the Java code when defining class `Test`. There is *generally* (to keep classloaders out of this discussion) one instance of `Class<Test>` across the JVM, since there is basically just one `Test` class. The same ap...
38,406,164
``` EID NAME SALARY DNAME HIRE_DATE NUM_PHONES --- ------------------ ---------- ---------------------- --------- ---------- 111 Yo-yo Ma 80000 Software 01-MAY-81 1 222 Leonard Bernstein 80000 Information Technology 02-JUN-82 2 333 Leonard Bernstein ...
2016/07/15
[ "https://Stackoverflow.com/questions/38406164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You have two options that I can think of: 1) Include it in the init function if you want an A object to be created with A.var1=var0: ``` class A: def __init__(self, var0): self.var0 = var0 self.var1 = self.var0 ``` 2) If you really don't want var1 inside of the init function, you could create a function ...
Try this instead: ``` class A: def __init__(self, var0): self.var1 = self.var0 = var0 ``` However, I do not see much point in this and would rather simply initialize it immediately like so: ``` class A: def __init__(self, var0): self.var1 = var0 ``` If you wish to have two variables with the same va...
38,406,164
``` EID NAME SALARY DNAME HIRE_DATE NUM_PHONES --- ------------------ ---------- ---------------------- --------- ---------- 111 Yo-yo Ma 80000 Software 01-MAY-81 1 222 Leonard Bernstein 80000 Information Technology 02-JUN-82 2 333 Leonard Bernstein ...
2016/07/15
[ "https://Stackoverflow.com/questions/38406164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You have two options that I can think of: 1) Include it in the init function if you want an A object to be created with A.var1=var0: ``` class A: def __init__(self, var0): self.var0 = var0 self.var1 = self.var0 ``` 2) If you really don't want var1 inside of the init function, you could create a function ...
In your code `var1 = self.var0` is at class-level, not at instance-level, so `self` doesn't make sense here. To see it, try this: ``` class C(object): field1 = 1 def __init__(self): self.field2 = 2 print(C.field1) print(C.field2) # should raise an exception instance = C() print(instance.field1) # not...
7,741,016
I'm trying to use p4 sync to sync a specific directory to a given changelist number using wildcards but I also want to exclude a list of files that are under that directory (in subdirectories), I tried using - (both before and after using a path with wildcards) but the file never gets excluded, this the command I'm try...
2011/10/12
[ "https://Stackoverflow.com/questions/7741016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/203251/" ]
In your client, you would have multiple lines: ``` //Repo/Foo/... //my_client/Repo/Foo/... -//Repo/Foo/subdirectory/... //my_client/Repo/Foo/subdirectory/... ``` This would allow you to get everything in the Foo directory and all subdirectories *except* "subdirectory".
In short, you can't exclude files on a sync. That can only be done within the client spec. (Well, it could be done through the protections table, but that is really a different matter I think). But if you want to sync a specific folder and only the files in that folder, use \* ``` p4 sync //Repo/Foo/* ``` will get ...
7,741,016
I'm trying to use p4 sync to sync a specific directory to a given changelist number using wildcards but I also want to exclude a list of files that are under that directory (in subdirectories), I tried using - (both before and after using a path with wildcards) but the file never gets excluded, this the command I'm try...
2011/10/12
[ "https://Stackoverflow.com/questions/7741016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/203251/" ]
You can do this if you use a label. Create a label in your favorite editor (p4v or command line p4 label and add your two lines: ``` //Repo/Foo/... -//Repo/Foo/Bar/Foobar.txt ``` In the revision field put `"#head"` (including quotes!) if you want the latest or a change list number. Give the label a name - for instan...
In short, you can't exclude files on a sync. That can only be done within the client spec. (Well, it could be done through the protections table, but that is really a different matter I think). But if you want to sync a specific folder and only the files in that folder, use \* ``` p4 sync //Repo/Foo/* ``` will get ...
3,839,881
Simplifying the part after the product function For $k=0$ $$\frac{x+x^{-1} +2}{x+x^{-1}}$$ $$=\frac{(x^{\frac 12}+x^{-\frac 12})^2}{x+x^{-1}}$$ Performing a similar simplification for all values of $k$, then end result is $$\frac{1}{x^{2^k}+x^{-2^k}} (x^{\frac 12}+x^{-\frac 12})^2 (x+x^{-1})(x^2+x^{-2})...(x^{2^{k-1...
2020/09/25
[ "https://math.stackexchange.com/questions/3839881", "https://math.stackexchange.com", "https://math.stackexchange.com/users/690228/" ]
**Hint :** Multiply and divide by $(x^{\frac{1}{2}}-x^{−\frac{1}{2}})$ and use $(a+b)(a-b)=a^2-b^2$.
Let $a\_n$ be the product term in the limit. Note that $$ a\_{n+1}=a\_n\left(1+\frac{2}{x^{2^{n+1}}+x^{-2^{n+1}}}\right)=a\_n\left(\frac{(x^{2^{n}}+x^{-2^{n}})^2}{x^{2^{n+1}}+x^{-2^{n+1}}}\right) $$ Now you can use induction to show $$ a\_n=\left(\frac{x^{1/2}+x^{-1/2}}{x^{1/2}-x^{-1/2}}\right)\left(\frac{x^{2^{n}}-x^...
377,275
I got a 110V version of the Aoyue 968A+ soldering station by mistake and shipping the station for a replacement or selling it is not an option. I reverse engineered part of the station looking for the cheapest way to convert it to 220V input capable (instead of using a 220V to 110V transformer). This is the bit of the...
2018/05/30
[ "https://electronics.stackexchange.com/questions/377275", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/159293/" ]
Using diode in series with primary transformer winding is very bad idea. AC transformer may work only with sinusoidal (AC) voltage. The only solution for transformer is to make new primary winding, doubling it's turns by thiner wire. But! The other parts of scheme remains. Triacs are 600V rated, so the questions is: ar...
Your transformer will not survive chopping the mains waveform in half with a rectifier. Use a 240:110 autotransformer to power the complete solder station.
377,275
I got a 110V version of the Aoyue 968A+ soldering station by mistake and shipping the station for a replacement or selling it is not an option. I reverse engineered part of the station looking for the cheapest way to convert it to 220V input capable (instead of using a 220V to 110V transformer). This is the bit of the...
2018/05/30
[ "https://electronics.stackexchange.com/questions/377275", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/159293/" ]
Using diode in series with primary transformer winding is very bad idea. AC transformer may work only with sinusoidal (AC) voltage. The only solution for transformer is to make new primary winding, doubling it's turns by thiner wire. But! The other parts of scheme remains. Triacs are 600V rated, so the questions is: ar...
If you put 220VAC on the primary of a 110VAC transformer it will very promptly run down the curtain and join the choir invisible. Your best bet is an external transformer. You cannot even use an external 24VDC supply because the triacs will never switch off.
451,975
I have production unit in which java process has become Zombie and remained there for some time now. If the unit is restarted, then it will be cleared. However, the unit is not restarted and another java process is up and running. Is there any issue if this zombie state remains as it is without clearing it? Will it aff...
2018/06/26
[ "https://unix.stackexchange.com/questions/451975", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/250201/" ]
Zombie process won't have any effect on performance or slowness as **Zombie processes don’t use up any system resources.** ***Note:-*** Practically, it is still using the PID (which is a limited resource), and the kernel data structures for the process are still allocated. Usually, this won't matter much, but the kern...
Mostly, zombies are not a big issue. They are a 'dead'-ish process, which takes no CPU time, and any allocated memory *should* have been freed by the process before dying. The only resource they actually take is an entry in your process list. Depending on your system, you can have a maximum allowed number of threads, a...
45,708,470
I'm new to ASP.NET and MVC architecture. I want to display a number in a view after doing a calculation as follows ![the total is here[![]](https://i.stack.imgur.com/duIEt.png) How can I display the `totalmessage` in a view?
2017/08/16
[ "https://Stackoverflow.com/questions/45708470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4858782/" ]
You can use a view model to hold your data. ``` public class TotalViewModel { public int Total {get; set;} public string Message {get; set;} } ``` Then in the controller ``` public ActionResult Calculate() { // do your calculations... var model = new TotalViewModel { Message = "Total = ", Total = total ...
You can use **ViewBag** for any data to pass view, add these code to the Calculate method you have; ``` ViewBag.total = totalMessage; ``` than in the Calculate.cshtml view; ``` <p>@ViewBag.total</p> ``` that's all
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
As it was mentioned in the other answers, specificity is the recall of the negative class. You can reach it just setting the `pos_label` parameter: ``` from sklearn.metrics import recall_score y_true = [0, 1, 0, 0, 1, 0] y_pred = [0, 0, 1, 1, 1, 1] recall_score(y_true, y_pred, pos_label=0) ``` which returns `.25`.
Remembering that in binary classification, recall of the positive class is also known as “sensitivity”; recall of the negative class is “specificity”, I use this: ``` unique, counts = np.unique(y_test, return_counts=True) for i in unique: score = precision_score(y_true, y_pred, labels=unique, pos_label=i) pri...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
First of all you need to know that: ``` DummyClassifier(strategy='most_frequent'... ``` Will give you classifier which returns most frequent label from your training set. It doesn't even take into consideration samples in X. You can pass anything instead of ground\_truth in this line: ``` clf_dummy = clf_dummy.fit(...
I personally rely on using `classification_report` a lot from sklearn and so wanted to extend it with specificity values, so came up with the following code. Note that I only add it to the `macro avg`, though it should be easy to extend it to the weighted average output as well ``` import random import numpy as np f...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
As it was mentioned in the other answers, specificity is the recall of the negative class. You can reach it just setting the `pos_label` parameter: ``` from sklearn.metrics import recall_score y_true = [0, 1, 0, 0, 1, 0] y_pred = [0, 0, 1, 1, 1, 1] recall_score(y_true, y_pred, pos_label=0) ``` which returns `.25`.
I personally rely on using `classification_report` a lot from sklearn and so wanted to extend it with specificity values, so came up with the following code. Note that I only add it to the `macro avg`, though it should be easy to extend it to the weighted average output as well ``` import random import numpy as np f...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
First of all you need to know that: ``` DummyClassifier(strategy='most_frequent'... ``` Will give you classifier which returns most frequent label from your training set. It doesn't even take into consideration samples in X. You can pass anything instead of ground\_truth in this line: ``` clf_dummy = clf_dummy.fit(...
As I understand it, 'specificity' is just a special case of 'recall'. Recall is calculated for the actual positive class ( TP / [TP+FN] ), whereas 'specificity' is the same type of calculation but for the actual negative class ( TN / [TN+FP] ). It really only makes sense to have such specific terminology for binary cl...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
As I understand it, 'specificity' is just a special case of 'recall'. Recall is calculated for the actual positive class ( TP / [TP+FN] ), whereas 'specificity' is the same type of calculation but for the actual negative class ( TN / [TN+FP] ). It really only makes sense to have such specific terminology for binary cl...
I personally rely on using `classification_report` a lot from sklearn and so wanted to extend it with specificity values, so came up with the following code. Note that I only add it to the `macro avg`, though it should be easy to extend it to the weighted average output as well ``` import random import numpy as np f...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
As it was mentioned in the other answers, specificity is the recall of the negative class. You can reach it just setting the `pos_label` parameter: ``` from sklearn.metrics import recall_score y_true = [0, 1, 0, 0, 1, 0] y_pred = [0, 0, 1, 1, 1, 1] recall_score(y_true, y_pred, pos_label=0) ``` which returns `.25`.
As I understand it, 'specificity' is just a special case of 'recall'. Recall is calculated for the actual positive class ( TP / [TP+FN] ), whereas 'specificity' is the same type of calculation but for the actual negative class ( TN / [TN+FP] ). It really only makes sense to have such specific terminology for binary cl...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
Remembering that in binary classification, recall of the positive class is also known as “sensitivity”; recall of the negative class is “specificity”, I use this: ``` unique, counts = np.unique(y_test, return_counts=True) for i in unique: score = precision_score(y_true, y_pred, labels=unique, pos_label=i) pri...
I personally rely on using `classification_report` a lot from sklearn and so wanted to extend it with specificity values, so came up with the following code. Note that I only add it to the `macro avg`, though it should be easy to extend it to the weighted average output as well ``` import random import numpy as np f...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
You could get `specificity` from the [`confusion matrix`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html). For a binary classification problem, it would be something like: ``` from sklearn.metrics import confusion_matrix y_true = [0, 0, 0, 1, 1, 1, 1, 1] y_pred = [0, 1, 0, 1, 0...
As I understand it, 'specificity' is just a special case of 'recall'. Recall is calculated for the actual positive class ( TP / [TP+FN] ), whereas 'specificity' is the same type of calculation but for the actual negative class ( TN / [TN+FP] ). It really only makes sense to have such specific terminology for binary cl...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
You could get `specificity` from the [`confusion matrix`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html). For a binary classification problem, it would be something like: ``` from sklearn.metrics import confusion_matrix y_true = [0, 0, 0, 1, 1, 1, 1, 1] y_pred = [0, 1, 0, 1, 0...
I personally rely on using `classification_report` a lot from sklearn and so wanted to extend it with specificity values, so came up with the following code. Note that I only add it to the `macro avg`, though it should be easy to extend it to the weighted average output as well ``` import random import numpy as np f...
33,275,465
In my main control i defined ``` <Control.Resources> <Style x:Key="TextInput" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Text" Value="{x:Static sys:String.Empty}"> <Setter Property="Background" Value="PaleTurquoise" /> <...
2015/10/22
[ "https://Stackoverflow.com/questions/33275465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3416526/" ]
You could get `specificity` from the [`confusion matrix`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html). For a binary classification problem, it would be something like: ``` from sklearn.metrics import confusion_matrix y_true = [0, 0, 0, 1, 1, 1, 1, 1] y_pred = [0, 1, 0, 1, 0...
Remembering that in binary classification, recall of the positive class is also known as “sensitivity”; recall of the negative class is “specificity”, I use this: ``` unique, counts = np.unique(y_test, return_counts=True) for i in unique: score = precision_score(y_true, y_pred, labels=unique, pos_label=i) pri...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The [Frankenstein-Dracula variation of the Vienna game](https://en.wikipedia.org/wiki/Vienna_Game,_Frankenstein%E2%80%93Dracula_Variation) features a Rook sacrifice by Black (effectively an exchange sacrifice however, since the Knight will not escape). ``` [FEN ""] 1.e4 e5 2.Nc3 Nf6 3.Bc4 Nxe4 4.Qh5 Nd6 5.Bb3 Nc6 6.Nb...
[Légal Trap](https://en.wikipedia.org/wiki/L%C3%A9gal_Trap) is one of my most favorite games. It's just so simple, and yet gives a powerful reminder of what sacrifices can allow you to do. White sacrifices the Queen, but in exchange Black concedes the game! ``` [FEN ""] [ECO "C57"] 1. e4 e5 2. Nf3 Nc6 3. Bc4 d6 4. Nc3...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The **Perenyi Gambit** is an important theoretical variation that has been favored by GMs like J.Polgar or A.Shirov. White sacrifices at least one piece, and often two: ``` [FEN ""] [ECO "C57"] 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nd4 Nf6 5. Nc3 a6 6. Be3 e6 7. g4!? e5 8. Nf5 g6 9. g5 (9.Bg2) gxf5 10. exf5 d5 11. Qf3 d4 ...
The Halloween gambit(dubious) sacrifises a knight for a large centre: 1.e4 e4 2.Nf3 Nc6 3.Nc3 Nf6 4.Nxe5?! The optimal line is shown here: 4...Nxe5 5.d4 Ng6 6.e5 Ng8 7.Bc4 d5!? 8.Bd5 c6 9.Bc4/9.Bb3. ``` r1bqkbnr/pp3ppp/2p3n1/4P3/2BP4/2N5/PPP2PPP/R1BQK2R b KQkq - 1 9 ```
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The Cochrane Gambit: ``` [FEN ""] 1. e4 e5 2. Nf3 Nf6 3.Nxe5 d6 4.Nxf7 ``` This is relatively sound gambit, Topalov has played it against Kramnik. The Traxler Gambit: ``` [FEN ""] 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 Bc5 5. Nxf7 Bxf2 6. Kf1 Qe7 7. Nxh8 ``` White does have an option of taking on `f7` with the bi...
Not sure if this is considered a gambit, but one of the lines of the Steinitz variation of the Caro Kann defense involves white sacrificing a knight: ``` [FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 "] [Event "IBM Man-Machine, New York USA"] [Site "New York, NY USA"] [Date "1997.05.??"] [Round "6"] [...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
This is kind of out there (virtually nobody plays it as white and even fewer allow it as black) but there is a rather crazy queen sacrifice line in the Grand Prix: ``` [FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 "] 1.e4 c5 2.f4 d5 3.Nf3 dxe4 4.Ng5 Nf6 5.Bc4 Bg4!? 6.Bxf7+ Kd7 7.Qxg4+ Nxg4 8.Be6+ Kc6 ...
A commonly known knight sacrifice by white is the [Fried Liver Attack](https://en.wikipedia.org/wiki/Two_Knights_Defense,_Fried_Liver_Attack): ``` [FEN ""] [ECO "C57"] 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5?! (5... Na5 {The main line.} 6. Bb5+ c6 7. dxc6 bxc6 {Black has compensation in form of initiativ...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The **Perenyi Gambit** is an important theoretical variation that has been favored by GMs like J.Polgar or A.Shirov. White sacrifices at least one piece, and often two: ``` [FEN ""] [ECO "C57"] 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nd4 Nf6 5. Nc3 a6 6. Be3 e6 7. g4!? e5 8. Nf5 g6 9. g5 (9.Bg2) gxf5 10. exf5 d5 11. Qf3 d4 ...
Look up the [Jerome Gambit](https://www.youtube.com/watch?v=pxRQm7nbOfc) in the Italian, where a bishop is sacrificed. It's not sound, but it's a lot of fun to play in bullet chess. I found this old post because I was looking for information on it. I just learned the name even though I've been using it since I started...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The 'Halloween Gambit' or 'Müller-Schulze Gambit' is a knight gambit in the (often characterized as dull) Four Knights Game: ``` [FEN ""] [White "Blokje"] [Black "Platypussy"] [StartPly "7"] 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Nxe5 Nxe5 5. d4 Nc6 6.d5 Ne5 7.f4 Ng6 8.e5 Ng8 9.Bd3 Bb4 10.O-O Bxc3 11.bxc3 d6 12.e6 fxe6 13...
The Muzio Gambit in the King's Gambit is pretty well-known: ``` [FEN ""] 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 (4... Bg7 {About as common on Lichess in the 1600-2000 range as 4... g4. If you're going to play for the Muzio, you'll have to be happy with reaching this position about half the time.}) 5. O-O!? gxf3 ``...
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
This is kind of out there (virtually nobody plays it as white and even fewer allow it as black) but there is a rather crazy queen sacrifice line in the Grand Prix: ``` [FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 "] 1.e4 c5 2.f4 d5 3.Nf3 dxe4 4.Ng5 Nf6 5.Bc4 Bg4!? 6.Bxf7+ Kd7 7.Qxg4+ Nxg4 8.Be6+ Kc6 ...
The Luccini Gambit sacs a rook. ``` [FEN ""] 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 f5 5. Ng5 f4 6. Nf7 Qh4 ``` The Nakhmanson gambit sacs some pawns and a bishop ``` [FEN ""] 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. Nf3 Nc6 5. O-O Nxe4 6. Nc3 dxc3 7. Bxf7+ Kxf7 8. Qd5+ ```
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
A commonly known knight sacrifice by white is the [Fried Liver Attack](https://en.wikipedia.org/wiki/Two_Knights_Defense,_Fried_Liver_Attack): ``` [FEN ""] [ECO "C57"] 1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5?! (5... Na5 {The main line.} 6. Bb5+ c6 7. dxc6 bxc6 {Black has compensation in form of initiativ...
The Halloween gambit(dubious) sacrifises a knight for a large centre: 1.e4 e4 2.Nf3 Nc6 3.Nc3 Nf6 4.Nxe5?! The optimal line is shown here: 4...Nxe5 5.d4 Ng6 6.e5 Ng8 7.Bc4 d5!? 8.Bd5 c6 9.Bc4/9.Bb3. ``` r1bqkbnr/pp3ppp/2p3n1/4P3/2BP4/2N5/PPP2PPP/R1BQK2R b KQkq - 1 9 ```
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The [Frankenstein-Dracula variation of the Vienna game](https://en.wikipedia.org/wiki/Vienna_Game,_Frankenstein%E2%80%93Dracula_Variation) features a Rook sacrifice by Black (effectively an exchange sacrifice however, since the Knight will not escape). ``` [FEN ""] 1.e4 e5 2.Nc3 Nf6 3.Bc4 Nxe4 4.Qh5 Nd6 5.Bb3 Nc6 6.Nb...
The Luccini Gambit sacs a rook. ``` [FEN ""] 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. d3 f5 5. Ng5 f4 6. Nf7 Qh4 ``` The Nakhmanson gambit sacs some pawns and a bishop ``` [FEN ""] 1. e4 e5 2. Bc4 Nf6 3. d4 exd4 4. Nf3 Nc6 5. O-O Nxe4 6. Nc3 dxc3 7. Bxf7+ Kxf7 8. Qd5+ ```
23,187
My impression of the word "gambit" is the sacrifice of a pawn or several pawns at the opening stage of a chess game. However, based on the definition on [Wikipedia](https://en.wikipedia.org/wiki/Gambit), a gambit (from ancient Italian gambetto, meaning "to trip") is a chess opening in which a player, more often White, ...
2018/12/09
[ "https://chess.stackexchange.com/questions/23187", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/16626/" ]
The Muzio Gambit in the King's Gambit is pretty well-known: ``` [FEN ""] 1. e4 e5 2. f4 exf4 3. Nf3 g5 4. Bc4 g4 (4... Bg7 {About as common on Lichess in the 1600-2000 range as 4... g4. If you're going to play for the Muzio, you'll have to be happy with reaching this position about half the time.}) 5. O-O!? gxf3 ``...
Look up the [Jerome Gambit](https://www.youtube.com/watch?v=pxRQm7nbOfc) in the Italian, where a bishop is sacrificed. It's not sound, but it's a lot of fun to play in bullet chess. I found this old post because I was looking for information on it. I just learned the name even though I've been using it since I started...
34,424,407
In the AWS S3 Console, you can grant permission to files for "Any Authenticated AWS User" and give "Open/Download" permissions. What is the CLI command to do the same? I already know the cp command (for uploading): ``` aws s3 cp filename s3://bucket/folder/filename ``` But, I can't figure out the --grants configur...
2015/12/22
[ "https://Stackoverflow.com/questions/34424407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4426091/" ]
You should use the `--acl` parameter to get the canned permissions: ``` aws s3 cp local.txt s3://some-bucket/remote.txt --acl authenticated-read ``` The documentation for [aws s3 cp](http://docs.aws.amazon.com/cli/latest/reference/s3/cp.html) describes what the shorthand syntax is for the CLI: > > --acl (string) S...
Check this link: [Using High-Level s3 Commands with the AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/using-s3-commands.html) You may want to do: ``` aws s3 cp filename s3://bucket/folder/filename --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers ``` For recursive, use ...
56,774,503
Here is my code and image where I have carousel recyclerview and each item has quite long text how can I cut the text and align text with the ending of imageView? ``` <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools" android:id="@+id/layout_container" android:la...
2019/06/26
[ "https://Stackoverflow.com/questions/56774503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9996550/" ]
[![enter image description here](https://i.stack.imgur.com/Kx3Be.png)](https://i.stack.imgur.com/Kx3Be.png) 1.Set text view width to match constraints (0dp) 2.Set constraints of the TextView`s right/letf to ImageView's right / left ``` <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.C...
Just change `android:layout_width="wrap_content"` to `android:layout_width="120dp"`
56,774,503
Here is my code and image where I have carousel recyclerview and each item has quite long text how can I cut the text and align text with the ending of imageView? ``` <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools" android:id="@+id/layout_container" android:la...
2019/06/26
[ "https://Stackoverflow.com/questions/56774503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9996550/" ]
[![enter image description here](https://i.stack.imgur.com/Kx3Be.png)](https://i.stack.imgur.com/Kx3Be.png) 1.Set text view width to match constraints (0dp) 2.Set constraints of the TextView`s right/letf to ImageView's right / left ``` <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.C...
You have to give your `textview width = "match_constraint"` which is basically equal to `0dp` this way your `textview` `width` will be equal to the constraint you have set at the end of your `textview`: ``` <TextView android:id="@+id/tv_title" android:layout_width="0dp" android:layout_height="wrap_content"...
61,023,188
I want to save all values (cases1) in a text file. But, when I execute the following code only the last value i.e 7 is saved in the variables.txt ```py cases1 = [1, 2, 3, 4, 5, 6,7] for j in cases1: promfac=j dict = {'promfac':promfac} varsave=repr(dict) file =...
2020/04/04
[ "https://Stackoverflow.com/questions/61023188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12235146/" ]
U should open you file outside the for loop if u are using ‘w’ or w+. Else use ‘a’. It looks like you are overwriting your file all the time instead of appending the file
You should use `a` instead of `w` in your code. Or you can open it with `w` and loop over your list and store it line by line like this: ``` cases1 = [1, 2, 3, 4, 5, 6, 7] with open("variables.txt", "w") as file: for i in case1: varsave = repr({'promfac': i}) file.write(varsave + '\n') ```
40,392,078
So I just started trying to learn rxjs and decided that I would implement it on a UI that I'm currently working on with React (I have time to do so, so I went for it). However, I'm still having a hard time wrapping my head around how it actually works... Not only "basic" stuff like when to actually use a Subject and wh...
2016/11/03
[ "https://Stackoverflow.com/questions/40392078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3359185/" ]
Make your filter items an Observable streams of click events using `Rx.Observable.fromevent` (see <https://github.com/Reactive-Extensions/RxJS/blob/master/doc/gettingstarted/events.md#converting-a-dom-event-to-a-rxjs-observable-sequence>) - it understands a multi-element selector for the click handling. You want to ke...
Actually, your problem is about RxJS, not React itself. So it is easy. Suppose you have two function: ```js const removeTag = tagName => tags => { const index = tags.indexOf(index) if (index !== -1) return tags else return tags.splice(index, 1, 0) } const addTag = tagName => tags => { ...
54,053,910
I want to get the number of employees by department and I wrote this script using Oracle but it always says that there is a missing expression The columns used in my tables : ``` department :name (the name of the department) - depnum (the id of the department"primary key"), employee : empnum (the id of the employ...
2019/01/05
[ "https://Stackoverflow.com/questions/54053910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10073107/" ]
If you want the number of employees by department, I would expect something like this: ``` select s.name, count(*) as num_employees from department s inner join employe p on s.depnum = p.depnum group by s.name ; ``` If you want the department names with the maximum number of names, you can use a `having` ...
you sql statement is not correct that's why it thrown that error. I think you tried something like below ``` select s.name from department s inner join employe p on s.depnum=p.depnum group by s.name having count(p.empnum)= select max(cnt) from ( select count(p.empnum) as cnt from employe p join department s on ...
23,108,905
I'have to add product in a cart using a seekbar with the amount in a alertdialog. My problem is to hide this alertdialog and come back to my orginal view. Can anyone help me how to solve this problem please ? ``` public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder( ...
2014/04/16
[ "https://Stackoverflow.com/questions/23108905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3541074/" ]
Actually there is no any `stop()` and `dismiss()` method for [`AlertDialog.Builder`](http://developer.android.com/reference/android/app/AlertDialog.Builder.html) Class. You have to create `AlertDialog` Object using `.create()` method of `AlertDialog.Builder` Class. Then call `.Stop()` or `.dismiss()` on `AlertDialog...
> > My problem is to hide this alertdialog and come back to my original > view . > > > => You just need to dismiss the dialog. It will automatically come back to your original view, which might be your product list. You have to create an object of AlertDialog, using which you can call dismiss() method whenever a...
23,108,905
I'have to add product in a cart using a seekbar with the amount in a alertdialog. My problem is to hide this alertdialog and come back to my orginal view. Can anyone help me how to solve this problem please ? ``` public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder( ...
2014/04/16
[ "https://Stackoverflow.com/questions/23108905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3541074/" ]
You have to write ``` final AlertDialog alertDialog = builder.create(); ``` then use ``` alertDialog.show(); ``` to show dialog and to dismiss alert use ``` alertDialog.dismiss(); ```
> > My problem is to hide this alertdialog and come back to my original > view . > > > => You just need to dismiss the dialog. It will automatically come back to your original view, which might be your product list. You have to create an object of AlertDialog, using which you can call dismiss() method whenever a...
23,108,905
I'have to add product in a cart using a seekbar with the amount in a alertdialog. My problem is to hide this alertdialog and come back to my orginal view. Can anyone help me how to solve this problem please ? ``` public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder( ...
2014/04/16
[ "https://Stackoverflow.com/questions/23108905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3541074/" ]
Actually there is no any `stop()` and `dismiss()` method for [`AlertDialog.Builder`](http://developer.android.com/reference/android/app/AlertDialog.Builder.html) Class. You have to create `AlertDialog` Object using `.create()` method of `AlertDialog.Builder` Class. Then call `.Stop()` or `.dismiss()` on `AlertDialog...
You have to write ``` final AlertDialog alertDialog = builder.create(); ``` then use ``` alertDialog.show(); ``` to show dialog and to dismiss alert use ``` alertDialog.dismiss(); ```
590,210
Let $f:X\to Y$ be a surjective morphism of schemes, and $Z\subset Y$ a closed subscheme with short exact sequence $$ 0\to I\_Z \to \mathcal{O}\_Y \to \mathcal{O}\_Z \to 0. $$ What are sufficient conditions on $X$, $Y$, $Z$ and $f$ such that the scheme-theoretic inverse image $W$ of $Z$ is a closed subscheme of $X$ with...
2013/12/02
[ "https://math.stackexchange.com/questions/590210", "https://math.stackexchange.com", "https://math.stackexchange.com/users/3416/" ]
Just to amplify Martin's answer, there will be short exact sequence $$0 \to f^{-1} I\_Z \to f^{-1} \mathcal O\_Y \to f^{-1} \mathcal O\_Z \to 0.$$ (The functor $f^{-1}$ is always exact.) Now we tensor with $\mathcal O\_Y$ over the natural map $f^{-1}\mathcal O\_Y \to \mathcal O\_X$ to obtain an exact sequence $$0 \to...
Do you see that $f^\*(I\_Z) \to \mathcal{O}\_X \to \mathcal{O}\_W \to 0$ is always exact? So the question is basically only if $f^\*(I\_Z) \to \mathcal{O}\_X$ is injective. This holds when $f$ is flat.
63,390,400
I have a React app and want to import Axios library to React component. But if I try to use Axios inside the component it is undefined. I mean this style: ``` import axios from 'axios' ``` Instead I have to write: ``` window.axios = require('axios').default; ``` and then call window.axios. This is the only way it...
2020/08/13
[ "https://Stackoverflow.com/questions/63390400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2092927/" ]
How about this one? ``` result = {} with open(filename, "r") as f: lines = f.readlines() for name_line, address_line in zip(lines[::3], lines[1::3]): name = name_line.replace(": ", ":").split(":")[1].strip() address = address_line.replace(": ", ":").split(":")[1].strip() if not name ...
Something like this? ```py contacts = {} with open('contacts.txt', 'r') as f: name = None for line in f: parts = line.rstrip().split(': ') if parts[0] == 'Name': name = parts[1] if name not in contacts: contacts[name] = {} # Initialize empty dict for new name elif parts[0] == 'E...
63,390,400
I have a React app and want to import Axios library to React component. But if I try to use Axios inside the component it is undefined. I mean this style: ``` import axios from 'axios' ``` Instead I have to write: ``` window.axios = require('axios').default; ``` and then call window.axios. This is the only way it...
2020/08/13
[ "https://Stackoverflow.com/questions/63390400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2092927/" ]
Yet another example! ``` with open('contacts', 'r') as file: for read_file in file.read().split("\n\n"): #data chunks apart data = read_file.split("\n") #split email/name name = data[0].split(" ")[1] #split at space and grab second email = data[1].split(" ")[1] #^ if name not in d: ...
Something like this? ```py contacts = {} with open('contacts.txt', 'r') as f: name = None for line in f: parts = line.rstrip().split(': ') if parts[0] == 'Name': name = parts[1] if name not in contacts: contacts[name] = {} # Initialize empty dict for new name elif parts[0] == 'E...
63,390,400
I have a React app and want to import Axios library to React component. But if I try to use Axios inside the component it is undefined. I mean this style: ``` import axios from 'axios' ``` Instead I have to write: ``` window.axios = require('axios').default; ``` and then call window.axios. This is the only way it...
2020/08/13
[ "https://Stackoverflow.com/questions/63390400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2092927/" ]
How about this one? ``` result = {} with open(filename, "r") as f: lines = f.readlines() for name_line, address_line in zip(lines[::3], lines[1::3]): name = name_line.replace(": ", ":").split(":")[1].strip() address = address_line.replace(": ", ":").split(":")[1].strip() if not name ...
I do not understand WHY such a data structure is advantageous, ```py {"name":(email, count)} ``` would likely be better, as I only see one `email` per `name`. But this parses the data into the format you specify: ```py result = dict() with open('contacts', 'r') as file: # read all lines from file lines = ...
63,390,400
I have a React app and want to import Axios library to React component. But if I try to use Axios inside the component it is undefined. I mean this style: ``` import axios from 'axios' ``` Instead I have to write: ``` window.axios = require('axios').default; ``` and then call window.axios. This is the only way it...
2020/08/13
[ "https://Stackoverflow.com/questions/63390400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2092927/" ]
Yet another example! ``` with open('contacts', 'r') as file: for read_file in file.read().split("\n\n"): #data chunks apart data = read_file.split("\n") #split email/name name = data[0].split(" ")[1] #split at space and grab second email = data[1].split(" ")[1] #^ if name not in d: ...
I do not understand WHY such a data structure is advantageous, ```py {"name":(email, count)} ``` would likely be better, as I only see one `email` per `name`. But this parses the data into the format you specify: ```py result = dict() with open('contacts', 'r') as file: # read all lines from file lines = ...
50,533,041
I need to retrieve names from a database, these names can be searched using accented and unaccented vowels, in both ways the response has to return all matched names. The approach I used to solve this problem is a function that replaces the vowels from the searched name with a string that contains both vowels in order ...
2018/05/25
[ "https://Stackoverflow.com/questions/50533041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7764928/" ]
A simple (very minor) speed optimization would be to make the vowel list an object, and just go through `fullName` once. As a bonus, the code works as intended now! ``` const replaceVowels = fullName => { const v = { "a": "[aá]", "e": "[eé]", "i": "[ií]", "o": "[oó]", "u": "[uú]", "á": "[aá]"...
For making things more efficient, why not just use a [text index](https://docs.mongodb.com/manual/core/index-text/) in MongoDB - especially as they already have the behaviour you desire? However, clearing up the earlier answer I gave, you can make the function more compact. ```js const replaceVowels = fullName => { ...
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Check the `$_SERVER['HTTP_REFERER']` variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the `Http-Referer` header can easily been changed or modified by a client. **EDIT:** Just googled for `phpinfo` (because chanes were high that I get a `phpinfo()` page that sh...
It looks like you can use the $\_SERVER['HTTP\_REFERER'] variable. But I think the value is controlled by the client and can't always be guaranteed to exist or accurate.
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You would check the `$_SERVER['HTTP_REFERER']` if you wanted to do it in PHP. You can also use `document.referrer` in javascript.
HTTP\_REFERER : Returns a string containing the URL of the page that referred the request to the current page using an tag. If the page is redirected, HTTP\_REFERER is empty. Using HTTP\_REFERER used for ASP.
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like you can use the $\_SERVER['HTTP\_REFERER'] variable. But I think the value is controlled by the client and can't always be guaranteed to exist or accurate.
You would check the `$_SERVER['HTTP_REFERER']` if you wanted to do it in PHP. You can also use `document.referrer` in javascript.
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Check the `$_SERVER['HTTP_REFERER']` variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the `Http-Referer` header can easily been changed or modified by a client. **EDIT:** Just googled for `phpinfo` (because chanes were high that I get a `phpinfo()` page that sh...
Yes, use the HTTP\_ REFERER var in the $\_SERVER array: ``` $_SERVER['HTTP_REFERER']; ``` This shoudl then include something like <http://www.google.com/?q=etc> Note however that the REFERER is not always set because clients can disable their browser to send it in the request.
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Check the `$_SERVER['HTTP_REFERER']` variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the `Http-Referer` header can easily been changed or modified by a client. **EDIT:** Just googled for `phpinfo` (because chanes were high that I get a `phpinfo()` page that sh...
Check referrer of a request. It should contain www.google.com/...
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like you can use the $\_SERVER['HTTP\_REFERER'] variable. But I think the value is controlled by the client and can't always be guaranteed to exist or accurate.
Check referrer of a request. It should contain www.google.com/...
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Yes, use the HTTP\_ REFERER var in the $\_SERVER array: ``` $_SERVER['HTTP_REFERER']; ``` This shoudl then include something like <http://www.google.com/?q=etc> Note however that the REFERER is not always set because clients can disable their browser to send it in the request.
Check referrer of a request. It should contain www.google.com/...
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You would check the `$_SERVER['HTTP_REFERER']` if you wanted to do it in PHP. You can also use `document.referrer` in javascript.
Check referrer of a request. It should contain www.google.com/...
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Check the `$_SERVER['HTTP_REFERER']` variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the `Http-Referer` header can easily been changed or modified by a client. **EDIT:** Just googled for `phpinfo` (because chanes were high that I get a `phpinfo()` page that sh...
HTTP\_REFERER : Returns a string containing the URL of the page that referred the request to the current page using an tag. If the page is redirected, HTTP\_REFERER is empty. Using HTTP\_REFERER used for ASP.
700,685
I am trying to install VMWare ESXi 3.5 on a DELL GX280 machine which has SATA configurations. As ESXi doesn't support SATA, i am not able to proceed. I could able to install on IDE (which is also not supported) by making some changes. Is there a way to install on SATA as well?? Please let me know if anyone has tried ...
2009/03/31
[ "https://Stackoverflow.com/questions/700685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Check the `$_SERVER['HTTP_REFERER']` variable which should contain the referring URL. Please note that this is not tamper-proof or fail-safe as the `Http-Referer` header can easily been changed or modified by a client. **EDIT:** Just googled for `phpinfo` (because chanes were high that I get a `phpinfo()` page that sh...
You would check the `$_SERVER['HTTP_REFERER']` if you wanted to do it in PHP. You can also use `document.referrer` in javascript.
18,341,855
I wish to send custom built xmpp/jabber requests to a chat server. The Jabber XML content looks like: ``` <message from='foo@bar.abc/def' to='def@ghi/jkl' xml:lang='' id='xyz' type='groupchat'> <body> Hello World </body> </message> ``` How do I send other custom messages if I wish to change the values of "foo", "def...
2013/08/20
[ "https://Stackoverflow.com/questions/18341855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2494258/" ]
I figured out a way. Using Pidgin and its XMPP Console it is pretty easy to send any custom built xmpp messages.
Use Telnet! ``` telnet chat.facebook.com 522 ``` Then send your XML.
15,983,203
I'm using webapp2 for web development. In my dev environment, how can I have it reload code changes automatically? I'm using `httpserver.serve(app, host='127.0.0.1', port='8008')` but every time I change my code I need to stop the server and start it again. I've used webapp2 with the Google App Engine launcher provide...
2013/04/13
[ "https://Stackoverflow.com/questions/15983203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327694/" ]
Turns out that the Google App Engine launcher provided by Google is borrowing the autoreload code from the Django framework, specifically this: <https://github.com/django/django/blob/master/django/utils/autoreload.py> Searched Stackoverflow and there were some related questions that provide answers: [How to automatica...
Paste has its own auto-reload funcionallity (maybe it wasn't there when the original answer was provided).. ``` app = webapp2.WSGIApplication(...) def main(): from paste import httpserver, reload reload.install() httpserver.serve(app, ...) ``` Then just start your server using the shell script provided b...
68,465,208
I am trying to run some time series deep learning algorithms, and they require some modules. However, when I run the the following code it gives me an error: ``` import pickle import warnings from math import sqrt import lightgbm as lgb import matplotlib as mpl import numpy as np import pandas as pd # Basic library ...
2021/07/21
[ "https://Stackoverflow.com/questions/68465208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4889002/" ]
Use CSS and `border`. Remove the right border from the `:last-child` ```css .row { display: flex; justify-content: center; } .links a { padding: 0 1.2rem; border-right: 2px solid #888; } .links a:last-child { border-right: 0; } ``` ```html <div class="row links"> <a href="#">Some link 1</a> <a href...
wrap all your elements inside a `div` with `display:flex` ``` <div class="wrapper"> **your codes** </div> .wrapper{ display: flex; } ```
68,465,208
I am trying to run some time series deep learning algorithms, and they require some modules. However, when I run the the following code it gives me an error: ``` import pickle import warnings from math import sqrt import lightgbm as lgb import matplotlib as mpl import numpy as np import pandas as pd # Basic library ...
2021/07/21
[ "https://Stackoverflow.com/questions/68465208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4889002/" ]
You can use `border-left` property and use it on every prepend child ```css .row { display: flex; justify-content: center; } a { padding: 0 1rem; } a + a { border-left: 2px solid #888; } ``` ```html <div class="row"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> ```
wrap all your elements inside a `div` with `display:flex` ``` <div class="wrapper"> **your codes** </div> .wrapper{ display: flex; } ```
68,465,208
I am trying to run some time series deep learning algorithms, and they require some modules. However, when I run the the following code it gives me an error: ``` import pickle import warnings from math import sqrt import lightgbm as lgb import matplotlib as mpl import numpy as np import pandas as pd # Basic library ...
2021/07/21
[ "https://Stackoverflow.com/questions/68465208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4889002/" ]
Use CSS and `border`. Remove the right border from the `:last-child` ```css .row { display: flex; justify-content: center; } .links a { padding: 0 1.2rem; border-right: 2px solid #888; } .links a:last-child { border-right: 0; } ``` ```html <div class="row links"> <a href="#">Some link 1</a> <a href...
You can use `border-left` property and use it on every prepend child ```css .row { display: flex; justify-content: center; } a { padding: 0 1rem; } a + a { border-left: 2px solid #888; } ``` ```html <div class="row"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> ```
18,451,681
is there a way to find queries in mongodb that are not using Indexes or are SLOW? In MySQL that is possible with the following settings inside configuration file: ``` log-queries-not-using-indexes = 1 log_slow_queries = /tmp/slowmysql.log ```
2013/08/26
[ "https://Stackoverflow.com/questions/18451681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1233751/" ]
First, you must set up your profiling, specifying what the log level that you want. The 3 options are: * 0 - logger off * 1 - log slow queries * 2 - log all queries You do this by running your `mongod` deamon with the `--profile` options: `mongod --profile 2 --slowms 20` With this, the logs will be written to the `...
In case somebody ends up here from Google on this old question, I found that `explain` really helped me fix specific queries that I could see were causing `COLLSCAN`s from the logs. Example: `db.collection.find().explain()` This will let you know if the query is using a `COLLSCAN` (Basic Cursor) or an `index` (BTree...
18,451,681
is there a way to find queries in mongodb that are not using Indexes or are SLOW? In MySQL that is possible with the following settings inside configuration file: ``` log-queries-not-using-indexes = 1 log_slow_queries = /tmp/slowmysql.log ```
2013/08/26
[ "https://Stackoverflow.com/questions/18451681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1233751/" ]
The equivalent approach in MongoDB would be to use the [query profiler](https://docs.mongodb.com/manual/tutorial/manage-the-database-profiler/) to track and diagnose slow queries. With profiling enabled for a database, slow operations are written to the `system.profile` capped collection (which by default is 1Mb in si...
In case somebody ends up here from Google on this old question, I found that `explain` really helped me fix specific queries that I could see were causing `COLLSCAN`s from the logs. Example: `db.collection.find().explain()` This will let you know if the query is using a `COLLSCAN` (Basic Cursor) or an `index` (BTree...