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
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
I tested this and it worked fine. Ensure your script begins with the correct [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)), e.g. [`#!/usr/bin/env bash`](https://stackoverflow.com/a/10383546/4970442) . Then follow these steps: * Hit `Alt`+`F2` to run a command. * Type `dconf-editor` and hit `Enter`. * In dco...
As a complement to [the answer about Thunar](https://askubuntu.com/a/871986/925128): that answer would re-enable a previous feature of Thunar to execute scripts on double click. But that feature was considered a security risk. To avoid that, maybe the most elegant solution is to get a pop-up window with a question lik...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
I tested this and it worked fine. Ensure your script begins with the correct [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)), e.g. [`#!/usr/bin/env bash`](https://stackoverflow.com/a/10383546/4970442) . Then follow these steps: * Hit `Alt`+`F2` to run a command. * Type `dconf-editor` and hit `Enter`. * In dco...
OS: Linux Mint (I'm using 18.3) I struggled for ages with this, trying to find out how you can click (or double-click) an executable item and get it to run, without further questions. I looked at all the stuff under Nemo Edit --> Preferences. The answer is actually very simple, and set up for you... I don't know wheth...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
You have to check 3 points : * Nautilus / Nemo configuration : <https://askubuntu.com/a/286651/301025> * The script file must be *executable*: <https://askubuntu.com/a/275714/301025> * The file system must allow *execution* : 1. Type `mount` in a console 2. Check if your file system has the `noexec` flag 3. Remove...
Based on `umask` defualt value, you haven't execute permissions for files by default and must change mod to gain execute permissions, something like this: ``` chmod u+x filename ```
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
When you create a launch in Desktop to a SHEL script or Whatever, in command line, don't forget to signal the script, to be executed in background. The script will die when he finished is job.
Specially for Android Studio You can follow my [original answer here](https://askubuntu.com/a/735658/410659): To Create Desktop Launcher: =========================== * Click on `Create Desktop Entry..` from **Tools** menu. [![enter image description here](https://i.stack.imgur.com/z0qpM.png)](https://i.stack.imgur.c...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
You have to check 3 points : * Nautilus / Nemo configuration : <https://askubuntu.com/a/286651/301025> * The script file must be *executable*: <https://askubuntu.com/a/275714/301025> * The file system must allow *execution* : 1. Type `mount` in a console 2. Check if your file system has the `noexec` flag 3. Remove...
As a complement to [the answer about Thunar](https://askubuntu.com/a/871986/925128): that answer would re-enable a previous feature of Thunar to execute scripts on double click. But that feature was considered a security risk. To avoid that, maybe the most elegant solution is to get a pop-up window with a question lik...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
I tested this and it worked fine. Ensure your script begins with the correct [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)), e.g. [`#!/usr/bin/env bash`](https://stackoverflow.com/a/10383546/4970442) . Then follow these steps: * Hit `Alt`+`F2` to run a command. * Type `dconf-editor` and hit `Enter`. * In dco...
For Ubuntu 20.04: ================= 1. Open *Files* (*Nautilus* is called *Files* now), click on the hamburger menu and select **Preferences**. [![enter image description here](https://i.stack.imgur.com/lLAkzm.png)](https://i.stack.imgur.com/lLAkzm.png) 2. Go to the **Behaviour** tab and select what's suitable from ...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
On Nautilus (AKA Files) 1. Go to Files (*Edit* on Unity (17.04 or below)) > Preferences > Behavior tab [![screenshot](https://i.stack.imgur.com/gL1po.png)](https://i.stack.imgur.com/gL1po.png) 2. Change the settings for executable text file. [![screenshot](https://i.stack.imgur.com/8OHSY.png)](https://i.stack.imgur...
In Ubuntu and all Unix based OSes, afaik, nothing is set as executable by default. There are two ways of doing this. 1. Right click on the script or file you want to execute. Go to Properties then to the Permissions Tab. Click the check box that says Execute. 2. Open a Terminal [`cd`](http://manpages.ubuntu.com/manpag...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
I tested this and it worked fine. Ensure your script begins with the correct [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)), e.g. [`#!/usr/bin/env bash`](https://stackoverflow.com/a/10383546/4970442) . Then follow these steps: * Hit `Alt`+`F2` to run a command. * Type `dconf-editor` and hit `Enter`. * In dco...
In Ubuntu and all Unix based OSes, afaik, nothing is set as executable by default. There are two ways of doing this. 1. Right click on the script or file you want to execute. Go to Properties then to the Permissions Tab. Click the check box that says Execute. 2. Open a Terminal [`cd`](http://manpages.ubuntu.com/manpag...
138,908
How can I make a bash script executable by double clicking just like `.exe` files in Windows? I tried [creating a launcher and assigning the script to it](https://askubuntu.com/q/34597/24694), but there are two consequences: 1. the terminal twinkles, disappears, and nothing is done. 2. you must specify to run in termi...
2012/05/18
[ "https://askubuntu.com/questions/138908", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
I think creating a *\*.desktop* file is missing here: ``` $ cat shortcut-for-my-script.desktop [Desktop Entry] Type=Application Terminal=true Name=Click-Script Icon=utilities-terminal Exec=gnome-terminal -e "bash -c './script.sh;$SHELL'" Categories=Application; ``` If you create more than one *\*.desktop* file for o...
As a complement to [the answer about Thunar](https://askubuntu.com/a/871986/925128): that answer would re-enable a previous feature of Thunar to execute scripts on double click. But that feature was considered a security risk. To avoid that, maybe the most elegant solution is to get a pop-up window with a question lik...
6,995,023
What's the absolute simplest way to generate a *URL safe* checksum for a string in .NET? I'll use this checksum as a lookup and it will be part of and URL and therefore needs to be URL safe. GetHashCode would have been perfekt for me if it only generated the same hash for the same string on [different version of .NET]...
2011/08/09
[ "https://Stackoverflow.com/questions/6995023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298/" ]
Create an MD5 checksum (or any other) then use > > HttpServerUtility.UrlTokenEncode > > > to encode the string. --- EDITED to reflect comments
Base64 is not url safe. It includes the chars "+", "=" and "/". A SHA1 (or MD5) hash only contains the characters 0-9a-f and is therefor url safe without url encoding or base64. Example method that returns a 40 char lowercase SHA1 hash from a string: ``` public static string GetSHA1Hash(string input) { byte[] by...
9,710,609
I'm using "users" table with over 2 millions records. The query is: ``` SELECT * FROM users WHERE 1 ORDER BY firstname LIMIT $start,30 ``` "firstname" column is indexed. Getting first pages is very fast while getting last pages is very slow. I used EXPLAIN and here are the results: for ``` EXPLAIN SELECT * FROM ...
2012/03/14
[ "https://Stackoverflow.com/questions/9710609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1270172/" ]
You shouldn't use limit to page that far into your dataset. You'll get **much** better results by using range queries. ``` SELECT * FROM users WHERE firstname >= last_used_name ORDER BY firstname LIMIT 30 ``` Where `last_used_name` is one that you already seen (I'm assuming that you do batch processing of some s...
For `*` queries without WHERE condition MySQL often does not use any indexes. The following query should be much faster and make use of the index: ``` SELECT * FROM ( SELECT user_id FROM users WHERE 1 ORDER BY firstname LIMIT $start, 30) ids JOIN users USING (user_id); ``` `user_id` is the primary key.
35,486,767
If I don't use a thread, I can normally use `@which_port.text.to_i` in port declaration. If I use a thread, it looks like this statement `@which_port.text.to_i` don't work. I can only write port manually, e.g. `6000` and then my program works good. I have to use thread because my program freezes otherwise. Is any way a...
2016/02/18
[ "https://Stackoverflow.com/questions/35486767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5720724/" ]
Every time you launch a **window** you are launching a totally new app so variables in that new app are unknown to the other app, and those in the first app, the one that fired the window method are unknown to the new app ! Fortunately there is a **owner** method available in every Shoes app, in your case owner called ...
If this is Shoes 4 then it is very likely that the thread doesn't have access to the UI (only the main thread has access to the UI). You could try extracting the value beforehand and then passing it to write as an argument: ``` def write(port) #... end port = @which_port.text.to_i @th1 = Thread.new { write(port) } ...
20,849
I am looking for someone to be my match. Try this riddle to see if it's you. > > This riddle is slightly different, but I think you will get used to it with time. > > > Your brain is evolved, is it not? Then you should have two legs to stand on. > > > Feel free to sketch out your ideas or to draw quick conclusion...
2015/09/02
[ "https://puzzling.stackexchange.com/questions/20849", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/11452/" ]
**Partial answer:** I noticed all of those could be > > Something like emotions/feelings/... In order: > Patience, Reason, Excitement, Motivation, Anger, Despair, Regret, Satisfaction, Relief, Hope > > > Now I'm having trouble to find *the one* though ;)
Partial guess: I wanted to just ask a question in the comments but I don't have enough (any) reputation. > > Does it have anything to do with elements (periodic table or lore e.g. fire air water etc)? You mentioned "element" in a hint and in a comment, but that could just be you liking the word's description of the...
20,849
I am looking for someone to be my match. Try this riddle to see if it's you. > > This riddle is slightly different, but I think you will get used to it with time. > > > Your brain is evolved, is it not? Then you should have two legs to stand on. > > > Feel free to sketch out your ideas or to draw quick conclusion...
2015/09/02
[ "https://puzzling.stackexchange.com/questions/20849", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/11452/" ]
Ok, I'm pretty sure it's referring to... > > ...words with **"mate"** in them > > > *This riddle is slightly different, but I think you will get used to it with time.* > > Accli**mate** > > > *Your brain is evolved, is it not? Then you should have two legs to stand on.* > > Pri**mate** > > > *Feel ...
**Partial answer:** I noticed all of those could be > > Something like emotions/feelings/... In order: > Patience, Reason, Excitement, Motivation, Anger, Despair, Regret, Satisfaction, Relief, Hope > > > Now I'm having trouble to find *the one* though ;)
20,849
I am looking for someone to be my match. Try this riddle to see if it's you. > > This riddle is slightly different, but I think you will get used to it with time. > > > Your brain is evolved, is it not? Then you should have two legs to stand on. > > > Feel free to sketch out your ideas or to draw quick conclusion...
2015/09/02
[ "https://puzzling.stackexchange.com/questions/20849", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/11452/" ]
Ok, I'm pretty sure it's referring to... > > ...words with **"mate"** in them > > > *This riddle is slightly different, but I think you will get used to it with time.* > > Accli**mate** > > > *Your brain is evolved, is it not? Then you should have two legs to stand on.* > > Pri**mate** > > > *Feel ...
Partial guess: I wanted to just ask a question in the comments but I don't have enough (any) reputation. > > Does it have anything to do with elements (periodic table or lore e.g. fire air water etc)? You mentioned "element" in a hint and in a comment, but that could just be you liking the word's description of the...
29,400,168
How does one sort a character-delimited string of a variable length? I'd like to sort this table ``` number | make =========|========= 11280-08 | bmw 13920-08 | audi 44630-08 | audi 1741-08 | mercedes 03-05 | audi 40093-08 | audi 332-04 | bmw ``` so that first ascend the suffixes `-00` and then the prefixes...
2015/04/01
[ "https://Stackoverflow.com/questions/29400168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1810277/" ]
``` some_list = ["some", "values", "in", "a", "list", ] func(*some_list) ``` This is equivalent to: ``` func("some", "values", "in", "a", "list") ``` The fixed `x` param might warrant a thought: ``` func(5, *some_list) ``` ... is equivalent to: ``` func(5, "some", "values", "in", "a", "list") ``` If you don'...
Pass the values as comma separated values ``` >>> def func(x, *p): # p is stored as tuple ... print "x =",x ... for i in p: ... print i ... return p ... >>> print func(1,2,3,4) # x value 1, p takes the rest x = 1 2 3 4 (2,3,4) # returns p as a tuple ``` Yo...
60,696,852
I am very new to Python and am trying to extract a table from a website where the items that are on the same line in the HTML table are on the same line in the CSV output. ``` from bs4 import BeautifulSoup # BeautifulSoup is in bs4 package import requests URL = 'https://ir.huntsman.com/news-releases/detail/427/hunts...
2020/03/15
[ "https://Stackoverflow.com/questions/60696852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13066978/" ]
First, `fetch` is asynchronous. So, the fetch statement might be pending by the time you try to console.log the result inside the child constructor. Putting the console.log inside the `render` method would work, because the component will be rerendered, if the state `items` changes.
The only problem you have is that you are trying to use `this.props.name` and your `Map` component props are called `list` and `items`, so it will return `undefined`. If you log your props in the constructor you will get the initial state of `Main` because the fetch hasn't returned anything yet. Remember that the cons...
60,696,852
I am very new to Python and am trying to extract a table from a website where the items that are on the same line in the HTML table are on the same line in the CSV output. ``` from bs4 import BeautifulSoup # BeautifulSoup is in bs4 package import requests URL = 'https://ir.huntsman.com/news-releases/detail/427/hunts...
2020/03/15
[ "https://Stackoverflow.com/questions/60696852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13066978/" ]
The [constructor](https://reactjs.org/docs/react-component.html#constructor) for a component only runs one time during a lifecycle. When it does, `props.items` is undefined because your ajax request is in-flight, so `console.log(props.items)` doesn't show anything. If you change your constructor to `console.log("const...
The only problem you have is that you are trying to use `this.props.name` and your `Map` component props are called `list` and `items`, so it will return `undefined`. If you log your props in the constructor you will get the initial state of `Main` because the fetch hasn't returned anything yet. Remember that the cons...
30,698,265
I'm updating a little Polymer element to 1.x. It works fine in Chrome and Safari, but in the latest Firefox I get several "uncaught exception: Element name could not be inferred." errors. Seems to be related to the html imports, because if I remove everything from the component.html except for the imports, then the e...
2015/06/07
[ "https://Stackoverflow.com/questions/30698265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136349/" ]
as per [heroku doc](https://devcenter.heroku.com/articles/git#deploying-code) `git push staging develop:master`
Its not as close to the most direct command line - but my DevOps pipeline using Codeship makes this much easier for commits on different branches. I have Codeship automatically deploy anything to the dev branch to one Heroku app, anything in the staging branch to another, and anything to master to the live branch. No...
30,698,265
I'm updating a little Polymer element to 1.x. It works fine in Chrome and Safari, but in the latest Firefox I get several "uncaught exception: Element name could not be inferred." errors. Seems to be related to the html imports, because if I remove everything from the component.html except for the imports, then the e...
2015/06/07
[ "https://Stackoverflow.com/questions/30698265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136349/" ]
as per Git documentaion ``` git push <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME> ``` so ``` git push heroku staging:master ``` means ``` push my staging local branch to master remote heroku branch ```
Its not as close to the most direct command line - but my DevOps pipeline using Codeship makes this much easier for commits on different branches. I have Codeship automatically deploy anything to the dev branch to one Heroku app, anything in the staging branch to another, and anything to master to the live branch. No...
49,146,783
For curiosity and because I think this can be helpful in the future, I tried to do a very simplistic animation through a Promise() object, trying to figure it out how it would work and understand how to structure it, but I'm a bit unsure of its structure, because there's a function *movingBox* that doesn't get called. ...
2018/03/07
[ "https://Stackoverflow.com/questions/49146783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2953385/" ]
Basically the concept of a promise is that you can use the returned method `then()` to perform a callback once the logic inside the function has executed. In your example you execute `resolve()` when you construct the promise. This means your animation will run after the promise resolves. What you want to do is call `r...
``` <!DOCTYPE html> <html> <header> <style> #box { width: 75px; height: 75px; position: relative; background-color: blueviolet; } </style> </header> <body> <div id="box"></div> <script> ...
70,356,141
I currently try to parse datetime in tabulator js library. My datetime string is "2021-09-11T00:00:00.000Z". On the last release, they change the datetime library to luxon. I didn't success to find the good format for that kind of date. In the documentation, it seems that they kept the last datetime library moment.js....
2021/12/14
[ "https://Stackoverflow.com/questions/70356141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12447573/" ]
As of Tabulator v5.1 there is now built in iso support for formatters ```js {title:"Example", field:"example", formatter:"datetime", formatterParams:{ inputFormat:"iso", }} ``` And sorters: ```js {title:"Example", field:"example", sorter:"datetime", sorterParams:{ format:"iso", }} ```
As you see [datetime](https://github.com/olifolkerd/tabulator/blob/41e79e1eacbb285783f561899e5e8836d2e0d75d/src/js/modules/Format/defaults/formatters/datetime.js#L9) , there you can see that you will not able to use ISO date here.. In your case you are using ISO data format which needs to be format using `fromISO` and ...
783,792
When running the following python code: ``` >>> f = open(r"myfile.txt", "a+") >>> f.seek(-1,2) >>> f.read() 'a' >>> f.write('\n') ```...
2009/04/23
[ "https://Stackoverflow.com/questions/783792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/79332/" ]
This appears to be a Windows-specific problem - see <http://bugs.python.org/issue1521491> for a similar issue. Even better, a workaround given and explained at <http://mail.python.org/pipermail/python-bugs-list/2005-August/029886.html>, insert: ``` f.seek(f.tell()) ``` between the read() and write() calls.
the a+ mode is for appending, if you want to read & write, you are looking for r+. try this: ``` >>> f = open("myfile.txt", "r+") >>> f.write('\n') ``` **Edit:** you should have specified your platform initially... there are known problems with seek within windows. When trying to seek, UNIX and Win32 have differen...
783,792
When running the following python code: ``` >>> f = open(r"myfile.txt", "a+") >>> f.seek(-1,2) >>> f.read() 'a' >>> f.write('\n') ```...
2009/04/23
[ "https://Stackoverflow.com/questions/783792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/79332/" ]
the a+ mode is for appending, if you want to read & write, you are looking for r+. try this: ``` >>> f = open("myfile.txt", "r+") >>> f.write('\n') ``` **Edit:** you should have specified your platform initially... there are known problems with seek within windows. When trying to seek, UNIX and Win32 have differen...
Works for me: ``` $ echo hello > myfile.txt $ python Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> f = open('myfile.txt', 'r+') >>> f.seek(-1, 2) >>> f.tell() 5L >>> f.read() '\n' >>> f.write('\n') >>> f.close() ``` ...
783,792
When running the following python code: ``` >>> f = open(r"myfile.txt", "a+") >>> f.seek(-1,2) >>> f.read() 'a' >>> f.write('\n') ```...
2009/04/23
[ "https://Stackoverflow.com/questions/783792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/79332/" ]
This appears to be a Windows-specific problem - see <http://bugs.python.org/issue1521491> for a similar issue. Even better, a workaround given and explained at <http://mail.python.org/pipermail/python-bugs-list/2005-August/029886.html>, insert: ``` f.seek(f.tell()) ``` between the read() and write() calls.
Works for me: ``` $ echo hello > myfile.txt $ python Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> f = open('myfile.txt', 'r+') >>> f.seek(-1, 2) >>> f.tell() 5L >>> f.read() '\n' >>> f.write('\n') >>> f.close() ``` ...
64,244,614
Is it possible to see the compiled c# code in visual studio (when it is compiled to assembly/IL)? I am looking at branchless programming and would like to compare how different functions compile for better optimisation. (Note: Im currently just using a stopwatch to time how long functions take to complete). I havent ...
2020/10/07
[ "https://Stackoverflow.com/questions/64244614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14407533/" ]
You could use an online compiler/reviewer like SharpLab (<https://sharplab.io/>) There are others out there as well, and I've never compared them head to head to see if they varied.
Use [`BenchMark.Net`](https://github.com/dotnet/BenchmarkDotNet) to run your code. It lets you decorate your code with a [`[DisassemblyDiagnoser]` attribute](https://benchmarkdotnet.org/articles/configs/diagnosers.html#sample-introdisassembly) which will output things like: ``` ; .NET Framework 4.7.2 (CLR 4.0.30319.4...
64,244,614
Is it possible to see the compiled c# code in visual studio (when it is compiled to assembly/IL)? I am looking at branchless programming and would like to compare how different functions compile for better optimisation. (Note: Im currently just using a stopwatch to time how long functions take to complete). I havent ...
2020/10/07
[ "https://Stackoverflow.com/questions/64244614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14407533/" ]
You could use an online compiler/reviewer like SharpLab (<https://sharplab.io/>) There are others out there as well, and I've never compared them head to head to see if they varied.
I use ReSharper for this, which allows you to do this directly from VisualStudio. Unless you are a student it's unfortunately rather pricey, because this is only a small functionality of it. <https://www.jetbrains.com/help/resharper/Viewing_Intermediate_Language.html>
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
The same way you do for String and Int , you just place different types inside: ``` Date [] dates = { new Date(), new Date() }; ``` Declared an array of size two with two dates. You can also initialize with null values: ``` Date [] dates = new Date[2]; ``` Or add more significant values: ``` Date [...
you can use an array of `java.util.Date` (API docs are [here](http://java.sun.com/javase/6/docs/api/java/util/Date.html)) ``` Date[] dates = new Date[] { new Date(), new Date(), }; ``` You can create an array of any object type in java - all reference and primitive types
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
The same way you do for String and Int , you just place different types inside: ``` Date [] dates = { new Date(), new Date() }; ``` Declared an array of size two with two dates. You can also initialize with null values: ``` Date [] dates = new Date[2]; ``` Or add more significant values: ``` Date [...
Or you could use the Collections API and Calendar class, ``` import java.util.*; List<Calendar> dates = new ArrayList<Calendar>(5); // initial size dates.add( Calendar.getInstance() ); ```
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
The same way you do for String and Int , you just place different types inside: ``` Date [] dates = { new Date(), new Date() }; ``` Declared an array of size two with two dates. You can also initialize with null values: ``` Date [] dates = new Date[2]; ``` Or add more significant values: ``` Date [...
You can consider (and this is not reality, but it sort of works this way) that primitives are something like this (I do get to reality later on... so keep reading): int.7, int.42 (won't compile) where int is a class (it is not) and 7 and 42 are public static final variables (they are not). and that Strings are someth...
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
The same way you do for String and Int , you just place different types inside: ``` Date [] dates = { new Date(), new Date() }; ``` Declared an array of size two with two dates. You can also initialize with null values: ``` Date [] dates = new Date[2]; ``` Or add more significant values: ``` Date [...
Did you mean inputting an array of dates.This code would help.. ``` import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Scanner; public class Datinput { public static void main(String args[]) { int n; ArrayList<St...
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
you can use an array of `java.util.Date` (API docs are [here](http://java.sun.com/javase/6/docs/api/java/util/Date.html)) ``` Date[] dates = new Date[] { new Date(), new Date(), }; ``` You can create an array of any object type in java - all reference and primitive types
Or you could use the Collections API and Calendar class, ``` import java.util.*; List<Calendar> dates = new ArrayList<Calendar>(5); // initial size dates.add( Calendar.getInstance() ); ```
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
you can use an array of `java.util.Date` (API docs are [here](http://java.sun.com/javase/6/docs/api/java/util/Date.html)) ``` Date[] dates = new Date[] { new Date(), new Date(), }; ``` You can create an array of any object type in java - all reference and primitive types
You can consider (and this is not reality, but it sort of works this way) that primitives are something like this (I do get to reality later on... so keep reading): int.7, int.42 (won't compile) where int is a class (it is not) and 7 and 42 are public static final variables (they are not). and that Strings are someth...
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
you can use an array of `java.util.Date` (API docs are [here](http://java.sun.com/javase/6/docs/api/java/util/Date.html)) ``` Date[] dates = new Date[] { new Date(), new Date(), }; ``` You can create an array of any object type in java - all reference and primitive types
Did you mean inputting an array of dates.This code would help.. ``` import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Scanner; public class Datinput { public static void main(String args[]) { int n; ArrayList<St...
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
Or you could use the Collections API and Calendar class, ``` import java.util.*; List<Calendar> dates = new ArrayList<Calendar>(5); // initial size dates.add( Calendar.getInstance() ); ```
You can consider (and this is not reality, but it sort of works this way) that primitives are something like this (I do get to reality later on... so keep reading): int.7, int.42 (won't compile) where int is a class (it is not) and 7 and 42 are public static final variables (they are not). and that Strings are someth...
1,801,044
I know how to create an array of strings or integers, but how does one create an array of dates :/
2009/11/26
[ "https://Stackoverflow.com/questions/1801044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218995/" ]
Did you mean inputting an array of dates.This code would help.. ``` import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Scanner; public class Datinput { public static void main(String args[]) { int n; ArrayList<St...
You can consider (and this is not reality, but it sort of works this way) that primitives are something like this (I do get to reality later on... so keep reading): int.7, int.42 (won't compile) where int is a class (it is not) and 7 and 42 are public static final variables (they are not). and that Strings are someth...
1,609,552
Whenever i try to suspend my laptop (Lenovo Y530 with hybrid graphics (Intel & NVIDIA 1050Ti)) i face this issue: ``` nvidia-modeset: ERROR: GPU:0: Display engine push buffer channel allocation failed: 0x65 (Call timed out [NV_ERR_TIMEOUT]) nvidia-modeset: ERROR: GPU:0: Failed to allocate display engine core DMA push ...
2020/12/13
[ "https://superuser.com/questions/1609552", "https://superuser.com", "https://superuser.com/users/1171783/" ]
Switching from `460` to `450` nvidia driver works for me on Ubuntu 20.10, GeForce GTX 1050 Mobile, Unity gui.
I used the [NVIDIA Driver Downloads page](https://www.nvidia.com/Download/index.aspx?lang=en-us) to search for Linux drivers for the NVIDIA 1050Ti. This gave me the [Linux x64 (AMD64/EM64T) Display Driver](https://www.nvidia.com/Download/driverResults.aspx/164073/en-us) for 64-bit computers. If installing this driver...
1,609,552
Whenever i try to suspend my laptop (Lenovo Y530 with hybrid graphics (Intel & NVIDIA 1050Ti)) i face this issue: ``` nvidia-modeset: ERROR: GPU:0: Display engine push buffer channel allocation failed: 0x65 (Call timed out [NV_ERR_TIMEOUT]) nvidia-modeset: ERROR: GPU:0: Failed to allocate display engine core DMA push ...
2020/12/13
[ "https://superuser.com/questions/1609552", "https://superuser.com", "https://superuser.com/users/1171783/" ]
Switching from `460` to `450` nvidia driver works for me on Ubuntu 20.10, GeForce GTX 1050 Mobile, Unity gui.
For anyone facing this issue. this issue is simply because there is a bug in NVIDIA drivers that prevents booting back from a hibernation. The solution is simple, force to shutdown or do not try to hibernate before you `prime-select intel`, if that does not work, i have never found a better solution other than `purge ...
30,679,653
During establishing the video call ice candidates gathereing is started after the call to createOffer or createAnswer. I'd like to get all local ice candidates for the local peer before I call createOffer or createAnswer. This way I'll have all of them set in sdp description and there will be no need to send them separ...
2015/06/06
[ "https://Stackoverflow.com/questions/30679653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1213617/" ]
Candidate gathering only starts when you call setLocalDescription. If you want an SDP with all the candidates, wait for the onicecandidate event without a candidate and inspect the peerconnection's localDescription.sdp which contains all candidates gathered so far.
According to <https://developer.mozilla.org/zh-CN/docs/Web/API/RTCPeerConnection/onicecandidate> When onicecandidate event in callback is null, issue that the peer connection has gather ice candidate complete. So at that time Create offer to other peer connection and the Offer's SDP info will contain 'a=candidate' at...
30,679,653
During establishing the video call ice candidates gathereing is started after the call to createOffer or createAnswer. I'd like to get all local ice candidates for the local peer before I call createOffer or createAnswer. This way I'll have all of them set in sdp description and there will be no need to send them separ...
2015/06/06
[ "https://Stackoverflow.com/questions/30679653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1213617/" ]
Candidate gathering only starts when you call setLocalDescription. If you want an SDP with all the candidates, wait for the onicecandidate event without a candidate and inspect the peerconnection's localDescription.sdp which contains all candidates gathered so far.
You can reduce the delay by setting icecandidatepoolsize - then the browser will try and pre-gather candidates before Offer/Answer. see: <https://github.com/pipe/two/blob/master/index.html#L181>
30,679,653
During establishing the video call ice candidates gathereing is started after the call to createOffer or createAnswer. I'd like to get all local ice candidates for the local peer before I call createOffer or createAnswer. This way I'll have all of them set in sdp description and there will be no need to send them separ...
2015/06/06
[ "https://Stackoverflow.com/questions/30679653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1213617/" ]
You can reduce the delay by setting icecandidatepoolsize - then the browser will try and pre-gather candidates before Offer/Answer. see: <https://github.com/pipe/two/blob/master/index.html#L181>
According to <https://developer.mozilla.org/zh-CN/docs/Web/API/RTCPeerConnection/onicecandidate> When onicecandidate event in callback is null, issue that the peer connection has gather ice candidate complete. So at that time Create offer to other peer connection and the Offer's SDP info will contain 'a=candidate' at...
58,817,175
I Created a spring boot web project (.war) to be deployed in an application server.I want to integrate keycloak sso with spring security.The redirection to keycloak login page is working fine. But after that it is throwing error in browser. Error which is getting thrown in browser > > There was an unexpected error (...
2019/11/12
[ "https://Stackoverflow.com/questions/58817175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5113989/" ]
> > exception [Current user principal is not of type [org.keycloak.KeycloakPrincipal] > > > you should use `KeycloakAuthenticationToken` instead of `KeycloakPrincipal`
Issue was like i used KeycloakPrincipal principal in contoller method
70,644,941
I'm making a Django Rest Framework application with a JWT authentication with tokens stored in HttpOnly cookies. Authentication is performed via reading the `access` cookie. I'm using a [`dj-rest-auth`](https://dj-rest-auth.readthedocs.io/en/latest/) library for this purpose, but I'm a little confused of the security a...
2022/01/09
[ "https://Stackoverflow.com/questions/70644941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14645104/" ]
You need to transform the ExecutionContext from Graphql to one Nestjs/Passport can read: <https://docs.nestjs.com/graphql/other-features#execution-context> ``` import { ExecutionContext, Injectable } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; import { AuthGuard } from '@nestjs/passpo...
You should look your Guard and strategy you are using and should handle errors from there for example: ``` @Injectable() export class PassportLocalGuard extends AuthGuard('local') { protected readonly logger = new Logger(PassportLocalGuard.name); canActivate(context: ExecutionContext) { const ctx = GqlExecutionContex...
70,644,941
I'm making a Django Rest Framework application with a JWT authentication with tokens stored in HttpOnly cookies. Authentication is performed via reading the `access` cookie. I'm using a [`dj-rest-auth`](https://dj-rest-auth.readthedocs.io/en/latest/) library for this purpose, but I'm a little confused of the security a...
2022/01/09
[ "https://Stackoverflow.com/questions/70644941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14645104/" ]
try adding this into "subscriptions" section of GraphQL module initialization: ``` 'subscriptions-transport-ws': { onConnect: (headersRaw: Record<string, unknown>) => { // Lowercase each header key const headers = Object.keys(headersRaw).reduce((dest, key) => { dest[key.toLowerCase()] =...
You should look your Guard and strategy you are using and should handle errors from there for example: ``` @Injectable() export class PassportLocalGuard extends AuthGuard('local') { protected readonly logger = new Logger(PassportLocalGuard.name); canActivate(context: ExecutionContext) { const ctx = GqlExecutionContex...
70,644,941
I'm making a Django Rest Framework application with a JWT authentication with tokens stored in HttpOnly cookies. Authentication is performed via reading the `access` cookie. I'm using a [`dj-rest-auth`](https://dj-rest-auth.readthedocs.io/en/latest/) library for this purpose, but I'm a little confused of the security a...
2022/01/09
[ "https://Stackoverflow.com/questions/70644941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14645104/" ]
You need to transform the ExecutionContext from Graphql to one Nestjs/Passport can read: <https://docs.nestjs.com/graphql/other-features#execution-context> ``` import { ExecutionContext, Injectable } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; import { AuthGuard } from '@nestjs/passpo...
try adding this into "subscriptions" section of GraphQL module initialization: ``` 'subscriptions-transport-ws': { onConnect: (headersRaw: Record<string, unknown>) => { // Lowercase each header key const headers = Object.keys(headersRaw).reduce((dest, key) => { dest[key.toLowerCase()] =...
191,892
Every 2 weeks or so it seems like someone or a group of users go around down-voting answers and questions senselessly on Stack Overflow's [go](/questions/tagged/go "show questions tagged 'go'"). Perfectly fine questions and answers in my opinion. I've noticed the pattern develop because I too tend to lose a lot of rep...
2013/08/04
[ "https://meta.stackexchange.com/questions/191892", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/168708/" ]
You're going to have to give us some answers or questions to go off of (ones that have received downvotes). From what I see, [only posts that should have been downvoted were downvoted](https://stackoverflow.com/questions/17522677/using-buffer-for-read-and-read-operations-examples-in-go/17524477#17524477), and there's n...
Maybe there is someone who is an expert on Go that only visits the site every two weeks or so. And when she visits the site, and reads the questions and answers that got posted since her last visit, she notices that they are unclear, not useful, or outright wrong. So she quite appropriately downvotes them. Would you b...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Paging should be used to break content into semantic or task-related groups of content, such as by your categories in your menu bar on the left. This allows users to find content by *what* it is (e.g., the page title in a menu) rather than *where* it is (e.g., page number or relative position in a scrolling page). Gene...
Without a doubt scrolling is way faster than finding and clicking a link. But just because it's faster doesn't mean you should make your pages super long. In other words, you shouldn't use infinite scrolling in every situation because if there's too much content users might not have the patience to scroll to the very e...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Although scrolling is the preferred way in many scenarios, in a wizard/tutorial or any other similar "do one thing, then do the next thing" situation, a next/"1,2,3..." button can be a better way, so that the user knows that he/she is leaving the previous step/question and a new one can be dealt with.
Let alone a trackpad with inertia scrolling! I really dislike those little next/previous page icons/links. When the content forms a whole, stick it in one page and scroll. Else, section it with a decent TOC or categories. On your site, the "All" requires 23 pages! If you stick this in a single scrolling page, you ma...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
In addition to the points mentioned in the accepted answer: Scrolling has more built-in affordances than a next-click: * dragging the scrollbar to scroll with life preview * clicking the scrollbar to jump page-wise * clicking the end buttons for small steps (ideally, per item) * mouse scroll wheel (or similar mechani...
Let alone a trackpad with inertia scrolling! I really dislike those little next/previous page icons/links. When the content forms a whole, stick it in one page and scroll. Else, section it with a decent TOC or categories. On your site, the "All" requires 23 pages! If you stick this in a single scrolling page, you ma...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Pagination is definitely slower than scrolling down a page. However, pagination has its advantages. It makes tracking results easier. If the type of list you have demands stricter order and counting, pagination can help.
Without a doubt scrolling is way faster than finding and clicking a link. But just because it's faster doesn't mean you should make your pages super long. In other words, you shouldn't use infinite scrolling in every situation because if there's too much content users might not have the patience to scroll to the very e...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Paging should be used to break content into semantic or task-related groups of content, such as by your categories in your menu bar on the left. This allows users to find content by *what* it is (e.g., the page title in a menu) rather than *where* it is (e.g., page number or relative position in a scrolling page). Gene...
In addition to the points mentioned in the accepted answer: Scrolling has more built-in affordances than a next-click: * dragging the scrollbar to scroll with life preview * clicking the scrollbar to jump page-wise * clicking the end buttons for small steps (ideally, per item) * mouse scroll wheel (or similar mechani...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Let alone a trackpad with inertia scrolling! I really dislike those little next/previous page icons/links. When the content forms a whole, stick it in one page and scroll. Else, section it with a decent TOC or categories. On your site, the "All" requires 23 pages! If you stick this in a single scrolling page, you ma...
Without a doubt scrolling is way faster than finding and clicking a link. But just because it's faster doesn't mean you should make your pages super long. In other words, you shouldn't use infinite scrolling in every situation because if there's too much content users might not have the patience to scroll to the very e...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
In addition to the points mentioned in the accepted answer: Scrolling has more built-in affordances than a next-click: * dragging the scrollbar to scroll with life preview * clicking the scrollbar to jump page-wise * clicking the end buttons for small steps (ideally, per item) * mouse scroll wheel (or similar mechani...
Pagination is definitely slower than scrolling down a page. However, pagination has its advantages. It makes tracking results easier. If the type of list you have demands stricter order and counting, pagination can help.
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Paging should be used to break content into semantic or task-related groups of content, such as by your categories in your menu bar on the left. This allows users to find content by *what* it is (e.g., the page title in a menu) rather than *where* it is (e.g., page number or relative position in a scrolling page). Gene...
If you are asking about speed, then scrolling is definitely faster than clicking through tens of pages, 9 items on each. The only drawback of scrolling long pages might be the user disorientation, once there are more than 50 items on a page. I think you could compare this with web interface of Twitter. Wouldn't it be ...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Although scrolling is the preferred way in many scenarios, in a wizard/tutorial or any other similar "do one thing, then do the next thing" situation, a next/"1,2,3..." button can be a better way, so that the user knows that he/she is leaving the previous step/question and a new one can be dealt with.
If you are asking about speed, then scrolling is definitely faster than clicking through tens of pages, 9 items on each. The only drawback of scrolling long pages might be the user disorientation, once there are more than 50 items on a page. I think you could compare this with web interface of Twitter. Wouldn't it be ...
1,850
Which is faster? Scrolling down or clicking a button to reveal more content? Currently, our site requires clicking of page numbers to reveal more content. We have 9 channels per page, which fits [on one screen in most common resolutions.](http://www.veetle.com/index.php/listing#1/popular/1) Personally, I believe havin...
2010/10/06
[ "https://ux.stackexchange.com/questions/1850", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1975/" ]
Although scrolling is the preferred way in many scenarios, in a wizard/tutorial or any other similar "do one thing, then do the next thing" situation, a next/"1,2,3..." button can be a better way, so that the user knows that he/she is leaving the previous step/question and a new one can be dealt with.
Without a doubt scrolling is way faster than finding and clicking a link. But just because it's faster doesn't mean you should make your pages super long. In other words, you shouldn't use infinite scrolling in every situation because if there's too much content users might not have the patience to scroll to the very e...
23,628,247
I have two object: UserDto and RoleDto. User has a property which is the RoleDto. In my viewmodel I have the following: ``` public UserDto User { get { return _user; } set { if (_user == value) return; _user = value; User.PropertyChanged += UserPropertyC...
2014/05/13
[ "https://Stackoverflow.com/questions/23628247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1857198/" ]
This is because the reference of `RoleDTO` that your `UserDTO` has, does not match any of the `RoleDTOs` in `Roles` collection which you set as `ItemsSource` of `ComboBox`. Better define a property on your ViewModel like ``` public RoleDTO SelectedRole { get { return Roles.FirstOrDefault(role => role....
The other way to solve this problem is using `Converter` on `Binding`. when you use binding to bind `SelectedItem`, WPF will check the reference of `SelectedItem` against all objects inside `ItemsSource` property and of course if there was no match, `SelectedItem` will be empty. using `Converter` you can tell WPF that ...
23,628,247
I have two object: UserDto and RoleDto. User has a property which is the RoleDto. In my viewmodel I have the following: ``` public UserDto User { get { return _user; } set { if (_user == value) return; _user = value; User.PropertyChanged += UserPropertyC...
2014/05/13
[ "https://Stackoverflow.com/questions/23628247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1857198/" ]
This is because the reference of `RoleDTO` that your `UserDTO` has, does not match any of the `RoleDTOs` in `Roles` collection which you set as `ItemsSource` of `ComboBox`. Better define a property on your ViewModel like ``` public RoleDTO SelectedRole { get { return Roles.FirstOrDefault(role => role....
In my opinion the second option on this page is the easiest way. <https://rachel53461.wordpress.com/2011/08/20/comboboxs-selecteditem-not-displaying/> You can override the equals property on your object so that it returns true if the items have the same data. Then when the combo box box goes to check to make sure you...
23,628,247
I have two object: UserDto and RoleDto. User has a property which is the RoleDto. In my viewmodel I have the following: ``` public UserDto User { get { return _user; } set { if (_user == value) return; _user = value; User.PropertyChanged += UserPropertyC...
2014/05/13
[ "https://Stackoverflow.com/questions/23628247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1857198/" ]
In my opinion the second option on this page is the easiest way. <https://rachel53461.wordpress.com/2011/08/20/comboboxs-selecteditem-not-displaying/> You can override the equals property on your object so that it returns true if the items have the same data. Then when the combo box box goes to check to make sure you...
The other way to solve this problem is using `Converter` on `Binding`. when you use binding to bind `SelectedItem`, WPF will check the reference of `SelectedItem` against all objects inside `ItemsSource` property and of course if there was no match, `SelectedItem` will be empty. using `Converter` you can tell WPF that ...
2,576,263
Can anyone explain why this query returns an empty result. ``` SELECT * FROM (`bookmarks`) JOIN `tags` ON `tags`.`bookmark_id` = `bookmarks`.`id` WHERE `tag` = 'clean' AND `tag` = 'simple' ``` In my bookmarks table, I have a bookmark with an `id` of 70 and in my tags table i have two tags 'clean' and 'simple' both t...
2010/04/04
[ "https://Stackoverflow.com/questions/2576263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
It's unlikely that there's a row whose tag equals both 'clean' and 'simple' :) So try replacing AND with OR: ``` WHERE `tag` = 'clean' OR `tag` = 'simple' ``` If you intend to retrieve only bookmarks with both tags, consider a double `exists` clause: ``` SELECT * FROM bookmarks b WHERE EXISTS ( SELECT * FR...
You get no rows because your where clause is impossible to satisfy. To get bookmarks that have both a tag 'clean' and a tag 'simple' you need to join with the tags table twice. Try doing it like this: ``` SELECT bookmarks.* FROM bookmarks JOIN tags AS T1 ON T1.bookmark_id = bookmarks.id AND T1.tag = 'clean' JOIN tags...
2,576,263
Can anyone explain why this query returns an empty result. ``` SELECT * FROM (`bookmarks`) JOIN `tags` ON `tags`.`bookmark_id` = `bookmarks`.`id` WHERE `tag` = 'clean' AND `tag` = 'simple' ``` In my bookmarks table, I have a bookmark with an `id` of 70 and in my tags table i have two tags 'clean' and 'simple' both t...
2010/04/04
[ "https://Stackoverflow.com/questions/2576263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
It's unlikely that there's a row whose tag equals both 'clean' and 'simple' :) So try replacing AND with OR: ``` WHERE `tag` = 'clean' OR `tag` = 'simple' ``` If you intend to retrieve only bookmarks with both tags, consider a double `exists` clause: ``` SELECT * FROM bookmarks b WHERE EXISTS ( SELECT * FR...
``` Select ... From `bookmarks` Where Exists( Select 1 From `tags` Where `tags`.`bookmark_id` = `bookmarks`.`id` And 'tag' In('clean','simple') Having Count(*) = 2 ) ``` (BTW, I'm assuming that a bookmark cannot have a given tag twice).
2,576,263
Can anyone explain why this query returns an empty result. ``` SELECT * FROM (`bookmarks`) JOIN `tags` ON `tags`.`bookmark_id` = `bookmarks`.`id` WHERE `tag` = 'clean' AND `tag` = 'simple' ``` In my bookmarks table, I have a bookmark with an `id` of 70 and in my tags table i have two tags 'clean' and 'simple' both t...
2010/04/04
[ "https://Stackoverflow.com/questions/2576263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
You get no rows because your where clause is impossible to satisfy. To get bookmarks that have both a tag 'clean' and a tag 'simple' you need to join with the tags table twice. Try doing it like this: ``` SELECT bookmarks.* FROM bookmarks JOIN tags AS T1 ON T1.bookmark_id = bookmarks.id AND T1.tag = 'clean' JOIN tags...
``` Select ... From `bookmarks` Where Exists( Select 1 From `tags` Where `tags`.`bookmark_id` = `bookmarks`.`id` And 'tag' In('clean','simple') Having Count(*) = 2 ) ``` (BTW, I'm assuming that a bookmark cannot have a given tag twice).
26,106,279
I have the vector ``` length # [1] 15,34, 12,24, 225, # Levels: 12,24, 15,34, 225, ``` and I want to separate them by the comma to eventually make a list of these values Tried: ``` strsplit(length, ",") ``` but keep getting the error message ``` Error in strsplit(length, ",") : non-character argument ```
2014/09/29
[ "https://Stackoverflow.com/questions/26106279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4091997/" ]
Your "length" object is a `factor`: As the error message indicates, `strsplit` expects a character vector as the input. Try: ``` strsplit(as.character(length), ",") ``` ### Demo ``` x <- factor(c("1,2", "3,4", "5,6")) strsplit(x, ",") # Error in strsplit(x, ",") : non-character argument strsplit(as.character(x),...
You could also use: (`x` from @Ananda Mahto's post) ``` library(stringr) str_split(x, ",") #[[1]] # [1] "1" "2" #[[2]] #[1] "3" "4" #[[3]] #[1] "5" "6" ``` Or ``` str_extract_all(x, "[0-9]+") ``` Or ``` library(stringi) stri_extract_all_regex(x, "[0-9]+") ```
22,818,567
My app is running an `NSURLSession` where it downloads a file. However, when the user locks the phone I cannot update the subviews on the screen. They are frozen. I have a method getting called when the phone locks via the app delegate; however, it will not update any subviews. I have tried placing the updates on main...
2014/04/02
[ "https://Stackoverflow.com/questions/22818567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2491694/" ]
Use this in loadView or viewDidLoad: ``` [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(becomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; -(void) becomeActive { NSLog(@"ACTIVE"); // } ```
You can update UI in `viewWillAppear:` life cycle view controller method: ``` - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // update UI } ``` [Also, read apple's doc](https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.h...
22,818,567
My app is running an `NSURLSession` where it downloads a file. However, when the user locks the phone I cannot update the subviews on the screen. They are frozen. I have a method getting called when the phone locks via the app delegate; however, it will not update any subviews. I have tried placing the updates on main...
2014/04/02
[ "https://Stackoverflow.com/questions/22818567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2491694/" ]
You can update UI in `viewWillAppear:` life cycle view controller method: ``` - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // update UI } ``` [Also, read apple's doc](https://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.h...
Once device is lock there is no certain methodology or no way to create the background process or continue download process. The only possible way can be used is we while during the downloading process if user lock the device & app goes into background downloaded content should be saved. So once when application is ag...
22,818,567
My app is running an `NSURLSession` where it downloads a file. However, when the user locks the phone I cannot update the subviews on the screen. They are frozen. I have a method getting called when the phone locks via the app delegate; however, it will not update any subviews. I have tried placing the updates on main...
2014/04/02
[ "https://Stackoverflow.com/questions/22818567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2491694/" ]
Use this in loadView or viewDidLoad: ``` [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(becomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; -(void) becomeActive { NSLog(@"ACTIVE"); // } ```
Once device is lock there is no certain methodology or no way to create the background process or continue download process. The only possible way can be used is we while during the downloading process if user lock the device & app goes into background downloaded content should be saved. So once when application is ag...
32,276,218
I am trying to get a variable from a drop down list. The drop down list is fully populated using a mysql query, and demonstrates the correct information I'd be expecting. I have found an example online (the bottom one) which does exactly what I want it to, but my example (the top one) is not. I presume this is somethin...
2015/08/28
[ "https://Stackoverflow.com/questions/32276218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274729/" ]
I think, it is this line: `$options.="<option value='$id'>" . $forename . ' ' . $surname . '</option>';` Where is `$id` coming from? Seems to be uninitialized. You could also have a look at the output HTML generated by your script to find the difference to the working example you found. Another thing: Your code wi...
The problem is because you have: ``` $_POST['$name']; ``` you should change it: ``` $_POST[$name]; ```
32,276,218
I am trying to get a variable from a drop down list. The drop down list is fully populated using a mysql query, and demonstrates the correct information I'd be expecting. I have found an example online (the bottom one) which does exactly what I want it to, but my example (the top one) is not. I presume this is somethin...
2015/08/28
[ "https://Stackoverflow.com/questions/32276218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5274729/" ]
I think, it is this line: `$options.="<option value='$id'>" . $forename . ' ' . $surname . '</option>';` Where is `$id` coming from? Seems to be uninitialized. You could also have a look at the output HTML generated by your script to find the difference to the working example you found. Another thing: Your code wi...
You are not declaring the variable right . $varaible =['value'] ; value is generally the dropdown value . for eg: var 1 so, when you echo $variable it will show the value var 1 . Use this and hope it solves the problem .
95,831
I am working on system which is intended for rather technical users - engineers, etc. The system consist of several windows, each provide the user with the option to configure (create/edit) some object in the system. Each object has many attributes, distributed to different panels according to some sub-object relevancy...
2016/06/19
[ "https://ux.stackexchange.com/questions/95831", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/2625/" ]
I would go with the rules of GUI standards and official W3C Web standards: > > 1. Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly one choice. In other words, clicking a non-selected radio button will deselect whatever other button was pre...
The checkbox group implies optionality rather than default states. That would not be the right method to use if you want to show the user what the default states are. The first group using radio buttons is a better use. In iOS settings pages, they use toggle switches to indicate if something is enabled or disabled. Tha...
95,831
I am working on system which is intended for rather technical users - engineers, etc. The system consist of several windows, each provide the user with the option to configure (create/edit) some object in the system. Each object has many attributes, distributed to different panels according to some sub-object relevancy...
2016/06/19
[ "https://ux.stackexchange.com/questions/95831", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/2625/" ]
I would go with the rules of GUI standards and official W3C Web standards: > > 1. Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly one choice. In other words, clicking a non-selected radio button will deselect whatever other button was pre...
To simplify and rephrase Samuel's answer: Use 1 checkbox if the choice is **one** out of **two** options. Or rather, a binary choice. Use radio buttons if the choice is **one** out of **X** options. Use X checkboxes if the choice is **Y** out of **X** options. This is actually not a single option with multiple selec...
95,831
I am working on system which is intended for rather technical users - engineers, etc. The system consist of several windows, each provide the user with the option to configure (create/edit) some object in the system. Each object has many attributes, distributed to different panels according to some sub-object relevancy...
2016/06/19
[ "https://ux.stackexchange.com/questions/95831", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/2625/" ]
I would go with the rules of GUI standards and official W3C Web standards: > > 1. Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly one choice. In other words, clicking a non-selected radio button will deselect whatever other button was pre...
The radio buttons add cognitive load to the user and clutter the interface without providing any additional clarity. You can increase clarity and reduce clutter further with this approach: ``` Enable: [] Administrative state [] Graceful restart [] Default route [] Multiple paths ```
95,831
I am working on system which is intended for rather technical users - engineers, etc. The system consist of several windows, each provide the user with the option to configure (create/edit) some object in the system. Each object has many attributes, distributed to different panels according to some sub-object relevancy...
2016/06/19
[ "https://ux.stackexchange.com/questions/95831", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/2625/" ]
The radio buttons add cognitive load to the user and clutter the interface without providing any additional clarity. You can increase clarity and reduce clutter further with this approach: ``` Enable: [] Administrative state [] Graceful restart [] Default route [] Multiple paths ```
The checkbox group implies optionality rather than default states. That would not be the right method to use if you want to show the user what the default states are. The first group using radio buttons is a better use. In iOS settings pages, they use toggle switches to indicate if something is enabled or disabled. Tha...
95,831
I am working on system which is intended for rather technical users - engineers, etc. The system consist of several windows, each provide the user with the option to configure (create/edit) some object in the system. Each object has many attributes, distributed to different panels according to some sub-object relevancy...
2016/06/19
[ "https://ux.stackexchange.com/questions/95831", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/2625/" ]
The radio buttons add cognitive load to the user and clutter the interface without providing any additional clarity. You can increase clarity and reduce clutter further with this approach: ``` Enable: [] Administrative state [] Graceful restart [] Default route [] Multiple paths ```
To simplify and rephrase Samuel's answer: Use 1 checkbox if the choice is **one** out of **two** options. Or rather, a binary choice. Use radio buttons if the choice is **one** out of **X** options. Use X checkboxes if the choice is **Y** out of **X** options. This is actually not a single option with multiple selec...
52,644,241
I am trying to download publication from ISSUU, directly as PDF. So for example take this URL: <https://issuu.com/vaistinecamelia/docs/camelia_2018_spalis_elvariantas_kre> Any ideas how I could access it? There is 3rd party services, that do it, like so: <http://issuu.pdf-downloader.com/>, so I presume it must be p...
2018/10/04
[ "https://Stackoverflow.com/questions/52644241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786480/" ]
So I did not find a way directly download PDF, but there is a way around it. So basically each publication has a twiter meta tag: ``` <meta name="twitter:image" content="https://image.isu.pub/180721061958-e8f19464b7540f48371102c2b71136b4/jpg/page_1.jpg"> ``` So you can access each and every page by looping through ...
Have tried and reviewed all GitHub Issuu downloaders and came to conclusion. That JPG page download is only possible. SWF page download is killed (disabled) by Issuu as Flash has died. PDF page download don't work, too. Only option to download Full PDF if somebody hack access keys generation (AWSAccessKeyId, Expires, S...
29,138,520
I have written cucumber test cases using java. The location of my .feature file is: ``` Z:\eclipse\myworkspace\ProjectName\src\test\resources\GoogleLogin\test\GoogleLogin.feature ``` And location of my Step Definition files is: ``` Z:\eclipse\myworkspace\ProjectName\src\test\java\GoogleLoginStepDef\test\StepDefinit...
2015/03/19
[ "https://Stackoverflow.com/questions/29138520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4688477/" ]
Try this: ``` java -cp "${LIB_DIR}/*" cucumber.api.cli.Main --glue ${GLUE_CODE} ${FEATURES_DIR} --format ```
Or try this one ``` alias cucumber='java -cp "${LIB_DIR}/*" cucumber.api.cli.Main --glue ${GLUE_CODE} ${FEATURES_DIR} --format' ``` the you can fire up ``` $ cucumber ```
29,138,520
I have written cucumber test cases using java. The location of my .feature file is: ``` Z:\eclipse\myworkspace\ProjectName\src\test\resources\GoogleLogin\test\GoogleLogin.feature ``` And location of my Step Definition files is: ``` Z:\eclipse\myworkspace\ProjectName\src\test\java\GoogleLoginStepDef\test\StepDefinit...
2015/03/19
[ "https://Stackoverflow.com/questions/29138520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4688477/" ]
Try this: ``` java -cp "${LIB_DIR}/*" cucumber.api.cli.Main --glue ${GLUE_CODE} ${FEATURES_DIR} --format ```
**You can also use below command :** ``` java -Xmx1024m -cp '*' org.junit.runner.JUnitCore 'com.xx.automation.cucumber.testSuites.RunFeature’ ``` This Your E.g: ``` java -Xmx1024m -cp '*' org.junit.runner.JUnitCore 'featureFilePath’ ```
40,113,428
I have a C# method that needs to retrieve the first character of a string, and see if it exists in a HashSet that contains specific unicode characters (all the right-to-left characters). So I'm doing ``` var c = str[0]; ``` and then checking the hashset. The problem is that this code doesn't work for strings where...
2016/10/18
[ "https://Stackoverflow.com/questions/40113428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884248/" ]
A `String` is a sequence of UTF-16 code units, one or two encode a Unicode codepoint. If you want to get a codepoint from a string, you have to iterate codepoints in the string. A "character" is also a base codepoint followed by a sequence of zero or more combining codepoints ("combining characters"). ``` // Use a Has...
I'm not sure I understand your question, a short chunk of code might be useful. When you have a line like 'var c = str[0]', assuming 'str' is a string, then c will be a char, which is encoded UTF16. Because of this c will never be greater than (2^16 - 1). Unicode characters can be larger than that but when that occurs ...
40,113,428
I have a C# method that needs to retrieve the first character of a string, and see if it exists in a HashSet that contains specific unicode characters (all the right-to-left characters). So I'm doing ``` var c = str[0]; ``` and then checking the hashset. The problem is that this code doesn't work for strings where...
2016/10/18
[ "https://Stackoverflow.com/questions/40113428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884248/" ]
A `String` is a sequence of UTF-16 code units, one or two encode a Unicode codepoint. If you want to get a codepoint from a string, you have to iterate codepoints in the string. A "character" is also a base codepoint followed by a sequence of zero or more combining codepoints ("combining characters"). ``` // Use a Has...
To anyone who sees this question in the future and is interested in the solution I ended up with - this is my method which decides if a string should be displayed RTL or LTR based on the first character in the string. It takes UTF-16 Surrogate Pairs into account. Thanks to Tom Blodget who pointed me in the right direc...
40,113,428
I have a C# method that needs to retrieve the first character of a string, and see if it exists in a HashSet that contains specific unicode characters (all the right-to-left characters). So I'm doing ``` var c = str[0]; ``` and then checking the hashset. The problem is that this code doesn't work for strings where...
2016/10/18
[ "https://Stackoverflow.com/questions/40113428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884248/" ]
To anyone who sees this question in the future and is interested in the solution I ended up with - this is my method which decides if a string should be displayed RTL or LTR based on the first character in the string. It takes UTF-16 Surrogate Pairs into account. Thanks to Tom Blodget who pointed me in the right direc...
I'm not sure I understand your question, a short chunk of code might be useful. When you have a line like 'var c = str[0]', assuming 'str' is a string, then c will be a char, which is encoded UTF16. Because of this c will never be greater than (2^16 - 1). Unicode characters can be larger than that but when that occurs ...
22,915,116
Need help! In java swing, how can I jump back(open up) the hidden form from which the previous form had been generated? Elaborating -> I made an object of form2 in form1, hid the 1st form and displayed the 2nd one. Now after a while I have to hide the form2 and open the original form1. How can I do that?
2014/04/07
[ "https://Stackoverflow.com/questions/22915116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3507164/" ]
You can use `form.setVisible(true) and form.setVisible(false)` In form1 you'll put this under the button ``` form2 f2 = new form2(this); ``` In form2 you'll do this ``` f1.setVisible(false); ``` then when you go back ``` f1.setVisible(true); this.dispose(); ```
Unless you have a really good reason to do something like this, then don't. Instead, use a `CardLayout` which will allow you to move back and forward and set the currently active view at your hearts content Check out [How to use CardLayout](http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html) and [The Use...
44,466,453
I am using the Sum() Over (Partition by ...Order by ..) function to calculate the running total of a column, but the problem arises whenever there is a repetition (or duplication) of the value. Sum() over seems to group them by the values and puts the sum of all the grouped by values as a moving sum. Which is not what ...
2017/06/09
[ "https://Stackoverflow.com/questions/44466453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6609928/" ]
By default analytic functions use a RANGE windowing directive (see below - the default is the first version). What you are looking for is a ROWS directive (see below), which is not the default so you must include it explicitly. The RANGE windowing clause (default) does exactly what you noticed: it treats all "tied" ro...
The question is about Oracle and my answer below is based on DB2 OLAP implementation -- which has different defaults. See @mathguy's answer for the correct Oracle syntax. If you want a running sum don't use partition by except in the ranges you want the running sum to "span", it will then be ordered by the the order b...
66,998
As the title says, I lost the original axle hub skewers (both front and back) while moving. I bought this bike secondhand over a year ago, and it's a 2015 Diamondback Century 2. Diamondback no longer hosts the product specifications and won't respond to my customer support request, for some reason. I can tell you the o...
2020/04/03
[ "https://bicycles.stackexchange.com/questions/66998", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/48594/" ]
Most V brakes can be disengaged by the process the manual says. Anther term for this part is the cable-hook link or the cradle and the noodle. Some most-basic V-brakes do not have this feature and may require releasing the cable-fixing bolt. The process is shown in this video Then you will have to properly setup the ...
There are two ways to assemble a new bike. 1. The right way 2. The way it's usually done To answer your question: > > The front brakes need to be widened to fit the wheel, it says to 'disengage the cable guide tube from it's yoke'. Not sure where or how and I don't want to force anything and break it. > > > It...
66,998
As the title says, I lost the original axle hub skewers (both front and back) while moving. I bought this bike secondhand over a year ago, and it's a 2015 Diamondback Century 2. Diamondback no longer hosts the product specifications and won't respond to my customer support request, for some reason. I can tell you the o...
2020/04/03
[ "https://bicycles.stackexchange.com/questions/66998", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/48594/" ]
Here's an annotated rotated version of your photo: [![enter image description here](https://i.stack.imgur.com/8bZCL.gif)](https://i.stack.imgur.com/8bZCL.gif) To get the wheel in: 1. Pull the RUBBER BOOT to the right, slide it along the INNER CABLE toward the PINCH BOLT 2. Squeeze the BRAKE ARMS together at the top....
There are two ways to assemble a new bike. 1. The right way 2. The way it's usually done To answer your question: > > The front brakes need to be widened to fit the wheel, it says to 'disengage the cable guide tube from it's yoke'. Not sure where or how and I don't want to force anything and break it. > > > It...
12,291,013
I'm relatively new to graphical user interfaces and I've created an interface that implements the functionality of a basic calculator. These methods include: add(), subtract(), multiply(), and divide(). I'm getting an error within my actionPerformed method that's saying "the method add(int, int) in the type Operate is ...
2012/09/05
[ "https://Stackoverflow.com/questions/12291013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/520720/" ]
You are missing ``` languageOptions.ImplicitInt = 0; ``` without this configuration any function not having explicit return type will be set to int return type and raise an error when desctructor return type is checked thus raising the error. With the above configuration the Sema phase will not raise the error as th...
Almost certainly, your original code (before you reduced it) was missing a semicolon. ``` class MyClass { ~MyClass() ; } // right here MyClass::~MyClass() { } int main() { return 0; } ``` This caused the class type definition to be treated as the return type for the function definition which followed.
64,674,916
So I'm learning react and making this game project which is basically catch a fish which randomly pops out from water splash. The problem I have is adding and removing score from incorrect fish. It seems my code just does not want to select correct fish and adds incorrect score. Could you guys help me out figure it out...
2020/11/04
[ "https://Stackoverflow.com/questions/64674916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14436821/" ]
When incrementing/decrementing or doing any state update that ***depends*** on the previous state then you should use a *functional state update*. This takes the state from the last state update and updates from that value. You can also further make your `addToScore` handler more DRY by combining the two `setState` an...
``` addToScore() { const selectedPicture = picture[Math.floor(Math.random() * picture.length)]; this.setState(prev => ({ ...prev, score: prev.score + (selectedPicture === "game__fish" ? - 2 : 1), selectedPicture:' game__fish2', fishHasBeenClicked: false, background: '75px' })); } ```
4,418,117
I am building an app in which I need to read education and work history of all people(if it is not hidden by privacy settings) in a facebook group(public group). People in the group need not necessarily be friends of the user logged in to my app. I know how to get the facebook IDs of all people who are part of the gr...
2010/12/11
[ "https://Stackoverflow.com/questions/4418117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153580/" ]
You can not do this because of privacy settings of the other users and the restrictions of facebook.
You need to request user\_education\_history and friends\_education\_history permitions before you read any education info. Look at [example](http://developers.facebook.com/docs/authentication/#requesting-extended-permissions) from Facebook.
4,418,117
I am building an app in which I need to read education and work history of all people(if it is not hidden by privacy settings) in a facebook group(public group). People in the group need not necessarily be friends of the user logged in to my app. I know how to get the facebook IDs of all people who are part of the gr...
2010/12/11
[ "https://Stackoverflow.com/questions/4418117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/153580/" ]
You can not do this because of privacy settings of the other users and the restrictions of facebook.
If this user not allow to read his info to others, You will not able to read his info anyway. If he shares own info to everyone, the permissions Lex wrote whould be anougth to get this info, dont matter logged he or not, friend or not. In case of application, when user add it on his page, he gives also the permission...
27,874,544
I am trying to learn NodeJS along with AngularJS. On the frontend, I can simply put `debugger` statement when I want to put a breakpoint and debug from the browser console. How can I put breakpoints from the server side? In other words, I am looking for a function like `pdb` in nodejs version. More specifically, I am ...
2015/01/10
[ "https://Stackoverflow.com/questions/27874544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1815412/" ]
<https://github.com/node-inspector/node-inspector> try this node-inspector, allow you to debug the nodejs just like debugging frontend codes in the chrome devtool
Give it a try for visionmedia [debug](https://github.com/visionmedia/debug) module. You may require to configure your node app on your server app.js/main.js/web.js which actually bootstrap your node server app. ``` var debug = require('debug')('YOUR-APP-NAME'); ```
429,100
long time user first time question asker. I am an avid online poker player,but for some reason cannot play my site of chioce within the browser with ubuntu. I can do it with my windows machine,but not my ubuntu. I have tried opera, firefox, chrome, chromium all to no avail,every time the login screen is missing/blan...
2014/03/04
[ "https://askubuntu.com/questions/429100", "https://askubuntu.com", "https://askubuntu.com/users/254478/" ]
I think you've missed to install java for the browser. you can install it by this link [here.](https://apps.ubuntu.com/cat/applications/icedtea6-plugin/) or installing it via the terminal by typing: ``` sudo apt-get install icedtea6-plugin ```
If the website requires Flash, run the following into a terminal to fix it for you : ``` sudo apt-get install ubuntu-restricted-extras ``` if it requires Java plugins; have a look to the following [How do I install Java?](https://askubuntu.com/questions/48468/how-do-i-install-java)) for a more comprehensive plugin ...
2,944,624
I would like to ask how i should add the minus sign front of a decimal value. i want the user to add e.g. 100 and behind the scenes to convert it in -100 thank you.
2010/05/31
[ "https://Stackoverflow.com/questions/2944624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321784/" ]
What's wrong with a = -a?
If it's a decimal, convert it to a decimal, and then multiple by literal `-1m`. Or what Pavel said.
2,944,624
I would like to ask how i should add the minus sign front of a decimal value. i want the user to add e.g. 100 and behind the scenes to convert it in -100 thank you.
2010/05/31
[ "https://Stackoverflow.com/questions/2944624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321784/" ]
What's wrong with a = -a?
Multiply by -1.
2,944,624
I would like to ask how i should add the minus sign front of a decimal value. i want the user to add e.g. 100 and behind the scenes to convert it in -100 thank you.
2010/05/31
[ "https://Stackoverflow.com/questions/2944624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321784/" ]
What's wrong with a = -a?
I'm not sure about whether I got your question right. Are you asking how to negate a number? ``` decimal negated = -1.0M * userInputValue; ``` Is that what you are asking for? Or are you asking for automatically formatting the number as if the user had entered a negative number? In that case you could do: ``` strin...
2,944,624
I would like to ask how i should add the minus sign front of a decimal value. i want the user to add e.g. 100 and behind the scenes to convert it in -100 thank you.
2010/05/31
[ "https://Stackoverflow.com/questions/2944624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321784/" ]
If it's a decimal, convert it to a decimal, and then multiple by literal `-1m`. Or what Pavel said.
Multiply by -1.
2,944,624
I would like to ask how i should add the minus sign front of a decimal value. i want the user to add e.g. 100 and behind the scenes to convert it in -100 thank you.
2010/05/31
[ "https://Stackoverflow.com/questions/2944624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321784/" ]
If it's a decimal, convert it to a decimal, and then multiple by literal `-1m`. Or what Pavel said.
I'm not sure about whether I got your question right. Are you asking how to negate a number? ``` decimal negated = -1.0M * userInputValue; ``` Is that what you are asking for? Or are you asking for automatically formatting the number as if the user had entered a negative number? In that case you could do: ``` strin...
69,936,383
I have a class, it can define some operations on a raw pointer. For example, the class is called Vector. ``` class Vector { public: explicit Vector(double *ptr_, int size_) :ptr(ptr_), size(size_) { } // some operation change data in ptr void notConstOperation() { ptr[0]=ptr[0]...
2021/11/11
[ "https://Stackoverflow.com/questions/69936383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10877953/" ]
> > Any suggestion is I looking forward > > > Inheritance. ``` class ConstVector { const double *ptr; protected: double *_ptr() { return const_cast<double *>(ptr); } void _set_ptr(double *new_ptr) { ptr = new_ptr; } friend Vector; }; class Vector : ConstVector { // so...
a `const double*` pointer is a pointer which preserve the value of the variable it is pointing to. The `class Vector` has (among its purposes) ways to change the value pointed to by this pointer. In short, the `const` qualifier is a kind of programmer's rule. The rule is : You can't change the value of the variable. T...
14,435,939
Hey I'm new in programming `Facebook` applications and I wanted to start with `Heroku` but I have big problems to start working with it. After I logged on in the console I am asked whether I want to create a `SSH public key`. When I'm entering yes I get the message that it's generating a public key to `C:/Users/Test/...
2013/01/21
[ "https://Stackoverflow.com/questions/14435939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here I have the same problem... The solution I found was: 1) Open your file "C:/Users/Test/.ssh/id\_rsa.pub" with any ext editor. 2) Copy the content, begininig with "ssh-rsa" until "==". 3) go to <https://dashboard.heroku.com/account> 4) copy this to "add new ssh key", press Add key.
I was getting the same error you may have not run the **ssh-keygen.exe** present in **..\Git\bin** then you must enter the address of your ssh key in your case it seems to be **C:/Users/Test/.ssh/id\_rsa** after that you should login .
20,393,764
I want to update a single row in a custom list view. I am not writing the complete code because it is too long. Just writing enough parts. My listview Displays Properly I also know how to update single row. Because of null pointer exception I am unable to proceed with my codes.. Please help!!! **ProductList.java** ...
2013/12/05
[ "https://Stackoverflow.com/questions/20393764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259948/" ]
You can't create an instance of `Activity/ListActivity` using `new operator` and access it. `new ProductList().updateList(context);` // This is wrong way to access Activity instance Instead you can update your ListView row in the Adapter class itself inside `getView()` method. OR You can pass the instance of `Act...
The reason for NullPointerException is: ListView listProduct; is initialized in onCreate method, and when you are calling updateList mehtod you are creating new instance of ProductList via new and hence its onCreate method is not called and listProduct is not initialized and remains as null. One way you can try is cr...
51,493,842
I've got the following data: ``` sdlist : ['id', 'gen', 'age', 'mar', 'loc', 'inc', 'iscr', 'escr'] [51, 'F', 46, 'M', 0, 15100, 531, 555] [52, 'M', 29, 'M', 2, 14200, 673, 633] [53, 'M', 25, 'S', 0, 22200, 742, 998] [54, 'M', 36, 'M', 2, 1000, 677, 646] [55, 'F', 99, 'S', 0, 10600, 608, 998] [56, 'F', 45, 'M', 2, 610...
2018/07/24
[ "https://Stackoverflow.com/questions/51493842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10058836/" ]
You can even do it without `pandas`: ``` data = [ [51, 'F', 46, 'M', 0, 15100, 531, 555], [52, 'M', 29, 'M', 2, 14200, 673, 633], [53, 'M', 25, 'S', 0, 22200, 742, 998], [54, 'M', 36, 'M', 2, 1000, 677, 646], [55, 'F', 99, 'S', 0, 10600, 608, 998], [56, 'F', 45, 'M', 2, 6100, 710, 743], [57...
You can use Pandas Dataframe here: ``` def _filter(df, param): df.sort_values([param], inplace=True) return df df = pd.read_csv('csv_inputfile.csv') df_filtered = _filter(df, 'age') print(df_filtered) id gen age mar loc inc iscr escr 9 60 M 22 S 0 6400 699 998 2 53 M 25 S ...
6,465,617
This question is a follow up to this question: [How to create a list from two values](https://stackoverflow.com/questions/6454278/how-to-create-a-list-from-two-values) Consider this code: ``` class MainClass() { string MainKey {get;set;} string MainName {get;set;} IEnumerable<SmallObject> MainList {get;set}...
2011/06/24
[ "https://Stackoverflow.com/questions/6465617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/703494/" ]
I think you are asking too much from Translate. If I understand you correctly, it is the first query (mainQuery) that is too slow, so I would look to replace it. I would create a simpler temporary class like ``` public class TmpClass { public string Field1 {get;set;} public string Field2 {get;set;} pub...
I would use the [AsEnumerable extension method](http://msdn.microsoft.com/en-us/library/bb335435%28v=VS.90%29.aspx) which basically converts the `IQueryable` to an `IEnumerable` which forces the enumerator to be processed. You could achieve the same thing by calling `ToArray()` or `ToList()` but `AsEnumerable()` magica...
4,893,656
I have a function like this: ``` function run(arg) { if (!window.alreadyRun) init(); window.alreadyRun = true; /* more code */ } ``` You get the idea, I'm trying to figure out if it's the first time a function is called. Is there a better way to do this? Without using globals? Something like this: ``` ...
2011/02/04
[ "https://Stackoverflow.com/questions/4893656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/465546/" ]
This will return a function, with a variable called `runCount` which will hold the number of times it was called. ``` var yourFunction = function() { var runCount = 0; return function() { console.log(runCount); runCount++; } } var a = yourFunction(); a(); // runCount: 0 a(); // runCou...
The power of closures. ``` var f = (function(run) { return function() { if (!run) init(),run=true; // do code }; }(false)); ``` You can even use `if (!run) init() && run = true` and get `init` to return `false` if you want it to be called again on the next function call. We have a self exec...