qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
13,141,361
I have scheduled a `AsyncTask` using a `Timer` by following code ``` public void toCallAsynchronous() { TimerTask doAsynchronousTask; final Handler handler = new Handler(); Timer timer = new Timer(); doAsynchronousTask = new TimerTask() { @Override public void run() { // T...
2012/10/30
[ "https://Stackoverflow.com/questions/13141361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506115/" ]
Following links can helps you, please have a look, Thanks. [Android: Can I chain Async task sequentially (starting one after the previous asynctask completes)](https://stackoverflow.com/questions/7494515/android-can-i-chain-async-task-sequentially-starting-one-after-the-previous-as) and [Android calling AsyncTask ri...
Try this way ``` public ArrayBlockingQueue<Runnable> threadList = new ArrayBlockingQueue<Runnable>( 2000, true); public ThreadPoolExecutor threadPool = new ThreadPoolExecutor(0, 2000, 1000, TimeUnit.MILLISECONDS, threadList); TimerTask t=new TimerTask() { @Override pub...
13,141,361
I have scheduled a `AsyncTask` using a `Timer` by following code ``` public void toCallAsynchronous() { TimerTask doAsynchronousTask; final Handler handler = new Handler(); Timer timer = new Timer(); doAsynchronousTask = new TimerTask() { @Override public void run() { // T...
2012/10/30
[ "https://Stackoverflow.com/questions/13141361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506115/" ]
Following links can helps you, please have a look, Thanks. [Android: Can I chain Async task sequentially (starting one after the previous asynctask completes)](https://stackoverflow.com/questions/7494515/android-can-i-chain-async-task-sequentially-starting-one-after-the-previous-as) and [Android calling AsyncTask ri...
The line `timer.schedule(doAsynchronousTask, 0,50000);//execute in every 50000 ms` is responsible for the repetitive task. As per the description of Timer class's schedule( TimerTaskObject, int start, int repete ) method , this will repeat a particular TimerTask for the defined time interval, i suggest you to change ...
24,774,811
I am trying to add a custom save button at the end of each row in handsontable. I am using handsontable package in laravel 4. The button shows up like this: ![enter image description here](https://i.stack.imgur.com/w5HDC.png) ``` <button>Save</button> ```
2014/07/16
[ "https://Stackoverflow.com/questions/24774811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2493051/" ]
Try using `htmlRenderer` Demo: <http://docs.handsontable.com/0.19.0/demo-custom-renderers.html> ``` var actionRenderer = function (instance, td, row, col, prop, value, cellProperties) { var $button = $('<button>'); $button.html(value) $(td).empty().append($button); //empty is needed because you are rendering to...
you can simply do this custom renderer. ``` columns: [ { data: 'basicFormat', renderer: 'text'}, { data: 'createdAt', renderer: 'text'}, { data: 'updatedAt', renderer: 'text'}, { data: 'action', renderer: 'html'}, ] ```
24,774,811
I am trying to add a custom save button at the end of each row in handsontable. I am using handsontable package in laravel 4. The button shows up like this: ![enter image description here](https://i.stack.imgur.com/w5HDC.png) ``` <button>Save</button> ```
2014/07/16
[ "https://Stackoverflow.com/questions/24774811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2493051/" ]
I found an answer to my own question.. I used "renderer" in handsontable to render the cell into HTML ``` columns: [ {data: "unique_no"}, {data: "title"}, {data: "subject"}, {data: "year"}, {data: "duration"}, ...
you can simply do this custom renderer. ``` columns: [ { data: 'basicFormat', renderer: 'text'}, { data: 'createdAt', renderer: 'text'}, { data: 'updatedAt', renderer: 'text'}, { data: 'action', renderer: 'html'}, ] ```
69,952,172
This function tries to retrieve the topic of the GitHub repository name using the GitHub API: <https://api.github.com/repos/flutter/flutter/topics> ``` public List<String> getTopics(SearchRepository searchRepository){ GitHubRequest request = new GitHubRequest(); List<String> topic_list = new ArrayList<...
2021/11/13
[ "https://Stackoverflow.com/questions/69952172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15661413/" ]
To make it look like the buttons text vanishes,you can make the text color as same as the background color via *cget* method. ```py import tkinter as tk def hide_text(): color = button['bg'] button.config(foreground=color, activeforeground=color) window = tk.Tk() button = tk.Button(text="Hello World!",comma...
You Can Simply Config And Set Text : ``` import tkinter as tk from tkinter import ttk win=tk.Tk() def hidetext(): button.config(text="") button=ttk.Button(win,text="FooBar",command=hidetext) button.pack() win.mainloop() ```
57,141
A PDF output is obtained by compiling the following code. ``` \documentclass{article} \usepackage{xcolor} \usepackage{listings} \lstset { language={[LaTeX]TeX}, numbers=left, numbersep=1em, numberstyle=\tiny, frame=single, framesep=\fboxsep, framerule=\fboxrule, rulecolor=\...
2012/05/24
[ "https://tex.stackexchange.com/questions/57141", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/19356/" ]
This solution is *very* similar to that contained in [How to make text copy in PDF previewers ignore lineno line numbers?](https://tex.stackexchange.com/questions/30783/5764) `\protect`ing the [`accsupp`](http://ctan.org/pkg/accsupp) is the only requirement, perhaps due to the nature in which [`listings`](http://ctan.o...
Due to problems that came to light in the first answer when loading also the `hyperref` package, a related question was asked ([How do I prevent conflicts between accsupp and hyperref?](https://tex.stackexchange.com/questions/57151/how-do-i-prevent-conflicts-between-accsupp-and-hyperref)). The following solution is bas...
57,141
A PDF output is obtained by compiling the following code. ``` \documentclass{article} \usepackage{xcolor} \usepackage{listings} \lstset { language={[LaTeX]TeX}, numbers=left, numbersep=1em, numberstyle=\tiny, frame=single, framesep=\fboxsep, framerule=\fboxrule, rulecolor=\...
2012/05/24
[ "https://tex.stackexchange.com/questions/57141", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/19356/" ]
This solution is *very* similar to that contained in [How to make text copy in PDF previewers ignore lineno line numbers?](https://tex.stackexchange.com/questions/30783/5764) `\protect`ing the [`accsupp`](http://ctan.org/pkg/accsupp) is the only requirement, perhaps due to the nature in which [`listings`](http://ctan.o...
This answer only deals with latex/dvips/ps2pdf. Package `accsupp` works well with `dvips`. The generated PostScript file contains the right pdfmark operators. However `ghostscript` (version 9.05) has not implemented these tags, from the source file `gdevpdfm.c`: > > > ``` > /* [ tag propdict /BDC pdfmark */ > stati...
57,141
A PDF output is obtained by compiling the following code. ``` \documentclass{article} \usepackage{xcolor} \usepackage{listings} \lstset { language={[LaTeX]TeX}, numbers=left, numbersep=1em, numberstyle=\tiny, frame=single, framesep=\fboxsep, framerule=\fboxrule, rulecolor=\...
2012/05/24
[ "https://tex.stackexchange.com/questions/57141", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/19356/" ]
Due to problems that came to light in the first answer when loading also the `hyperref` package, a related question was asked ([How do I prevent conflicts between accsupp and hyperref?](https://tex.stackexchange.com/questions/57151/how-do-i-prevent-conflicts-between-accsupp-and-hyperref)). The following solution is bas...
This answer only deals with latex/dvips/ps2pdf. Package `accsupp` works well with `dvips`. The generated PostScript file contains the right pdfmark operators. However `ghostscript` (version 9.05) has not implemented these tags, from the source file `gdevpdfm.c`: > > > ``` > /* [ tag propdict /BDC pdfmark */ > stati...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
> > how can I prove its value? > > > You can't because it doesn't have any in that context. If you're using it to solve problems once in a while that's one thing, but if you're 'spending too much time' on it, then that is clear heads up from your boss to cease and desist. Your boss isn't attempting to open a dial...
So there are two possibilities here - either your boss is over managing and just want to show you that it's he who is in charge here and you should obey or - or - he is not satisfied with the quality of your work. There's no other option in first case than to leave - never waste your time working for non-professional...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
As [joe-strazzere](https://workplace.stackexchange.com/users/7777/joe-strazzere) said in his comment here: > > @Walle - your manager is hinting that you are spending too much time > on non-work stuff. So far, the only response you have is that "it has > many useful facts". If you can't do better than that, you woul...
Looking up answers to work problems is one thing, but answering questions, commenting, etc. are really just a form of socializing which your employer has the right to say "do it on your own time". Sure, you're creating value *in general*, but if it's not directly related to your job, then it's not really justifiable.
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
> > how can I prove its value? > > > You can't because it doesn't have any in that context. If you're using it to solve problems once in a while that's one thing, but if you're 'spending too much time' on it, then that is clear heads up from your boss to cease and desist. Your boss isn't attempting to open a dial...
You can't assume that the benefits are self-explanatory. You need to do as @JoeStrazzere suggested in the comments and detail the specific things you have learned that are useful for your specific job. In particular, detail what work-related problems that you found solutions for on Stack Overflow. If you can show th...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
> > how can I prove its value? > > > You can't because it doesn't have any in that context. If you're using it to solve problems once in a while that's one thing, but if you're 'spending too much time' on it, then that is clear heads up from your boss to cease and desist. Your boss isn't attempting to open a dial...
You start using this gem: ``` try { //Do Something } catch (Exception ex) { if (DesignMode) { Process.Start("http://www.stackoverflow.com/search/q=" + System.Web.HttpUtility.UrlEncode(ex.Message)); } } ``` Seriously, though, if your manager can't see the value ...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
I think your problem is not so much about proving the value of stack exchange, but about justifying your productivity to your manager. There are two scenarios to consider here: 1. You are **under-performing** (i.e. you are not meeting deadlines or whatever output you are producing is of poor quality) then maybe you *...
Depending on your situation and the relationship you have with your boss, you might be able to document specific instances where you asked a question, got an answer, and therefor saved valuable company time. Couple that with specific instances of you answering a question that required you to become better at your job...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
If you are using Stack Exchange sites to find information that helps you complete work-related tasks, **document** the occasions when you solve a problem based on information that you get from an SE site. For example, if you are responsible for tasks that are tracked with some kind of bug tracking, ticketing, or versi...
So there are two possibilities here - either your boss is over managing and just want to show you that it's he who is in charge here and you should obey or - or - he is not satisfied with the quality of your work. There's no other option in first case than to leave - never waste your time working for non-professional...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
You start using this gem: ``` try { //Do Something } catch (Exception ex) { if (DesignMode) { Process.Start("http://www.stackoverflow.com/search/q=" + System.Web.HttpUtility.UrlEncode(ex.Message)); } } ``` Seriously, though, if your manager can't see the value ...
Depending on your situation and the relationship you have with your boss, you might be able to document specific instances where you asked a question, got an answer, and therefor saved valuable company time. Couple that with specific instances of you answering a question that required you to become better at your job...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
Looking up answers to work problems is one thing, but answering questions, commenting, etc. are really just a form of socializing which your employer has the right to say "do it on your own time". Sure, you're creating value *in general*, but if it's not directly related to your job, then it's not really justifiable.
1. **Don't log in.** The value added at work for *reading* StackExchange sites *far* outweighs the value in answering questions. 2. **Only visit "hard" SEs that you need to get your job done.** Workplace.SE, bless its heart, is not one of them. You may learn a lot from reading programmers/sofware engineering, workplac...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
1. **Don't log in.** The value added at work for *reading* StackExchange sites *far* outweighs the value in answering questions. 2. **Only visit "hard" SEs that you need to get your job done.** Workplace.SE, bless its heart, is not one of them. You may learn a lot from reading programmers/sofware engineering, workplac...
You can't assume that the benefits are self-explanatory. You need to do as @JoeStrazzere suggested in the comments and detail the specific things you have learned that are useful for your specific job. In particular, detail what work-related problems that you found solutions for on Stack Overflow. If you can show th...
78,981
I was recently speaking with my manager, who stated that while my work is satisfactory, they've been noticing I'm spending a lot of time of Stack Exchange. I find Stack Exchange to be very informative and helpful in my work. Particularly considering this Stack Exchange site has many users who spend a large portion of ...
2016/11/02
[ "https://workplace.stackexchange.com/questions/78981", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
> > how can I prove its value? > > > You can't because it doesn't have any in that context. If you're using it to solve problems once in a while that's one thing, but if you're 'spending too much time' on it, then that is clear heads up from your boss to cease and desist. Your boss isn't attempting to open a dial...
I think your problem is not so much about proving the value of stack exchange, but about justifying your productivity to your manager. There are two scenarios to consider here: 1. You are **under-performing** (i.e. you are not meeting deadlines or whatever output you are producing is of poor quality) then maybe you *...
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
Well, you're going to have to tell the Uri *somehow* that the last part is a directory rather than a file. Using a trailing slash seems to be the most obvious way to me. Bear in mind that for many Uris, the answer you've got is exactly right. For example, if your web browser is rendering ``` http://foo.com/bar/index....
add a slash end of your first uri, URI will ignore more than one slash (/) ``` var a = new Uri("file:///C:/Some/Dirs/"); ``` **EDIT:** ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file", UriKind.Relative); var c = new Uri(Path.Combine(a.ToString(), b.ToString())); MessageBox.Show(c.AbsoluteUr...
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
add a slash end of your first uri, URI will ignore more than one slash (/) ``` var a = new Uri("file:///C:/Some/Dirs/"); ``` **EDIT:** ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file", UriKind.Relative); var c = new Uri(Path.Combine(a.ToString(), b.ToString())); MessageBox.Show(c.AbsoluteUr...
Why not just inherit from Uri and use that, ie. do in constructor what you need to do to fix it up? Refactoring is cheap assuming this is internal to assembly or within reach..
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
You can try this extension method! Works always! ;-) ``` public static class StringExtension { public static string UriCombine(this string str, string param) { if (!str.EndsWith("/")) { str = str + "/"; } var uri = new Uri(str); ...
add a slash end of your first uri, URI will ignore more than one slash (/) ``` var a = new Uri("file:///C:/Some/Dirs/"); ``` **EDIT:** ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file", UriKind.Relative); var c = new Uri(Path.Combine(a.ToString(), b.ToString())); MessageBox.Show(c.AbsoluteUr...
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
This should do the trick for you: ``` var baseUri = new Uri("http://www.briankeating.net"); var absoluteUri = new Uri(baseUri, "/api/GetDefinitions"); ``` This [constructor](https://msdn.microsoft.com/en-us/library/vstudio/9hst1w91(v=vs.100).aspx) follow the standard relative URI rules so the `/` are important : * ...
add a slash end of your first uri, URI will ignore more than one slash (/) ``` var a = new Uri("file:///C:/Some/Dirs/"); ``` **EDIT:** ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file", UriKind.Relative); var c = new Uri(Path.Combine(a.ToString(), b.ToString())); MessageBox.Show(c.AbsoluteUr...
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
Well, you're going to have to tell the Uri *somehow* that the last part is a directory rather than a file. Using a trailing slash seems to be the most obvious way to me. Bear in mind that for many Uris, the answer you've got is exactly right. For example, if your web browser is rendering ``` http://foo.com/bar/index....
Why not just inherit from Uri and use that, ie. do in constructor what you need to do to fix it up? Refactoring is cheap assuming this is internal to assembly or within reach..
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
Well, you're going to have to tell the Uri *somehow* that the last part is a directory rather than a file. Using a trailing slash seems to be the most obvious way to me. Bear in mind that for many Uris, the answer you've got is exactly right. For example, if your web browser is rendering ``` http://foo.com/bar/index....
You can try this extension method! Works always! ;-) ``` public static class StringExtension { public static string UriCombine(this string str, string param) { if (!str.EndsWith("/")) { str = str + "/"; } var uri = new Uri(str); ...
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
You can try this extension method! Works always! ;-) ``` public static class StringExtension { public static string UriCombine(this string str, string param) { if (!str.EndsWith("/")) { str = str + "/"; } var uri = new Uri(str); ...
Why not just inherit from Uri and use that, ie. do in constructor what you need to do to fix it up? Refactoring is cheap assuming this is internal to assembly or within reach..
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
This should do the trick for you: ``` var baseUri = new Uri("http://www.briankeating.net"); var absoluteUri = new Uri(baseUri, "/api/GetDefinitions"); ``` This [constructor](https://msdn.microsoft.com/en-us/library/vstudio/9hst1w91(v=vs.100).aspx) follow the standard relative URI rules so the `/` are important : * ...
Why not just inherit from Uri and use that, ie. do in constructor what you need to do to fix it up? Refactoring is cheap assuming this is internal to assembly or within reach..
885,373
I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path) ``` var a = new Uri("file:///C:/Some/Dirs"); var b = new Uri("some.file"); ``` when I try and combine them like this: ``` var c = new Uri(a,b); ``` I get > > `file:///C:/Some/some.file` > > > w...
2009/05/19
[ "https://Stackoverflow.com/questions/885373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343/" ]
This should do the trick for you: ``` var baseUri = new Uri("http://www.briankeating.net"); var absoluteUri = new Uri(baseUri, "/api/GetDefinitions"); ``` This [constructor](https://msdn.microsoft.com/en-us/library/vstudio/9hst1w91(v=vs.100).aspx) follow the standard relative URI rules so the `/` are important : * ...
You can try this extension method! Works always! ;-) ``` public static class StringExtension { public static string UriCombine(this string str, string param) { if (!str.EndsWith("/")) { str = str + "/"; } var uri = new Uri(str); ...
18,902,484
I've been reading the term *view* a few times when using [Guava](https://github.com/google/guava) collections and reading its documentation. I've looked for an explanation of what a view is in this context and whether it's a term used outside of Guava. It's quite often used [here](https://github.com/google/guava/wiki/...
2013/09/19
[ "https://Stackoverflow.com/questions/18902484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775954/" ]
A *view* of another object doesn't contain its own data at all. All of its operations are implemented in terms of operations on the other object. For example, the `keySet()` view of a `Map` might have an implementation that looks something like this: ``` class KeySet implements Set<K> { private final Map<K, V> map;...
A *view* in this context is a collection backed by another collection (or array) that itself uses a constant amount memory (i.e. the memory does not depend on the size of the backing collection). Operations applied to the view are delegated to the backing collection (or array). Of course it's possible to expand this de...
37,278,410
I have the code : ``` function insertChamado($id, $area = 2) { if ($area != 2 && $area != 4) $area = 2; ``` How Can I adjust this code to not accept 0 condition as show in the log bellow : ``` [12-May-2016 16:58:28 America/Sao_Paulo] id = 36445, area = 0 [12-May-2016 16:59:00 America/Sao_Paulo] id = ...
2016/05/17
[ "https://Stackoverflow.com/questions/37278410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6346097/" ]
Just add a conditional to check for it... Not sure what is hard about it unless we are missing something. ``` function insertChamado($id, $area = 2) { if ($area == 0) die("Ruh-Rohh"); if ($area != 2 && $area != 4) $area = 2; } ``` Or if you expect it to be 2 if it is 0: ``` func...
After reading carefully your question i think that your best solution is a simple `switch`. ``` function insertChamado($id, $area = 2){ switch ($area) { case 2: echo "area equals 2\n"; break; case 4: echo "area equals 4\n"; break; default: ...
34,443,686
I am attaching my fiddle. When you look at it, at the top right corner you will see "Account" and "Logout". Instead of the "Logout" text, I want there to be an "off" image that you will find in the CSS portion. How do i do that? `URL:`<https://jsfiddle.net/mikoo1991/pk6baz1z/1/embedded/result/>
2015/12/23
[ "https://Stackoverflow.com/questions/34443686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5104323/" ]
The other answers here address your issue which was that you forgot to add the id in your html. However, I'd like to point out that adding a background image like this is not the best way to accomplish the desired results. Honestly, you'd be better off using icons like [FontAwesome](https://fortawesome.github.io/Font-...
It looks as if you were trying to embed a container inside a list item. The list item only allows inline elements to be embedded i.e. span, a. If you use logout-btn as the ID in the a tag, you will see the image show up (additional styling will be required). ``` <ul> <li><a href="#">Account</a></li> <li><a id="l...
34,443,686
I am attaching my fiddle. When you look at it, at the top right corner you will see "Account" and "Logout". Instead of the "Logout" text, I want there to be an "off" image that you will find in the CSS portion. How do i do that? `URL:`<https://jsfiddle.net/mikoo1991/pk6baz1z/1/embedded/result/>
2015/12/23
[ "https://Stackoverflow.com/questions/34443686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5104323/" ]
The other answers here address your issue which was that you forgot to add the id in your html. However, I'd like to point out that adding a background image like this is not the best way to accomplish the desired results. Honestly, you'd be better off using icons like [FontAwesome](https://fortawesome.github.io/Font-...
``` <li><a id="logout-btn" href="#"> .... </a></li> ``` I just added the id do to your link tag and added `....` characters in the html list item to add width to the image background.then turned the opactiy to zero,removed float right, and a few other styles applied, see below. ``` #logout-btn { border: 0px solid bl...
41,731,714
I've been working in a c# project and what I'm trying to accomplish is counting the visible rows of a filtered range in C#. First, I create a range that I'm going to filter. ``` Range usedRange = sheet.Range[sheet.Cells[7, 1], sheet.UsedRange.SpecialCells(XlCellType.xlCellTypeLastCell)]; ``` Then, I apply 2 filters...
2017/01/19
[ "https://Stackoverflow.com/questions/41731714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2822091/" ]
Not ideal but this will be somewhat better: ``` foreach (Range area in argFiltered.Areas) { count += area.Rows.Count; } ```
Can you afford to put a formula in some unused cell that counts the rows? If you use the [Subtotal](https://exceljet.net/formula/count-visible-rows-in-a-filtered-list) function with code 3 it won't count the rows hidden by a filter. Put a formula in a cell and read its value, e.g. ``` sheet.Cells[1, 255].Formula = "=s...
268,306
I'm using [Ubuntu 12.10](http://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_12.10_.28Quantal_Quetzal.29) (Quantal Quetzal) and [Zend Server](https://en.wikipedia.org/wiki/Zend_Server) CE 5.6. For some reason I want to try [XAMPP](http://en.wikipedia.org/wiki/XAMPP), but Zend Server CE automatically start every...
2013/03/15
[ "https://askubuntu.com/questions/268306", "https://askubuntu.com", "https://askubuntu.com/users/94978/" ]
Zend Server CE installs a run script in `/etc/init.d/zend-server` (which is in fact a symlink to `/usr/local/zend/bin/zendctl.sh`). The easiest way how to stop Zend Server CE from starting is to remove the symlink, e.g.: ``` rm /etc/init.d/zend-server ``` That way the original file will be kept on your system, but i...
This is happening because the OS is starting the default HTTP service when it boots. Zend Server has a dependency on the Linux [httpd](https://en.wikipedia.org/wiki/Httpd) service when it installs. So you'll have to configure httpd to not start automatically and start it manually when you want.
268,306
I'm using [Ubuntu 12.10](http://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Ubuntu_12.10_.28Quantal_Quetzal.29) (Quantal Quetzal) and [Zend Server](https://en.wikipedia.org/wiki/Zend_Server) CE 5.6. For some reason I want to try [XAMPP](http://en.wikipedia.org/wiki/XAMPP), but Zend Server CE automatically start every...
2013/03/15
[ "https://askubuntu.com/questions/268306", "https://askubuntu.com", "https://askubuntu.com/users/94978/" ]
Zend Server CE installs a run script in `/etc/init.d/zend-server` (which is in fact a symlink to `/usr/local/zend/bin/zendctl.sh`). The easiest way how to stop Zend Server CE from starting is to remove the symlink, e.g.: ``` rm /etc/init.d/zend-server ``` That way the original file will be kept on your system, but i...
You can do it with `bum`. Type `sudo apt-get install bum`, then launch it with `sudo bum`.
21,702,579
Im trying to add a full-text index to a table in my migrations, but I cant get it working. the code I've tried dosen't error and even works when run in my SQL manager, but does not create an index when I call migrate command. The commands below are the file thats last in the list to be run. Ive tried the following, c...
2014/02/11
[ "https://Stackoverflow.com/questions/21702579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505999/" ]
Seems I was using the wrong quotes, this now works: ``` DB::statement("CREATE INDEX question_fulltext_idx ON questions USING gin(to_tsvector('english', question))"); ```
I don't know about the `CREATE INDEX ..` query itself. But you're not actually running the query agains the database. This "creates" a raw query: ``` DB::raw('CREATE INDEX question_fulltext_idx ON questions USING gin(to_tsvector("english", question))'); ``` The newly created raw query would then be used inside anot...
103,891
[![enter image description here](https://i.stack.imgur.com/dEumy.jpg)](https://i.stack.imgur.com/dEumy.jpg)I came across a 7-5 suspension for the first time today- as seen in the image. This is the first time I have come across a suspension which has a change of bass (that isn't an octave leap or fall) at the note of r...
2020/08/14
[ "https://music.stackexchange.com/questions/103891", "https://music.stackexchange.com", "https://music.stackexchange.com/users/71424/" ]
Yes. A favorite progression of mine is... [![enter image description here](https://i.stack.imgur.com/kfXAR.png)](https://i.stack.imgur.com/kfXAR.png) All seventh chords. The upper voices are held over the root changes, but relative to the roots the upper voices change from thirds of the chords to sevenths, the sevent...
**Can the harmony change at the resolution of a suspension?** Yes. **Is it the case that when coming across suspensions like a 7-5 and 4-6, you take their first number as a cue that they will operate in the same way as their more conventional counterparts: 7-6 and 4-3, in terms of the bass note/inversion?** No. For ...
43,394,757
I have a MEAN Stack application deployed on a server and am using Nginx as proxy server to handle the request and redirect to application's particular port. For example: User accesses the URL `http://www.abcxyz.com/` and Nginx hits the actual application URL `http://www.abcxyz.com:1234/`, as my application is running ...
2017/04/13
[ "https://Stackoverflow.com/questions/43394757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2080607/" ]
If you're using express: > > Setting a non-false trust proxy value results in three important > changes: > > > The value of req.hostname is derived from the value set in the > X-Forwarded-Host header, which can be set by the client or by the > proxy. > > > X-Forwarded-Proto can be set by the reverse proxy to t...
> > I would like to say thank you to `@Marcos Casagrande` for his answer. > Although i had to work around for additional 3hours after his answer but will > accept his lead as an answer to my question. > > > Here's the Nginx Conf which works for me, placed at the path `/etc/nginx/conf.d/abcxyz.com.conf`. ``` ser...
62,133,521
I'm working on an ASP.NET project, and i want to create and use my own authorization and authentication system to manage users (in a sql server database) like login, check authorization, and check authentication, i know in ASP.NET we have `Identity` but I want to create my own system. so my question is do anyone have ...
2020/06/01
[ "https://Stackoverflow.com/questions/62133521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13491458/" ]
You can start from simple things, creating a model of **User** with ordinary fields **Login**, **Password**, and **AuthController** that will have two methods **RegisterUser** and **SignIn**. **RegisterUser** - here you have to check if Login already exists, if not - insert data to table **Users**. Important thing - y...
You could fork from Identity Server 4 and create your own implementation. They have a good base to build a solution from and has integration with many app types using OpenID and OAuth. <https://identityserver4.readthedocs.io/en/latest/>
37,553,792
I'm using [CsvHelper](https://joshclose.github.io/CsvHelper/). To perform mapping between my object and a CSV file I'm using `CsvClassMap`. The class I map to itself contains other classes. Currently, to perform the mapping to the inner classes I use `ConvertUsing` on a `CsvPropertyMap`. An example below. `Car` is my m...
2016/05/31
[ "https://Stackoverflow.com/questions/37553792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3330348/" ]
What you want is called referred to as a `Reference` map in `CSVHelper`. ``` ... CarMap() { Map(m => m.Id).Name("CarId"); Map(m => m.Color).Name("CarColor"); Map(m => m.YearOfProduction).Name("YearOfProduction"); References<EngineMap>(m => m.Engine); // or if you tuck it away in the Engine class:...
this kind of mapping is more natural on json format, with [Json.net](http://www.newtonsoft.com) you can use `JsonConvert.SerializeObject(Object)` to convert your objects in json format and use `JsonConvert.DeserializeObject<T>(String);` to back from Json to your object. here one example: ``` Product product = new Pro...
21,304,282
I'm writing a script that takes an output file from another platform (that sadly doesn't produce CSV output, instead it's around 7 lines per record), grabbing the lines that have the values I'm interested in (using `select-string`) and then scanning the `MatchInfo` array, extracting the exact text and building an array...
2014/01/23
[ "https://Stackoverflow.com/questions/21304282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868534/" ]
In such cases when progress is called too often I use this approach ``` # fast even with Write-Progress $sw = [System.Diagnostics.Stopwatch]::StartNew() for($e = 0; $e -lt 1mb; ++$e) { if ($sw.Elapsed.TotalMilliseconds -ge 500) { Write-Progress -Activity Test -Status "Done $e" $sw.Reset(); $sw.Star...
I hope this helps someone else. I spent a day on a similar problem: Progress bar was very very slow. My problem however was rooted in the fact that I had made the screenbuffer for the powershell console extremely wide (9999 instead of the default 120). This caused Write-Progress to be slowed to the extreme every time...
21,304,282
I'm writing a script that takes an output file from another platform (that sadly doesn't produce CSV output, instead it's around 7 lines per record), grabbing the lines that have the values I'm interested in (using `select-string`) and then scanning the `MatchInfo` array, extracting the exact text and building an array...
2014/01/23
[ "https://Stackoverflow.com/questions/21304282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868534/" ]
In such cases when progress is called too often I use this approach ``` # fast even with Write-Progress $sw = [System.Diagnostics.Stopwatch]::StartNew() for($e = 0; $e -lt 1mb; ++$e) { if ($sw.Elapsed.TotalMilliseconds -ge 500) { Write-Progress -Activity Test -Status "Done $e" $sw.Reset(); $sw.Star...
I completely removed my old answer for sake of efficiency, Although modulus checks are efficient enough, they do take time, especially if doing a modulus 20 against say 5 million - this adds a decent amount of overhead. For loops, all I do is something simple as follows ---which is similar to the stop watch method, i...
21,304,282
I'm writing a script that takes an output file from another platform (that sadly doesn't produce CSV output, instead it's around 7 lines per record), grabbing the lines that have the values I'm interested in (using `select-string`) and then scanning the `MatchInfo` array, extracting the exact text and building an array...
2014/01/23
[ "https://Stackoverflow.com/questions/21304282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868534/" ]
In such cases when progress is called too often I use this approach ``` # fast even with Write-Progress $sw = [System.Diagnostics.Stopwatch]::StartNew() for($e = 0; $e -lt 1mb; ++$e) { if ($sw.Elapsed.TotalMilliseconds -ge 500) { Write-Progress -Activity Test -Status "Done $e" $sw.Reset(); $sw.Star...
I wanted to use write-progress to monitor the piping of get-child-item to file. The solution was to start a new job and then monitor the output of the job for change from another process. Powershell makes this quite easy. ``` # start the job to write the file index to the cache $job = start-job { param($path) ...
21,304,282
I'm writing a script that takes an output file from another platform (that sadly doesn't produce CSV output, instead it's around 7 lines per record), grabbing the lines that have the values I'm interested in (using `select-string`) and then scanning the `MatchInfo` array, extracting the exact text and building an array...
2014/01/23
[ "https://Stackoverflow.com/questions/21304282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868534/" ]
I hope this helps someone else. I spent a day on a similar problem: Progress bar was very very slow. My problem however was rooted in the fact that I had made the screenbuffer for the powershell console extremely wide (9999 instead of the default 120). This caused Write-Progress to be slowed to the extreme every time...
I completely removed my old answer for sake of efficiency, Although modulus checks are efficient enough, they do take time, especially if doing a modulus 20 against say 5 million - this adds a decent amount of overhead. For loops, all I do is something simple as follows ---which is similar to the stop watch method, i...
21,304,282
I'm writing a script that takes an output file from another platform (that sadly doesn't produce CSV output, instead it's around 7 lines per record), grabbing the lines that have the values I'm interested in (using `select-string`) and then scanning the `MatchInfo` array, extracting the exact text and building an array...
2014/01/23
[ "https://Stackoverflow.com/questions/21304282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1868534/" ]
I hope this helps someone else. I spent a day on a similar problem: Progress bar was very very slow. My problem however was rooted in the fact that I had made the screenbuffer for the powershell console extremely wide (9999 instead of the default 120). This caused Write-Progress to be slowed to the extreme every time...
I wanted to use write-progress to monitor the piping of get-child-item to file. The solution was to start a new job and then monitor the output of the job for change from another process. Powershell makes this quite easy. ``` # start the job to write the file index to the cache $job = start-job { param($path) ...
23,622,481
I am trying to overload the constructor to a class so that it can accept lists of two different types of objects: ``` class myClass(){ var someStrings: List[String]=List[String]() println("hello!") def this(strings : List[String])={ this() this.someStrings=strings } def this(ints: List[Int])={ ...
2014/05/13
[ "https://Stackoverflow.com/questions/23622481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1230032/" ]
create functions on a companion object which do the construction for you in a typesafe way that can be checked at compile time: ``` class myClass(){ var someStrings: List[String]=List[String]() println("hello!") } object myClass { def fromStrings(strings: List[String]) = { val c = new myClass c.someStri...
In addition to the other answer, another thing you can do is use Arrays. The type information on an array is kept at runtime, so you can do overloading based on the type parameter. ``` class myClass() { var someStrings: Array[String] = Array[String]() println("hello!") def this(strings: Array[String]) = { t...
23,622,481
I am trying to overload the constructor to a class so that it can accept lists of two different types of objects: ``` class myClass(){ var someStrings: List[String]=List[String]() println("hello!") def this(strings : List[String])={ this() this.someStrings=strings } def this(ints: List[Int])={ ...
2014/05/13
[ "https://Stackoverflow.com/questions/23622481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1230032/" ]
create functions on a companion object which do the construction for you in a typesafe way that can be checked at compile time: ``` class myClass(){ var someStrings: List[String]=List[String]() println("hello!") } object myClass { def fromStrings(strings: List[String]) = { val c = new myClass c.someStri...
That's what `DummyImplicit` is for: ``` def this(strings: List[String])={ this() this.someStrings=strings } def this(ints: List[Int])(implicit d: DummyImplicit)={ this() this.someStrings=ints.map(x => x.toString) } ``` This makes the erased signatures of constructors (i.e. the ones JVM sees) `MyClass(List)`...
23,622,481
I am trying to overload the constructor to a class so that it can accept lists of two different types of objects: ``` class myClass(){ var someStrings: List[String]=List[String]() println("hello!") def this(strings : List[String])={ this() this.someStrings=strings } def this(ints: List[Int])={ ...
2014/05/13
[ "https://Stackoverflow.com/questions/23622481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1230032/" ]
That's what `DummyImplicit` is for: ``` def this(strings: List[String])={ this() this.someStrings=strings } def this(ints: List[Int])(implicit d: DummyImplicit)={ this() this.someStrings=ints.map(x => x.toString) } ``` This makes the erased signatures of constructors (i.e. the ones JVM sees) `MyClass(List)`...
In addition to the other answer, another thing you can do is use Arrays. The type information on an array is kept at runtime, so you can do overloading based on the type parameter. ``` class myClass() { var someStrings: Array[String] = Array[String]() println("hello!") def this(strings: Array[String]) = { t...
41,083,683
Given a two dimensional array in Ruby: ``` [ [1, 1, 1], [1, 1], [1, 1, 1, 1], [1, 1] ] ``` I'd like to create a Hash, where the keys are the counts of each internal array, and the values are arrays of indices of the original array whose internal array sizes have the particular count. The resulting Hash would b...
2016/12/11
[ "https://Stackoverflow.com/questions/41083683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129622/" ]
There are two problems with your code. The first is that when `h` is empty and you write, say, `h[2] << 1`, since `h` does not have a key `2`, `h[2]` returns the default, so this expression becomes `[] << 1 #=> [1]`, but `[1]` is not attached to the hash, so no key and value are added. You need to write `h[2] = h[2] <...
``` arry = [ [1, 1, 1], [1, 1], [1, 1, 1, 1], [1, 1] ] h = {} arry.each_with_index do |el,i| c = el.count h.has_key?(c) ? h[c] << i : h[c] = [i] end p h ``` This will give you ``` {3=>[0], 2=>[1, 3], 4=>[2]} ```
10,985,522
\*\*EDIT\**\** ok so i found the problam, it was that the min word length for the search was 4, i changed it to 3 but now it only finds the row 1 data and not row 2 data aswell... **-----original question:----** I have a MyISAM table on my phpmyadmin like this: ``` table name: `users` coulmn name: `name` row 1 data...
2012/06/11
[ "https://Stackoverflow.com/questions/10985522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361042/" ]
`MATCH` only works on columns with `FULLTEXT` indicing. And `FULLTEXT` indicing only works on MyISAM tables. Secondly, 'dan' is probably [too short](http://dev.mysql.com/doc/refman//5.5/en/fulltext-fine-tuning.html) to use on a `MATCH`. Thirdly, if your search term matches more than 50% of your rows, the term is con...
Try this. SELECT \* FROM users WHERE MATCH (name) AGAINST ('dan'); I guess you are using apostrophes for tablename and in MATCH. This is wrong. Try it and let me know if this works.
10,985,522
\*\*EDIT\**\** ok so i found the problam, it was that the min word length for the search was 4, i changed it to 3 but now it only finds the row 1 data and not row 2 data aswell... **-----original question:----** I have a MyISAM table on my phpmyadmin like this: ``` table name: `users` coulmn name: `name` row 1 data...
2012/06/11
[ "https://Stackoverflow.com/questions/10985522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361042/" ]
`MATCH` only works on columns with `FULLTEXT` indicing. And `FULLTEXT` indicing only works on MyISAM tables. Secondly, 'dan' is probably [too short](http://dev.mysql.com/doc/refman//5.5/en/fulltext-fine-tuning.html) to use on a `MATCH`. Thirdly, if your search term matches more than 50% of your rows, the term is con...
I guess you are trying to return all with 'dan' in them You could try the LIKE command. ``` SELECT * FROM users WHERE name LIKE '%dan%' ``` That will return 'dan' and 'dan252' and (if he was in the table) '123dan456'. You could also try ``` SELECT * FROM users Match(name) AGAINST('+dan*') ``` That should return...
138,563
We have a Linux server (2.6.28-11-generic #42-Ubuntu) that's misbehaving on a client site, gobbling up an entirely unacceptable percentage of the client's bandwidth, and we're trying to figure out what the heck it's doing. And the guy who had the sysadmin skillset has yet to be replaced. We're at a loss for what could...
2010/05/04
[ "https://serverfault.com/questions/138563", "https://serverfault.com", "https://serverfault.com/users/42224/" ]
If its moving alot of data quickly, i'd see if there's any heavy log activity in /var/log/\*, namely httpd/ and maybe FTP. Otherwise check /var/log/security and /var/log/messages, those will contain a large portion of your system logs. Warner recommended some good tools that i would suggest turning on and monitoring t...
If you have already isolated the server without a doubt.. [iptraf](http://iptraf.seul.org/) is useful for bandwidth measurement on a local server. [ntop](http://www.ntop.org/) can be useful to breakdown on a higher level. If you install and start to running now, it can analyze past traffic. Ultimately, [tcpdump](htt...
54,678,519
Sorry, I am completely new to all of this... I am trying to create a music library for my own music. I have all of the song data in "songs" and I can load multiple tracks with audio, image, description name etc. What I can't work out is how to get a button to load for each track which will open a link from each of the...
2019/02/13
[ "https://Stackoverflow.com/questions/54678519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11058545/" ]
```js function formatDate(date) { var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var dayofweek=[ "Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"]; var day...
This solution uses `Intl.DateTimeFormat()` so that we can utilize the `FormatToParts()` function then apply a custom `map()` then finally `reduce()` to get the desired output. Within the `map()` function we replace the value of the `literal` after the day value to remove the comma (there by default). *References at M...
25,851,106
this is my code: <http://jsfiddle.net/Loaz7gcu/> I have three inputs which should fit on one line, equaling 100% but instead one sits on the next line. I have cleared all the margins and padding but still no luck. What am I doing wrong here? My example CSS: ``` * { margin: 0; padding: 0 } .one { width: 3...
2014/09/15
[ "https://Stackoverflow.com/questions/25851106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729481/" ]
You could do it by using `box-sizing: border-box;` and `display:inline-block;` to `input` and use `font-size:0px;` to `div` for remove the white-space and then set `font-size: 16px;` to input. **JSFiddle - [DEMO](http://jsfiddle.net/Loaz7gcu/11/)** **HTML:** ``` <div style="width: 100%; font-size:0px;"> <input c...
you need to add this ``` input{ box-sizing:border-box; } ``` because you have 100% + the border left and right for each element...so that's 100% + 6px; border-box will make the border to be inside the div not outside of it and also because of the whitespace between the elements you have to get dirty with the in...
25,851,106
this is my code: <http://jsfiddle.net/Loaz7gcu/> I have three inputs which should fit on one line, equaling 100% but instead one sits on the next line. I have cleared all the margins and padding but still no luck. What am I doing wrong here? My example CSS: ``` * { margin: 0; padding: 0 } .one { width: 3...
2014/09/15
[ "https://Stackoverflow.com/questions/25851106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729481/" ]
There are two things you should take care about: 1. In inline flow, there's a [whitespace between inline level elements.](https://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements) 2. UAs apply a border to input elements by default which causes the total width exceeds `100%` of ...
you need to add this ``` input{ box-sizing:border-box; } ``` because you have 100% + the border left and right for each element...so that's 100% + 6px; border-box will make the border to be inside the div not outside of it and also because of the whitespace between the elements you have to get dirty with the in...
25,851,106
this is my code: <http://jsfiddle.net/Loaz7gcu/> I have three inputs which should fit on one line, equaling 100% but instead one sits on the next line. I have cleared all the margins and padding but still no luck. What am I doing wrong here? My example CSS: ``` * { margin: 0; padding: 0 } .one { width: 3...
2014/09/15
[ "https://Stackoverflow.com/questions/25851106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729481/" ]
Another solution is to use `display: flex` in your `div` container: **html** **css** ``` * { margin: 0; padding: 0 } .one { width: 30%; margin-right: 10% } .two { width: 30%; margin-right: 10% } .three { width: 20% } div { width: 100%; display: flex; } ``` [**fiddle**](http://js...
you need to add this ``` input{ box-sizing:border-box; } ``` because you have 100% + the border left and right for each element...so that's 100% + 6px; border-box will make the border to be inside the div not outside of it and also because of the whitespace between the elements you have to get dirty with the in...
25,851,106
this is my code: <http://jsfiddle.net/Loaz7gcu/> I have three inputs which should fit on one line, equaling 100% but instead one sits on the next line. I have cleared all the margins and padding but still no luck. What am I doing wrong here? My example CSS: ``` * { margin: 0; padding: 0 } .one { width: 3...
2014/09/15
[ "https://Stackoverflow.com/questions/25851106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729481/" ]
You could do it by using `box-sizing: border-box;` and `display:inline-block;` to `input` and use `font-size:0px;` to `div` for remove the white-space and then set `font-size: 16px;` to input. **JSFiddle - [DEMO](http://jsfiddle.net/Loaz7gcu/11/)** **HTML:** ``` <div style="width: 100%; font-size:0px;"> <input c...
There are two things you should take care about: 1. In inline flow, there's a [whitespace between inline level elements.](https://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements) 2. UAs apply a border to input elements by default which causes the total width exceeds `100%` of ...
25,851,106
this is my code: <http://jsfiddle.net/Loaz7gcu/> I have three inputs which should fit on one line, equaling 100% but instead one sits on the next line. I have cleared all the margins and padding but still no luck. What am I doing wrong here? My example CSS: ``` * { margin: 0; padding: 0 } .one { width: 3...
2014/09/15
[ "https://Stackoverflow.com/questions/25851106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2729481/" ]
You could do it by using `box-sizing: border-box;` and `display:inline-block;` to `input` and use `font-size:0px;` to `div` for remove the white-space and then set `font-size: 16px;` to input. **JSFiddle - [DEMO](http://jsfiddle.net/Loaz7gcu/11/)** **HTML:** ``` <div style="width: 100%; font-size:0px;"> <input c...
Another solution is to use `display: flex` in your `div` container: **html** **css** ``` * { margin: 0; padding: 0 } .one { width: 30%; margin-right: 10% } .two { width: 30%; margin-right: 10% } .three { width: 20% } div { width: 100%; display: flex; } ``` [**fiddle**](http://js...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
There is a simple way to check whether a variable is declared as `T` or `T?`: ``` private static bool IsNullable<T>(T val) { return false; } private static bool IsNullable<T>(T? val) where T : struct { return true; } ``` Usage: ``` bool? val = false; if (IsNullable(val)) { ... } ``` **EDIT** ...
Try this ``` List<string> values = typeof(InstViewModel).GetProperties() .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) }) .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level") .Where(val => (val.V != null && val.T.IsA...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
Code for getting class instance values: ``` // create class instance InstViewModel model = new InstViewModel() { Uk = true, UkNrs = false, }; // check all boolean fields are false or null bool isAllNullOrFalse = (from property in typeof(InstViewModel).GetProperties() let type = proper...
Try this ``` List<string> values = typeof(InstViewModel).GetProperties() .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) }) .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level") .Where(val => (val.V != null && val.T.IsA...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
You can distinguish the boolean and nullable boolean properties before you evaluate them. Then there is no need to worry about whether they evaluate to a `bool` or a `Nullable<bool>`: ``` var nullableBooleanProperties = typeof(InstViewModel).Where(prop => prop.PropertyType == typeof(bool?)); ``` Then you can simply ...
Try this ``` List<string> values = typeof(InstViewModel).GetProperties() .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) }) .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level") .Where(val => (val.V != null && val.T.IsA...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
Code for getting class instance values: ``` // create class instance InstViewModel model = new InstViewModel() { Uk = true, UkNrs = false, }; // check all boolean fields are false or null bool isAllNullOrFalse = (from property in typeof(InstViewModel).GetProperties() let type = proper...
**This is a response to the initial question - ignore this.** When you "box" a nullable value (so you put it in an `object`), it is transformed in its underlying type (`bool` in your case) or in `null`... So if you have ``` bool? value = true; object value2 = value; ``` now `value2.GetType() == typeof(bool)`
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
**This is a response to the initial question - ignore this.** When you "box" a nullable value (so you put it in an `object`), it is transformed in its underlying type (`bool` in your case) or in `null`... So if you have ``` bool? value = true; object value2 = value; ``` now `value2.GetType() == typeof(bool)`
Try this ``` List<string> values = typeof(InstViewModel).GetProperties() .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) }) .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level") .Where(val => (val.V != null && val.T.IsA...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
There is a simple way to check whether a variable is declared as `T` or `T?`: ``` private static bool IsNullable<T>(T val) { return false; } private static bool IsNullable<T>(T? val) where T : struct { return true; } ``` Usage: ``` bool? val = false; if (IsNullable(val)) { ... } ``` **EDIT** ...
Code for getting class instance values: ``` // create class instance InstViewModel model = new InstViewModel() { Uk = true, UkNrs = false, }; // check all boolean fields are false or null bool isAllNullOrFalse = (from property in typeof(InstViewModel).GetProperties() let type = proper...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
According to your question > > Basically, I am interest*ed* in finding out if a simple bool variable is true OR if a Nullable variable is not null. > > > * to tell if a simple boolVariable is true ``` if(boolVariable){ //bool variable, not nullable } ``` * to tell if your nullableVariable is not null `...
Try this ``` List<string> values = typeof(InstViewModel).GetProperties() .Select(prop => new { N = prop.Name, T = prop.PropertyType, V = prop.GetValue(ivm, null) }) .Where(prop => prop.N != "SubCollection" && prop.N != "ID" && prop.N != "Name" && prop.N != "Level") .Where(val => (val.V != null && val.T.IsA...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
You can distinguish the boolean and nullable boolean properties before you evaluate them. Then there is no need to worry about whether they evaluate to a `bool` or a `Nullable<bool>`: ``` var nullableBooleanProperties = typeof(InstViewModel).Where(prop => prop.PropertyType == typeof(bool?)); ``` Then you can simply ...
Try this: ``` ((bool?)val).HasValue ``` This will return `true`, if `val` is a `bool` **or** if `val` is a `bool?` which value is not `null`. On the other hand, ``` !((bool?)val).HasValue ``` will only return `true` if val is `bool?` **and** its value is `null`. Will not that test suffice in your case?
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
Code for getting class instance values: ``` // create class instance InstViewModel model = new InstViewModel() { Uk = true, UkNrs = false, }; // check all boolean fields are false or null bool isAllNullOrFalse = (from property in typeof(InstViewModel).GetProperties() let type = proper...
According to your question > > Basically, I am interest*ed* in finding out if a simple bool variable is true OR if a Nullable variable is not null. > > > * to tell if a simple boolVariable is true ``` if(boolVariable){ //bool variable, not nullable } ``` * to tell if your nullableVariable is not null `...
30,641,364
I am trying to get the `id` of an `input field` which has a dynamic id but I get an error unrecognized expression. Below is my code : ``` $("#amount_paid' + data[i].patient_visit_statement_id + '").keyup(function() { var amount_owed = $('#amount_owed' + data[i].patient_visit_statement_id + '').val(); ...
2015/06/04
[ "https://Stackoverflow.com/questions/30641364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689017/" ]
There is a simple way to check whether a variable is declared as `T` or `T?`: ``` private static bool IsNullable<T>(T val) { return false; } private static bool IsNullable<T>(T? val) where T : struct { return true; } ``` Usage: ``` bool? val = false; if (IsNullable(val)) { ... } ``` **EDIT** ...
Try this: ``` ((bool?)val).HasValue ``` This will return `true`, if `val` is a `bool` **or** if `val` is a `bool?` which value is not `null`. On the other hand, ``` !((bool?)val).HasValue ``` will only return `true` if val is `bool?` **and** its value is `null`. Will not that test suffice in your case?
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
I am using the Migration Assistant on the old hard drive to migrate the data from a Time Machine backup to the new disk. It won't work for every situation (need USB enclosure, etc) - but it looks like it will work for me.
Some SSDs makers will sell it as an upgrade kit. It includes the SSD and SATA to USB adapter. You'll need to purchase the USB adapter. Plug it in and let carbon copy cloner do the rest.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
I would try to open the enclosure of your external USB drive and replace it with the SSD to clone your data. Simple hard drive cloning using Carbon Copy Cloner -------------------------------------------------- 1. Format the target drive with `Disk Utiliy.app` to **Mac OS Extendend (Journaled)** using the option **Er...
Some SSDs makers will sell it as an upgrade kit. It includes the SSD and SATA to USB adapter. You'll need to purchase the USB adapter. Plug it in and let carbon copy cloner do the rest.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
So you can keep using your old 500GB HDD I would buy a cheap enclosure for it. They can be had with USB 2.0 for as little as $10. Concerning the Software-Side, neither SuperDuper nor Carbon Copy Cloner are bad. Personally I, however, prefer Apple's own Disk Utility. Simply boot from your Install DVD or Restore Partit...
I am using the Migration Assistant on the old hard drive to migrate the data from a Time Machine backup to the new disk. It won't work for every situation (need USB enclosure, etc) - but it looks like it will work for me.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
Use [Carbon Copy Cloner (CCC)](http://www.bombich.com/), I have used it in the past, it's great and free! There is support on the website and tutorial videos.
I had an issue going from a large drive to a smaller SSD, even after deleting files. I found out it was because of the Lion MobileBackup volume. I turned off this feature and let it clear the files, then restarted, then I was able to make the move.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
SuperDuper <http://www.shirt-pocket.com/SuperDuper> is also an awesome back-up product and can easily clone a drive making a bootable backup. You can use it for free for what you're trying to do, but it's worth every penny for the extra features.
Use [Carbon Copy Cloner (CCC)](http://www.bombich.com/), I have used it in the past, it's great and free! There is support on the website and tutorial videos.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
SuperDuper <http://www.shirt-pocket.com/SuperDuper> is also an awesome back-up product and can easily clone a drive making a bootable backup. You can use it for free for what you're trying to do, but it's worth every penny for the extra features.
Some SSDs makers will sell it as an upgrade kit. It includes the SSD and SATA to USB adapter. You'll need to purchase the USB adapter. Plug it in and let carbon copy cloner do the rest.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
Use [Carbon Copy Cloner (CCC)](http://www.bombich.com/), I have used it in the past, it's great and free! There is support on the website and tutorial videos.
Some SSDs makers will sell it as an upgrade kit. It includes the SSD and SATA to USB adapter. You'll need to purchase the USB adapter. Plug it in and let carbon copy cloner do the rest.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
So you can keep using your old 500GB HDD I would buy a cheap enclosure for it. They can be had with USB 2.0 for as little as $10. Concerning the Software-Side, neither SuperDuper nor Carbon Copy Cloner are bad. Personally I, however, prefer Apple's own Disk Utility. Simply boot from your Install DVD or Restore Partit...
SuperDuper <http://www.shirt-pocket.com/SuperDuper> is also an awesome back-up product and can easily clone a drive making a bootable backup. You can use it for free for what you're trying to do, but it's worth every penny for the extra features.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
So you can keep using your old 500GB HDD I would buy a cheap enclosure for it. They can be had with USB 2.0 for as little as $10. Concerning the Software-Side, neither SuperDuper nor Carbon Copy Cloner are bad. Personally I, however, prefer Apple's own Disk Utility. Simply boot from your Install DVD or Restore Partit...
I had an issue going from a large drive to a smaller SSD, even after deleting files. I found out it was because of the Lion MobileBackup volume. I turned off this feature and let it clear the files, then restarted, then I was able to make the move.
36,184
I bought a 240 GB SSD to replace the 500 GB primary HDD in my new MacBook Pro. How do I clone the current Lion system image on my 500 GB HDD to the SSD? I want to clone the entire drive not just copy data. I can only have either the HDD or SSD in the MacBook Pro at a time. I have an external 500 GB USB drive that can...
2012/01/11
[ "https://apple.stackexchange.com/questions/36184", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5762/" ]
I am using the Migration Assistant on the old hard drive to migrate the data from a Time Machine backup to the new disk. It won't work for every situation (need USB enclosure, etc) - but it looks like it will work for me.
Ditch your optical drive and use a "data doubler" to keep your HDD in your MBP along with your SSD. I do this and keep all my heavy use files (OS, Xcode, ~/Library, Applications, etc.) on the SSD and then things like Movies, Music, and Pictures folders on the HDD. This way I can still buy a relatively small and inexpen...
2,234,138
Show that integration of $$\int\_{-\infty}^{+\infty}\left|\dfrac{\sin x}{x}\right|\mathrm dx$$ is equal to infinity. Is the limit $$\lim\_{x\to\infty}\frac{\sin x}{x} =1$$ useful here?
2017/04/14
[ "https://math.stackexchange.com/questions/2234138", "https://math.stackexchange.com", "https://math.stackexchange.com/users/392091/" ]
To show that the integral $\int\_{-\infty}^\infty \left|\frac{\sin(x)}{x}\right|\,dx$ diverges, we proceed as follows. $$\begin{align} \int\_{-N\pi}^{N\pi}\left|\frac{\sin(x)}{x}\right|\,dx&=2\sum\_{n=1}^N\int\_{(n-1)\pi}^{n\pi}\left|\frac{\sin(x)}{x}\right|\,dx\\\\ &\ge 2\sum\_{n=+1}^N \frac{1}{n\pi}\int\_{(n-1)\pi}^...
Let $$\mathcal{A}=\left\{ x\in\mathbb{R}\_{>0}:|\sin x| \ge \frac{1}{2} \right\} \subset \bigcup\_{n\in\mathbb{N}}\left[ \pi n+ \frac{\pi }{6} , \pi n+ \frac{5 \pi }{6}\right]$$ then $$\int\_{\mathbb{R}}\left| \frac{\sin x}{x} \right| \text{d}x \ge \int\_{\mathbb{R}\_{>0}}\left| \frac{\sin x}{x} \right| \text{d}x \ge \...
31,727,062
*I am trying to find this element by partial class, the **HTML** code is as following :* ``` <a class="follow-button profile" href="https://twitter.com/123" role="button" data-scribe="component:followbutton" title="Follow 123 on Twitter"><i class="ic-button-bird"></i>Follow</a> ``` *The method I used is as followi...
2015/07/30
[ "https://Stackoverflow.com/questions/31727062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5154146/" ]
`NoSuchElement` exception generally has one of the following causes: 1. Your element is inside a `<frame>` or `<iframe>`. Examine your HTML for those. * If this is the case, you can use `SwitchTo().Frame()` * `Frame()` accepts 3 arguments + An `IWebElement` - `IWebElement frameElement = driver.FindElement(By.T...
There are multiple classes in the element that you are trying to locate. The correct way to use `xpath` in that case is as follows: ``` var element = Driver.FindElement(By.XPath("//a[contains(@class, 'follow-button ') and contains(@class, 'profile')]")); ``` You could also use `css` ``` var element = Driver.FindEle...
31,727,062
*I am trying to find this element by partial class, the **HTML** code is as following :* ``` <a class="follow-button profile" href="https://twitter.com/123" role="button" data-scribe="component:followbutton" title="Follow 123 on Twitter"><i class="ic-button-bird"></i>Follow</a> ``` *The method I used is as followi...
2015/07/30
[ "https://Stackoverflow.com/questions/31727062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5154146/" ]
`NoSuchElement` exception generally has one of the following causes: 1. Your element is inside a `<frame>` or `<iframe>`. Examine your HTML for those. * If this is the case, you can use `SwitchTo().Frame()` * `Frame()` accepts 3 arguments + An `IWebElement` - `IWebElement frameElement = driver.FindElement(By.T...
Might be class value is changing in your case at run time. You can try manually and check this.
9,887,798
I have written a JUnit test for a private function which is returning String. And it is working fine. ``` public void test2() throws Exception { MyHandler handler = new MyHandler(); Method privateStringMethod = MyHandler.class.getDeclaredMethod("getName", String.class); privateStringMethod.setAccessible(tr...
2012/03/27
[ "https://Stackoverflow.com/questions/9887798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/907687/" ]
I'm completely against testing private methods in isolation. Unit testing should be done against the public interface of the class (and hence inadvertently testing the private methods) as this is how it will be treated in a production environment. I suppose there are small cases where you want to test private methods...
The returnvalue will be 'autoboxed' to an Boolean object. Since a primitive can't be null, you mustn't test against null. Even .booleanValue() mustn't be called, because of Autoboxing. But I'm of the same opinion as @alex.p, regarding testing private methods. ``` public class Snippet { @Test public void test...
645,816
I have installed Crouton on my chromebook, with the standard unity desktop(Ubuntu 12.02). However, I wish to use the Gnome 3 desktop environment. I cannot however install gnome-shell, since it requires me to change the DE from the login screen. Since I log in from the shell of chrome os, this isn't possible. If I hav...
2015/07/08
[ "https://askubuntu.com/questions/645816", "https://askubuntu.com", "https://askubuntu.com/users/414067/" ]
As you can see the package in your package manager, you should run the command below: ``` sudo apt-get remove master-pdf-editor ```
``` sudo apt-get purge master-pdf-editor3 ```
645,816
I have installed Crouton on my chromebook, with the standard unity desktop(Ubuntu 12.02). However, I wish to use the Gnome 3 desktop environment. I cannot however install gnome-shell, since it requires me to change the DE from the login screen. Since I log in from the shell of chrome os, this isn't possible. If I hav...
2015/07/08
[ "https://askubuntu.com/questions/645816", "https://askubuntu.com", "https://askubuntu.com/users/414067/" ]
As you can see the package in your package manager, you should run the command below: ``` sudo apt-get remove master-pdf-editor ```
First search for the application name then remove it after: ``` apt-cache search master-pdf sudo apt-get remove -purge master-pdf-editor ``` [![master-pdf-terminal-remove](https://i.stack.imgur.com/4LOVu.png)](https://i.stack.imgur.com/4LOVu.png)
31,596,453
i've been given a task to improve the below query because it's kinda slow. ``` SELECT 9 AS FieldCount, A.AccountName AS Field1, U.FullName AS Field2, A.City AS Field3, A.State AS Field4, A.Zip5 AS Field5, COUNT(DISTiNCT C.Contact_ID) AS Field6, COUNT(DISTiNCT L.Lead_ID) AS Field7, A.Account_ID AS Field8, A.CreateDateT...
2015/07/23
[ "https://Stackoverflow.com/questions/31596453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294118/" ]
This should work: ``` SELECT t1.category, t2.name, t2.phone FROM table2 AS t2 JOIN table1 AS t1 ON t1.id = t2.category ```
You can make an INNER JOIN and get the category from the Table 1, like this: ``` SELECT tb1.category, tb2.name, tb2.phone FROM table2 tb2 INNER JOIN table1 tb1 on tb2.category = tb1.id WHERE tb2.id = 1; ``` Hope it helps!
31,596,453
i've been given a task to improve the below query because it's kinda slow. ``` SELECT 9 AS FieldCount, A.AccountName AS Field1, U.FullName AS Field2, A.City AS Field3, A.State AS Field4, A.Zip5 AS Field5, COUNT(DISTiNCT C.Contact_ID) AS Field6, COUNT(DISTiNCT L.Lead_ID) AS Field7, A.Account_ID AS Field8, A.CreateDateT...
2015/07/23
[ "https://Stackoverflow.com/questions/31596453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294118/" ]
What you need is a `JOIN`, which means you "combine" two tables by linking rows from one table to rows from another table based on some criterion. In your case, the criterion is that the value of `CATEGORY` in `table2` must equal the value of `ID` in `table1`, which is expressed as follows: ``` SELECT table1.category...
This should work: ``` SELECT t1.category, t2.name, t2.phone FROM table2 AS t2 JOIN table1 AS t1 ON t1.id = t2.category ```
31,596,453
i've been given a task to improve the below query because it's kinda slow. ``` SELECT 9 AS FieldCount, A.AccountName AS Field1, U.FullName AS Field2, A.City AS Field3, A.State AS Field4, A.Zip5 AS Field5, COUNT(DISTiNCT C.Contact_ID) AS Field6, COUNT(DISTiNCT L.Lead_ID) AS Field7, A.Account_ID AS Field8, A.CreateDateT...
2015/07/23
[ "https://Stackoverflow.com/questions/31596453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4294118/" ]
What you need is a `JOIN`, which means you "combine" two tables by linking rows from one table to rows from another table based on some criterion. In your case, the criterion is that the value of `CATEGORY` in `table2` must equal the value of `ID` in `table1`, which is expressed as follows: ``` SELECT table1.category...
You can make an INNER JOIN and get the category from the Table 1, like this: ``` SELECT tb1.category, tb2.name, tb2.phone FROM table2 tb2 INNER JOIN table1 tb1 on tb2.category = tb1.id WHERE tb2.id = 1; ``` Hope it helps!
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
If you wanted to avoid converting it to a string, you could just keep dividing by 10 to find the most significant digit: ``` int getMostSignificantDigit(int x) { // Need to handle Integer.MIN_VALUE "specially" as the absolute value can't // represented. We can hard-code the fact that it starts with 2 :) x ...
I am answering here just so I can post the test code and results: ``` public class NumberStart extends AbstractBenchmark { private static final int START = 10000000; private static final int END = 50000000; private static int result; @Test @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 1) public void divide(...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
If you wanted to avoid converting it to a string, you could just keep dividing by 10 to find the most significant digit: ``` int getMostSignificantDigit(int x) { // Need to handle Integer.MIN_VALUE "specially" as the absolute value can't // represented. We can hard-code the fact that it starts with 2 :) x ...
**UPDATED** : I now test with a different number on each iteration and I added OldCurmudgeon's solution (the one derived from Bit Twiddling Hacks By Sean Eron Anderson). I benchmarked different solutions, including Jon Skeet's :) : Here is my main method used for this test: ``` public static void main(String[] args...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
If you wanted to avoid converting it to a string, you could just keep dividing by 10 to find the most significant digit: ``` int getMostSignificantDigit(int x) { // Need to handle Integer.MIN_VALUE "specially" as the absolute value can't // represented. We can hard-code the fact that it starts with 2 :) x ...
One more possibility - because division is clearly a bottleneck (or is it?): ``` // Pairs of range limits. // Reverse order to put the widest range at the top. static final int [] limits = new int[] { // Can hard-code this one to avoid one comparison. //2000000000, Integer.MAX_VALUE, 200000000, 300000000-1, 20...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
I would be tempted to do something like this: ``` x = Math.abs(x); if ( ((int) Math.floor(x / Math.pow(10, Math.floor(Math.log10(x))))) == 2 ) { ... // x equals 2 } ```
``` int intValue=213; if(String.valueOf(intValue).startsWith("2")) { System.out.println("Yes"); } else { System.out.println("No"); } ```
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
Derived from [Bit Twiddling Hacks By Sean Eron Anderson](http://graphics.stanford.edu/~seander/bithacks.html) ``` /* * Log(2) of an int. * * See: http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup */ private static final int[] Log256 = new int[256]; static { for (int i = 0; i < 256; i++) { ...
I am answering here just so I can post the test code and results: ``` public class NumberStart extends AbstractBenchmark { private static final int START = 10000000; private static final int END = 50000000; private static int result; @Test @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 1) public void divide(...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
If you wanted to avoid converting it to a string, you could just keep dividing by 10 to find the most significant digit: ``` int getMostSignificantDigit(int x) { // Need to handle Integer.MIN_VALUE "specially" as the absolute value can't // represented. We can hard-code the fact that it starts with 2 :) x ...
`((int) number / 10^(numberlength-1))` will give first digit.
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
Derived from [Bit Twiddling Hacks By Sean Eron Anderson](http://graphics.stanford.edu/~seander/bithacks.html) ``` /* * Log(2) of an int. * * See: http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup */ private static final int[] Log256 = new int[256]; static { for (int i = 0; i < 256; i++) { ...
One more possibility - because division is clearly a bottleneck (or is it?): ``` // Pairs of range limits. // Reverse order to put the widest range at the top. static final int [] limits = new int[] { // Can hard-code this one to avoid one comparison. //2000000000, Integer.MAX_VALUE, 200000000, 300000000-1, 20...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
I would be tempted to do something like this: ``` x = Math.abs(x); if ( ((int) Math.floor(x / Math.pow(10, Math.floor(Math.log10(x))))) == 2 ) { ... // x equals 2 } ```
I am answering here just so I can post the test code and results: ``` public class NumberStart extends AbstractBenchmark { private static final int START = 10000000; private static final int END = 50000000; private static int result; @Test @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 1) public void divide(...
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
I've pitted the various solutions against each other: ``` public class FirstDigit { static int digit; @GenerateMicroBenchmark public void string() { for (int i = 200_000_000; i < 400_000_000; i += 999961) digit = Integer.toString(i).charAt(0); } @GenerateMicroBenchmark public void math() { for (i...
`((int) number / 10^(numberlength-1))` will give first digit.
18,053,915
I'm working on creating Responsive web page using HTML5. Inside HTML5 Head tag, I've title, meta and link tags, is there any recommended best practice for sequencing these tags to get best possible results ? Current structure of the my page is mentioned below. ``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/x...
2013/08/05
[ "https://Stackoverflow.com/questions/18053915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273865/" ]
**UPDATED** : I now test with a different number on each iteration and I added OldCurmudgeon's solution (the one derived from Bit Twiddling Hacks By Sean Eron Anderson). I benchmarked different solutions, including Jon Skeet's :) : Here is my main method used for this test: ``` public static void main(String[] args...
`((int) number / 10^(numberlength-1))` will give first digit.
545,184
Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of [storing the data in relational database](https://stackoverflow.com/questions/545145/map-xml-structure-to-database-schema), but the la...
2009/02/13
[ "https://Stackoverflow.com/questions/545184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In my opinion, these are the factors to consider 1. Which fits your applications needs more closely 2. How large a data set you need to handle? 3. Are you transferring data between applications or are you going to query it? Once these factors are considered, I would suggest that you decide to use RDBMS, if you have l...
You should not compare XML with an RDBMS, since that are 2 complementary technologies; XML should not be considered, or regarded as a replacement for an RDMBS. An RDMBS is for storing large amounts of data in a consistent way. The RDBMS should take care of the consistentcy of the data, etc ... XML can be used for dat...
545,184
Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of [storing the data in relational database](https://stackoverflow.com/questions/545145/map-xml-structure-to-database-schema), but the la...
2009/02/13
[ "https://Stackoverflow.com/questions/545184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
If you are working with XML data, then there is almost no question that you should be looking into a Native XML database. Two of the most popular Native XML databases MarkLogic server and eXist both provide extremely robust and efficient indexing mechanisms, as well as many of the features mentioned on this list. In...
Two big inherent advantages of RDBMS are: 1. Indexing. Greatly enhances performance. 2. Constraining. You can define relationships between elements which helps maintain the integrity of your data. Keep in mind you can put xml in sql server and query it using xpath, so depending on the shape of your data, you may be a...
545,184
Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of [storing the data in relational database](https://stackoverflow.com/questions/545145/map-xml-structure-to-database-schema), but the la...
2009/02/13
[ "https://Stackoverflow.com/questions/545184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Things an RDBMS provides that XML doesn't, more or less in order of importance: * enforcement of a defined schema (though this is certainly available to XML) * support for multiple writers * atomic transactions * referential integrity * well-defined query language * ability to optimize access through indexes, compiled...
You can have the best of both worlds, your data can be stored in the database, and that has to be a better solution. As a DB is faster, more secure, has backup and restore, rollback, admin tools and so on .... It sounds as though your data is hierachial in nature, databases can be coerced to store hierarchies without...
545,184
Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of [storing the data in relational database](https://stackoverflow.com/questions/545145/map-xml-structure-to-database-schema), but the la...
2009/02/13
[ "https://Stackoverflow.com/questions/545184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In my opinion, these are the factors to consider 1. Which fits your applications needs more closely 2. How large a data set you need to handle? 3. Are you transferring data between applications or are you going to query it? Once these factors are considered, I would suggest that you decide to use RDBMS, if you have l...
Things an RDBMS provides that XML doesn't, more or less in order of importance: * enforcement of a defined schema (though this is certainly available to XML) * support for multiple writers * atomic transactions * referential integrity * well-defined query language * ability to optimize access through indexes, compiled...