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
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
You can use this function ``` IEnumerable<string> GetDirectories(string path) { DirectoryInfo di = new DirectoryInfo(path); yield return di.Name; if (di.Parent == null) yield break; foreach (var dir in GetDirectories(di.Parent.FullName)) { yield return dir; ...
You Can Do ``` string filePath="C:\\DocumentsAndSettings\\Users\\Xyz\\Downloads\\abc.txt"; filePath=Path.GetFullPath(filePath); var split =filePath.Split('\\'); var sp = split.Take(split.Length - 1); foreach ( var st in sp) { Console.WriteLine(st); } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
How about using string.Split and ignore the first and last items in the array?
You Can Do ``` string filePath="C:\\DocumentsAndSettings\\Users\\Xyz\\Downloads\\abc.txt"; filePath=Path.GetFullPath(filePath); var split =filePath.Split('\\'); var sp = split.Take(split.Length - 1); foreach ( var st in sp) { Console.WriteLine(st); } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
use (**EDIT as per comments**) ``` string YourFilePath = @"C:\hello\hi\dotnet\abc.txt"; string[] YourResult = Path.GetDirectoryName (YourFilePath).Split (new char[] {Path.DirectorySeparatorChar}).Skip(1).ToArray(); ``` And this is the result: `YourResult[0]` contains hello `YourResult[1]` contains hi `You...
You Can Do ``` string filePath="C:\\DocumentsAndSettings\\Users\\Xyz\\Downloads\\abc.txt"; filePath=Path.GetFullPath(filePath); var split =filePath.Split('\\'); var sp = split.Take(split.Length - 1); foreach ( var st in sp) { Console.WriteLine(st); } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
How about: - ``` string filename = @"C:\hello\hi\dotnet\abc.txt"; string dirName = Path.GetDirectoryName(filename); // C:\hello\hi\dotnet string pathRoot = Path.GetPathRoot(dirName); // C:\ string result = dirName.Substring(pathRoot.Length); // hello\hi\dotnet ```
You Can Do ``` string filePath="C:\\DocumentsAndSettings\\Users\\Xyz\\Downloads\\abc.txt"; filePath=Path.GetFullPath(filePath); var split =filePath.Split('\\'); var sp = split.Take(split.Length - 1); foreach ( var st in sp) { Console.WriteLine(st); } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
How about using string.Split and ignore the first and last items in the array?
``` foreach (string s in System.IO.Path.GetDirectoryName (path).Split(System.IO.Path.DirectorySeparatorChar).Skip(1)) { //output } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
use (**EDIT as per comments**) ``` string YourFilePath = @"C:\hello\hi\dotnet\abc.txt"; string[] YourResult = Path.GetDirectoryName (YourFilePath).Split (new char[] {Path.DirectorySeparatorChar}).Skip(1).ToArray(); ``` And this is the result: `YourResult[0]` contains hello `YourResult[1]` contains hi `You...
``` foreach (string s in System.IO.Path.GetDirectoryName (path).Split(System.IO.Path.DirectorySeparatorChar).Skip(1)) { //output } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
You can use this function ``` IEnumerable<string> GetDirectories(string path) { DirectoryInfo di = new DirectoryInfo(path); yield return di.Name; if (di.Parent == null) yield break; foreach (var dir in GetDirectories(di.Parent.FullName)) { yield return dir; ...
``` foreach (string s in System.IO.Path.GetDirectoryName (path).Split(System.IO.Path.DirectorySeparatorChar).Skip(1)) { //output } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
use (**EDIT as per comments**) ``` string YourFilePath = @"C:\hello\hi\dotnet\abc.txt"; string[] YourResult = Path.GetDirectoryName (YourFilePath).Split (new char[] {Path.DirectorySeparatorChar}).Skip(1).ToArray(); ``` And this is the result: `YourResult[0]` contains hello `YourResult[1]` contains hi `You...
How about using string.Split and ignore the first and last items in the array?
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
How about: - ``` string filename = @"C:\hello\hi\dotnet\abc.txt"; string dirName = Path.GetDirectoryName(filename); // C:\hello\hi\dotnet string pathRoot = Path.GetPathRoot(dirName); // C:\ string result = dirName.Substring(pathRoot.Length); // hello\hi\dotnet ```
``` foreach (string s in System.IO.Path.GetDirectoryName (path).Split(System.IO.Path.DirectorySeparatorChar).Skip(1)) { //output } ```
7,755,361
I have a filepath say "C:\hello\hi\dotnet\abc.txt". I just want the directories from the path. Expected Output : ``` hello hi dotnet ``` I have used `Path.DirectorySeparatorChar` but it doesn't work.So help me out to solve this problem.
2011/10/13
[ "https://Stackoverflow.com/questions/7755361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989421/" ]
use (**EDIT as per comments**) ``` string YourFilePath = @"C:\hello\hi\dotnet\abc.txt"; string[] YourResult = Path.GetDirectoryName (YourFilePath).Split (new char[] {Path.DirectorySeparatorChar}).Skip(1).ToArray(); ``` And this is the result: `YourResult[0]` contains hello `YourResult[1]` contains hi `You...
You can use this function ``` IEnumerable<string> GetDirectories(string path) { DirectoryInfo di = new DirectoryInfo(path); yield return di.Name; if (di.Parent == null) yield break; foreach (var dir in GetDirectories(di.Parent.FullName)) { yield return dir; ...
2,490,713
I want to run a local exe in my firefox extension javascript file, but ActiveXObject("WScript.Shell") is work fine in IE,not in FF,how to run a local exe in js in firefox.
2010/03/22
[ "https://Stackoverflow.com/questions/2490713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51958/" ]
Since you've explicitly asked for an .exe then you can use `nsILocalFile.launch()`: <https://developer.mozilla.org/en/Code_snippets/Running_applications> ``` var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath("c:\\myapp...
Hi all those who are trying to invoke an exe using javascript in mozilla firefox. Follow the steps.. I am able to run exe from my website. Step 1. Type "about:config" in address bar and make "signed.applets.codebase-principal-support" true. Step 2. Use this code. ``` <html> <head> </head> <body> <p/><input type="butt...
22,113,327
I have an iphone app nearing completion that does not support 3.5 inch screens. Do all apps have to support iphone/ipod versions 4 and below? Do I need to modify my app? To be more clear, I want to know whether my app is likely to be rejected if it does not support 3.5 inch displays.
2014/03/01
[ "https://Stackoverflow.com/questions/22113327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236840/" ]
It sounds as though you're looking for a **singleton** class. Here's a thread safe pattern for one: **Interface** ``` @interface MYSingeltonClass : NSObject + (MYSingeltonClass *) sharedManager; - (void) doSomething; @end ``` **Implmentation** ``` @implementation MYSingeltonClass + (MYSingeltonClass *) sharedM...
1) Use Singleton design Pattern You will have 1 object usable everywhere via a [MyClass sharedInstance] 2) Create an "helper" : a class with only class methods +(...*)... instead of -(...*).... You will not have any object, just a boundless of methods (don't use this if you need properties)
22,113,327
I have an iphone app nearing completion that does not support 3.5 inch screens. Do all apps have to support iphone/ipod versions 4 and below? Do I need to modify my app? To be more clear, I want to know whether my app is likely to be rejected if it does not support 3.5 inch displays.
2014/03/01
[ "https://Stackoverflow.com/questions/22113327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236840/" ]
Well, if i understand your question correctly... I'm using this model for a long time ([original](http://iphonedevsdk.com/forum/iphone-sdk-development/54859-sharing-data-between-view-controllers-and-other-objects-link-fixed.html)): 1. You need to create a generic data container class `AppDataObject`. This is an ances...
1) Use Singleton design Pattern You will have 1 object usable everywhere via a [MyClass sharedInstance] 2) Create an "helper" : a class with only class methods +(...*)... instead of -(...*).... You will not have any object, just a boundless of methods (don't use this if you need properties)
23,050
> > **Possible Duplicate:** > > [Are inertial dampeners a requirement for going to warp speed?](https://scifi.stackexchange.com/questions/7069/are-inertial-dampeners-a-requirement-for-going-to-warp-speed) > > > Inertial dampeners are used on Star Trek to prevent starship occupants from experiencing inertial ef...
2012/09/05
[ "https://scifi.stackexchange.com/questions/23050", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/5404/" ]
If I'm not mistaken, we don't even hear about inertial dampeners in Star Trek until the advent of TNG. This doesn't mean that they haven't been retconned back in, for instance they are discussed in Enterprise despite that show occurring earlier in the Star Trek canon's timeline. If Star Trek warp drives are true Alcub...
Yes you need them. There is a Voyager episode, don't ask which, where the Voyager happens to approach the surface of a planet at alarming velocity, the inertia dampeners failing and Janeway asks: "Couldn't we go to a low warp speed" and Paris replies: "The ship would make it but we would only be smears on the back wall...
35,207,113
I have a problem with my code in C++ and need some help. There are some related questions but I couldn't really understand the answers. I have a text file ('parameters.dat' in the example below) that I want to read in with my code written in C++. The file includes different types of variables: Boolean, doubles and inte...
2016/02/04
[ "https://Stackoverflow.com/questions/35207113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611188/" ]
From the mongodb documentation (<https://docs.mongodb.com/manual/reference/command/renameCollection/>) renameCollection has different performance implications depending on the target namespace. **If the target database is the same as the source database**, renameCollection simply changes the namespace. **This is a qu...
I have renamed multiple collections with around 500M documents. It completes in ~0 time. This is true for MongoDB 3.2 and 3.4, and I would guess also for older versions.
30,508,464
I am not receiving emails from this contact form, but the message seems to sending okay and it also redirects me to the sent page. I don't have access to the server only via FTP. --- PHP --- ``` <?php $to = 'test@gmail.com'; $subject = $_POST['subject']; $name = $_POST['name']; $email = $_POST['email']; $comment = ...
2015/05/28
[ "https://Stackoverflow.com/questions/30508464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3677825/" ]
Check if mail is actually being sent: ``` if (mail($to, $subject, $body, $headers)===false) { echo "Not sent!"; } else { echo "Sent!"; } ```
If your hosting provider doesn't have an email server, you could try to use a free email server and phpMailer. <https://github.com/PHPMailer/PHPMailer>
30,508,464
I am not receiving emails from this contact form, but the message seems to sending okay and it also redirects me to the sent page. I don't have access to the server only via FTP. --- PHP --- ``` <?php $to = 'test@gmail.com'; $subject = $_POST['subject']; $name = $_POST['name']; $email = $_POST['email']; $comment = ...
2015/05/28
[ "https://Stackoverflow.com/questions/30508464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3677825/" ]
Change this: ``` $headers .= 'To: test email' . "\r\n"; $headers .= 'From: <website@mt.co.uk>' . "\r\n"; ``` To this: ``` $headers .= "To: $to <test email>\r\n"; $headers .= "From: website@mt.co.uk <website@mt.co.uk>\r\n"; ``` Also, you need to sanitize the subject and body of the email so that the email arrives...
If your hosting provider doesn't have an email server, you could try to use a free email server and phpMailer. <https://github.com/PHPMailer/PHPMailer>
47,191,509
I have a table that looks like this - ``` ZIP DC1 DC2 DC3 Min Min(DC) 1 2 3 4 2 DC1 2 5 4 3 3 DC3 ``` Basically, I want to populate the last column `Min(DC)`. That column should show respective DC of the `Min` column. I have been doing it with excel y using vlookp but since my data set has grown,...
2017/11/08
[ "https://Stackoverflow.com/questions/47191509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4648472/" ]
Partitions are sub-directories. When correctly defined Athena can skip over sub-directories that do not contain relevant data. For example, if a table is partitioned by date (YYYY-MM-DD), there would be a directory called `date=2017-11-08` that contains only data for that day. Given that all your data is contained in...
One interesting point, folders in S3 are [not actually folders](https://serverfault.com/questions/435827/what-is-the-difference-between-buckets-and-folders-in-amazon-s3), I tend to think of them as tags. To John's point, you need to slice and dice your data and then tag it as such: ``` s3://mybucket/mydata/date_parti...
17,620,895
I'm having an issue using the fadeIn and fadeOut of my web pages using jQuery. When the script runs my page fades out and then I get a white flash and then my new page fades in. Is this typical for this jQuery effect? It's kind of an issue for me because the site is very dark with a black background so it's quite jarri...
2013/07/12
[ "https://Stackoverflow.com/questions/17620895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526219/" ]
When the fadeOut animation completes it will set display:none on body. This is probably the source of your white flash. Try wrapping your entire page inside a div within the body, and fading that div out. Or try applying this CSS: ``` html,body { background-color:#000; } ```
The white flash is happening because in those few moments before the .ready() function is fired, your body element is showing. This will get worse on slow connections. What you might try to do instead is overlay a div on top of your body, and then fade that div out. But your results will still vary depending on browse...
17,620,895
I'm having an issue using the fadeIn and fadeOut of my web pages using jQuery. When the script runs my page fades out and then I get a white flash and then my new page fades in. Is this typical for this jQuery effect? It's kind of an issue for me because the site is very dark with a black background so it's quite jarri...
2013/07/12
[ "https://Stackoverflow.com/questions/17620895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526219/" ]
When the fadeOut animation completes it will set display:none on body. This is probably the source of your white flash. Try wrapping your entire page inside a div within the body, and fading that div out. Or try applying this CSS: ``` html,body { background-color:#000; } ```
Have you tried using slower or faster fadeOut values? It seems like using a slower speed may help, but I haven't tested it so I can't say for sure. Could also try adding the pseudo selector :visible to the call so that it only selects currently visible items. Example: ``` $("a.transition").click(function(event){ ...
17,620,895
I'm having an issue using the fadeIn and fadeOut of my web pages using jQuery. When the script runs my page fades out and then I get a white flash and then my new page fades in. Is this typical for this jQuery effect? It's kind of an issue for me because the site is very dark with a black background so it's quite jarri...
2013/07/12
[ "https://Stackoverflow.com/questions/17620895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526219/" ]
When the fadeOut animation completes it will set display:none on body. This is probably the source of your white flash. Try wrapping your entire page inside a div within the body, and fading that div out. Or try applying this CSS: ``` html,body { background-color:#000; } ```
I know this is rather old, but I just had the same issue and will put my two cents in. It was definitely that the element I was fading in (a div with a background image which was being lazyloaded - the whole div was being faded in). My solution was to put it in its own overlay div. The problem was then solved. My ove...
17,620,895
I'm having an issue using the fadeIn and fadeOut of my web pages using jQuery. When the script runs my page fades out and then I get a white flash and then my new page fades in. Is this typical for this jQuery effect? It's kind of an issue for me because the site is very dark with a black background so it's quite jarri...
2013/07/12
[ "https://Stackoverflow.com/questions/17620895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526219/" ]
The white flash is happening because in those few moments before the .ready() function is fired, your body element is showing. This will get worse on slow connections. What you might try to do instead is overlay a div on top of your body, and then fade that div out. But your results will still vary depending on browse...
Have you tried using slower or faster fadeOut values? It seems like using a slower speed may help, but I haven't tested it so I can't say for sure. Could also try adding the pseudo selector :visible to the call so that it only selects currently visible items. Example: ``` $("a.transition").click(function(event){ ...
17,620,895
I'm having an issue using the fadeIn and fadeOut of my web pages using jQuery. When the script runs my page fades out and then I get a white flash and then my new page fades in. Is this typical for this jQuery effect? It's kind of an issue for me because the site is very dark with a black background so it's quite jarri...
2013/07/12
[ "https://Stackoverflow.com/questions/17620895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526219/" ]
The white flash is happening because in those few moments before the .ready() function is fired, your body element is showing. This will get worse on slow connections. What you might try to do instead is overlay a div on top of your body, and then fade that div out. But your results will still vary depending on browse...
I know this is rather old, but I just had the same issue and will put my two cents in. It was definitely that the element I was fading in (a div with a background image which was being lazyloaded - the whole div was being faded in). My solution was to put it in its own overlay div. The problem was then solved. My ove...
24,161,483
I want to add multiple types of regex on the password field of my form. I have done it as follow and its working. The problem is when i type something into it gives me error message even when i have entered the lowercase and digits in the field. ``` $.validator.addMethod "LowserCase", ((value, element, regexp) -> ...
2014/06/11
[ "https://Stackoverflow.com/questions/24161483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3269780/" ]
Your problem has nothing to do with regex at all. You have a whole bunch of syntax issues and I'm not sure how any of this could have been working. You're missing all kinds of punctuation, like parenthesis, braces, commas, and the word `function` itself. --- Your `.rules()` method... ``` $("#user_password").rules "a...
You can try creating validation rules against class. You can add a rule for a specific class like this: ``` $.validator.addMethod( // add a validation method 'letterSpaceFieldRegEx', function (value) { return /^([a-zA-Z\ ])*$/.test(value); // only letters and space }, '* Only letters' ); j...
42,802,434
I want to perform the delete operation in 2 tables with a given id here is sudo code ``` declare cursor del_id is select person_id from table_1 where termination is true begin for id_x in del_id delete from table_X where id=id_x delete from tabele_Y where id=id_x ``` How to do that ? i can't directly ...
2017/03/15
[ "https://Stackoverflow.com/questions/42802434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5349222/" ]
To print the values from a cursor, you need to explicitly write the columns you want; `dbms_output.put_line` can not handle a row that may contain many columns with different types, so you need to pass it a string. ``` SQL> declare 2 cursor del_id is select 1 as one, 2 as two from dual; 3 begin 4 FOR id ...
You do not need a cursor: ``` BEGIN DELETE FROM table_X WHERE id IN ( select person_id from table_1 where termination is true ); DELETE FROM table_Y WHERE id IN ( select person_id from table_1 where termination is true ); END; / ``` You could also use a collection: ``` CREATE TYPE id_type IS TABLE OF INT...
4,026,053
I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database ``` <cfquery dbname="blah"> ``` I know in PHP I have to use `mysql_query()` and `mysql_connect()`, and here is the code I have, so I understand how to access a server and a table,...
2010/10/26
[ "https://Stackoverflow.com/questions/4026053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481140/" ]
Find out the database name and select it before making any queries: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db('dbName', $connect); ``` [Documentation for mysql\_select\_db](http://us.php.net/mysql_select_db).
Use [mysql\_select\_db](http://php.net/manual/en/function.mysql-select-db.php) to connect to the database. Most of the mysql\_ functions should be what you are looking for when working with mysql databases.
4,026,053
I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database ``` <cfquery dbname="blah"> ``` I know in PHP I have to use `mysql_query()` and `mysql_connect()`, and here is the code I have, so I understand how to access a server and a table,...
2010/10/26
[ "https://Stackoverflow.com/questions/4026053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481140/" ]
Find out the database name and select it before making any queries: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db('dbName', $connect); ``` [Documentation for mysql\_select\_db](http://us.php.net/mysql_select_db).
You probably want to use mysql\_select\_db: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db( "blah", $connect ); ```
4,026,053
I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database ``` <cfquery dbname="blah"> ``` I know in PHP I have to use `mysql_query()` and `mysql_connect()`, and here is the code I have, so I understand how to access a server and a table,...
2010/10/26
[ "https://Stackoverflow.com/questions/4026053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481140/" ]
Find out the database name and select it before making any queries: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db('dbName', $connect); ``` [Documentation for mysql\_select\_db](http://us.php.net/mysql_select_db).
Are you looking for [mysql\_select\_db](http://us2.php.net/manual/en/function.mysql-select-db.php)? You can find [all mysql functions here](http://us2.php.net/manual/en/ref.mysql.php).
4,026,053
I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database ``` <cfquery dbname="blah"> ``` I know in PHP I have to use `mysql_query()` and `mysql_connect()`, and here is the code I have, so I understand how to access a server and a table,...
2010/10/26
[ "https://Stackoverflow.com/questions/4026053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481140/" ]
You probably want to use mysql\_select\_db: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db( "blah", $connect ); ```
Use [mysql\_select\_db](http://php.net/manual/en/function.mysql-select-db.php) to connect to the database. Most of the mysql\_ functions should be what you are looking for when working with mysql databases.
4,026,053
I'm very new to PHP, SQL I've worked with using Coldfusion but only with very simple queries. In coldfusion to access a specific database ``` <cfquery dbname="blah"> ``` I know in PHP I have to use `mysql_query()` and `mysql_connect()`, and here is the code I have, so I understand how to access a server and a table,...
2010/10/26
[ "https://Stackoverflow.com/questions/4026053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481140/" ]
You probably want to use mysql\_select\_db: ``` $connect = mysql_connect('students','xxxxxxx','xxxxxxx'); mysql_select_db( "blah", $connect ); ```
Are you looking for [mysql\_select\_db](http://us2.php.net/manual/en/function.mysql-select-db.php)? You can find [all mysql functions here](http://us2.php.net/manual/en/ref.mysql.php).
6,492,704
I was trying to understand the [Wikipedia article on homoiconity](http://en.wikipedia.org/wiki/Homoiconicity), but it's too verbose and does not explain the main theory behind the word concisely. I should add that I'm not a native English speaker so I prefer simple English over academic white paper quotes. So, what ex...
2011/06/27
[ "https://Stackoverflow.com/questions/6492704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283055/" ]
It means "code as data" which is a general characteristic of Lisp family. ``` (add 2 3) ``` Just like above string, which is both a list and also a function call. The "Homo" prefix stands for this characteristic.
Scheme is homo-iconic because its programs have an interpretation as data structures. ``` '(define (foo x) (* x x)) ``` is a list, the first element of which is `define`, the second `(foo x)` (a list), and so on. The quote mark `'` means: don't interpret this, leave it as a list. If we remove the `'` we get ``` (de...
6,492,704
I was trying to understand the [Wikipedia article on homoiconity](http://en.wikipedia.org/wiki/Homoiconicity), but it's too verbose and does not explain the main theory behind the word concisely. I should add that I'm not a native English speaker so I prefer simple English over academic white paper quotes. So, what ex...
2011/06/27
[ "https://Stackoverflow.com/questions/6492704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283055/" ]
Scheme is homo-iconic because its programs have an interpretation as data structures. ``` '(define (foo x) (* x x)) ``` is a list, the first element of which is `define`, the second `(foo x)` (a list), and so on. The quote mark `'` means: don't interpret this, leave it as a list. If we remove the `'` we get ``` (de...
Homoiconicy can mean different things to different people. Originally, it was defined in the context of the language *TRAC*, as such: > > Because TRAC procedures and text have the same representation inside and > outside the processor, the term homo-iconic is applicable, from homo meaning > the same, and icon meani...
6,492,704
I was trying to understand the [Wikipedia article on homoiconity](http://en.wikipedia.org/wiki/Homoiconicity), but it's too verbose and does not explain the main theory behind the word concisely. I should add that I'm not a native English speaker so I prefer simple English over academic white paper quotes. So, what ex...
2011/06/27
[ "https://Stackoverflow.com/questions/6492704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283055/" ]
It means "code as data" which is a general characteristic of Lisp family. ``` (add 2 3) ``` Just like above string, which is both a list and also a function call. The "Homo" prefix stands for this characteristic.
Homoiconicy can mean different things to different people. Originally, it was defined in the context of the language *TRAC*, as such: > > Because TRAC procedures and text have the same representation inside and > outside the processor, the term homo-iconic is applicable, from homo meaning > the same, and icon meani...
29,035,395
I've got a code in a dropdown box on my userform. Every time the user moves away from the drop down box, the code checks whether the value put by the user is correct (i.e. matches a list). If it doesn't, it triggers a message box. Here is my code: ``` Private Sub CmboxModifyRoute_Exit(ByVal Cancel As MSForms.ReturnBoo...
2015/03/13
[ "https://Stackoverflow.com/questions/29035395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4665335/" ]
The commands following `ssh machine` in a script are not run on the machine. They will be run on the local machine once the `ssh` exits. Either specify the commands to run as an argument of `ssh`, or alternatively, run ssh and make it read the commands from standard input, and send the commands to it. ``` ssh machine...
You seem to be a little confused as to what runs where. ``` ssh -o ConnectTimeout=10 $1 'exit' ``` will connect to $1, run exit, and disconnect. ``` ssh -o ConnectTimeout=10 $1 'echo hello world' ``` will print hello world on the server and then disconnect. ssh $1 will open up a shell on the remote. After th...
29,035,395
I've got a code in a dropdown box on my userform. Every time the user moves away from the drop down box, the code checks whether the value put by the user is correct (i.e. matches a list). If it doesn't, it triggers a message box. Here is my code: ``` Private Sub CmboxModifyRoute_Exit(ByVal Cancel As MSForms.ReturnBoo...
2015/03/13
[ "https://Stackoverflow.com/questions/29035395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4665335/" ]
I'm surprised nobody has suggested a heredoc yet. ``` sudo ssh "$1" <<'EOF' SRV=`cat /etc/puppet/puppet.conf | grep -i srv_domain | awk '{print $3}'` echo $SRV echo "puppetMaster=`host -t srv _x-puppet._tcp.$SRV | head -1 | awk '{print $8}' | cut -f1 -d"."`" echo $puppetMaster EOF ``` This feeds everything from the ...
The commands following `ssh machine` in a script are not run on the machine. They will be run on the local machine once the `ssh` exits. Either specify the commands to run as an argument of `ssh`, or alternatively, run ssh and make it read the commands from standard input, and send the commands to it. ``` ssh machine...
29,035,395
I've got a code in a dropdown box on my userform. Every time the user moves away from the drop down box, the code checks whether the value put by the user is correct (i.e. matches a list). If it doesn't, it triggers a message box. Here is my code: ``` Private Sub CmboxModifyRoute_Exit(ByVal Cancel As MSForms.ReturnBoo...
2015/03/13
[ "https://Stackoverflow.com/questions/29035395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4665335/" ]
I'm surprised nobody has suggested a heredoc yet. ``` sudo ssh "$1" <<'EOF' SRV=`cat /etc/puppet/puppet.conf | grep -i srv_domain | awk '{print $3}'` echo $SRV echo "puppetMaster=`host -t srv _x-puppet._tcp.$SRV | head -1 | awk '{print $8}' | cut -f1 -d"."`" echo $puppetMaster EOF ``` This feeds everything from the ...
You seem to be a little confused as to what runs where. ``` ssh -o ConnectTimeout=10 $1 'exit' ``` will connect to $1, run exit, and disconnect. ``` ssh -o ConnectTimeout=10 $1 'echo hello world' ``` will print hello world on the server and then disconnect. ssh $1 will open up a shell on the remote. After th...
1,901,429
Prove that the following identity is valid for all $z$ with $z\neq1$: $$1+z+z^2+...+z^n=\frac{1-z^{n+1}}{1-z}$$
2016/08/23
[ "https://math.stackexchange.com/questions/1901429", "https://math.stackexchange.com", "https://math.stackexchange.com/users/276360/" ]
\begin{align} S=1+&z+z^2+z^3+\cdots+z^n\\ zS=\quad\quad&z+z^2+z^3+\cdots+z^n+z^{n+1}\\ \\ S-zS=1-z^{n+1}\\ S=\frac{1-z^{n+1}}{1-z} \end{align}
Multiply out $(1-z)(1+z+z^2+\dots+z^n)$. You get $(1+z+z^2+\dots+z^n)-(z+z^2+z^3+\dots+z^{n+1})=1-z^{n+1}$.
1,901,429
Prove that the following identity is valid for all $z$ with $z\neq1$: $$1+z+z^2+...+z^n=\frac{1-z^{n+1}}{1-z}$$
2016/08/23
[ "https://math.stackexchange.com/questions/1901429", "https://math.stackexchange.com", "https://math.stackexchange.com/users/276360/" ]
\begin{align} S=1+&z+z^2+z^3+\cdots+z^n\\ zS=\quad\quad&z+z^2+z^3+\cdots+z^n+z^{n+1}\\ \\ S-zS=1-z^{n+1}\\ S=\frac{1-z^{n+1}}{1-z} \end{align}
**By induction**: With $n=0$, $$1=\frac{1-z^1}{1-z}.$$ Then $$S\_n+z^{n+1}=\frac{1-z^{n+1}}{1-z}+z^{n+1}=\frac{1-z^{n+2}}{1-z}=S\_{n+1}.$$
1,901,429
Prove that the following identity is valid for all $z$ with $z\neq1$: $$1+z+z^2+...+z^n=\frac{1-z^{n+1}}{1-z}$$
2016/08/23
[ "https://math.stackexchange.com/questions/1901429", "https://math.stackexchange.com", "https://math.stackexchange.com/users/276360/" ]
\begin{align} S=1+&z+z^2+z^3+\cdots+z^n\\ zS=\quad\quad&z+z^2+z^3+\cdots+z^n+z^{n+1}\\ \\ S-zS=1-z^{n+1}\\ S=\frac{1-z^{n+1}}{1-z} \end{align}
$$S\_{n+1}=\frac{1-z^{n+1}}{1-z}=\frac{1-z+z-z^{n+1}}{1-z}=1+zS\_{n},$$ with $S\_0=1$. Then the iterates are $$S\_0=1,S\_1=1+z,S\_2=1+z+z^2,S\_3=1+z+z^2+z^3,\cdots$$
22,349,791
How do I use mouseneter mouseleave instead of hover(). Should i use them both instead of hover()? ``` $('#somegrid').hover( function () { //something; }, ``` What about legacy code - I mean what goes in mouseenter , what goes in mouseleave? i just had one action on hover()
2014/03/12
[ "https://Stackoverflow.com/questions/22349791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/972480/" ]
Like this - ``` $('#somegrid').on('mouseenter',function(){ // mouseenter }).on('mouseleave',function(){ // mouseleave }); ```
look at the [api](http://api.jquery.com/hover/) for hover the hover function is shorhand for: ``` $( selector ).mouseenter( handlerIn ).mouseleave( handlerOut ); ``` or if you are only passing in one handler: ``` $( selector ).on( "mouseenter mouseleave", handlerInOut ); ``` the examples in the api illustrate th...
16,322,770
I have table in the jsp which is dynamically populated. I used same id for all the table rows. In the javascript I want to retreive all the table row elements whose id is "resultRow". and getElementsByName("resultRow") in js gives empty htmlcollection in IE10 Is there any other way to get the tablerows of matched id...
2013/05/01
[ "https://Stackoverflow.com/questions/16322770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300518/" ]
I've just confirmed with my own testing that this is a change that Microsoft seems to have made in IE10 to make it compatible with every other browser on the market. In every other browser, ID and name are different things. But until IE 10, Microsoft chose to do things differently, which caused lots of incompatibilitie...
This behavior is by design. `name` and `id` are two different things. In addition, `id`s must be unique; your HTML is invalid. You should use `class` instead, and call `getElementsByClassName()`.
16,322,770
I have table in the jsp which is dynamically populated. I used same id for all the table rows. In the javascript I want to retreive all the table row elements whose id is "resultRow". and getElementsByName("resultRow") in js gives empty htmlcollection in IE10 Is there any other way to get the tablerows of matched id...
2013/05/01
[ "https://Stackoverflow.com/questions/16322770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300518/" ]
I've just confirmed with my own testing that this is a change that Microsoft seems to have made in IE10 to make it compatible with every other browser on the market. In every other browser, ID and name are different things. But until IE 10, Microsoft chose to do things differently, which caused lots of incompatibilitie...
Since when were `name` and `id` equal? To give an example, how many people have the name John Smith (besides the Doctor)? In spite of that, they all have unique IDs. The same applies to your HTML. Use `<tr name="resultRow"...>`, then you can access `getElementsByName('resultRow')`
8,917
I often see lots of questions that are along the lines of 'What is the best software / tool for X?', or 'What is your favorite trick for x?'. They seem to be the sort of questions that generate the most reputation, at least on serverfault. I kind of don't like these questions, but that is just me so I am wondering wh...
2009/07/24
[ "https://meta.stackexchange.com/questions/8917", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/131182/" ]
Any time I see something that is looking for the best, "must have", "most", etc, it is almost a dead give away to me that it is going to be an open-ended discussion and therefore going to get moved over to Community Wiki (this is SuperUser). So far it has been pretty effective at limiting the reputation affects these q...
My instinct is to want more designations for questions, because I professionally find the "tools" posts to be FAR more useful (and appropriate for rep, tho maybe at half the level of actual questions) than the "joke" and "funniest" posts (which should have rep stripped from them, IMO, they have nothing to do with techn...
8,917
I often see lots of questions that are along the lines of 'What is the best software / tool for X?', or 'What is your favorite trick for x?'. They seem to be the sort of questions that generate the most reputation, at least on serverfault. I kind of don't like these questions, but that is just me so I am wondering wh...
2009/07/24
[ "https://meta.stackexchange.com/questions/8917", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/131182/" ]
I tricky one; I think there is a big difference between asking the right tool for a specific job, and just wanting a "coolest" thread. We might have some old and long old posts, but IMO many of the new "funniest" / "coolest" really deserve deletion; they add nothing... and should *certainly* be wiki if they live... I'...
My instinct is to want more designations for questions, because I professionally find the "tools" posts to be FAR more useful (and appropriate for rep, tho maybe at half the level of actual questions) than the "joke" and "funniest" posts (which should have rep stripped from them, IMO, they have nothing to do with techn...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
String.xml can contains HTML entities, like so: ``` <resources> <string name="hello_world">&lt;span&gt;</string> </resources> ``` In your code: `getResources().getString(R.string.hello_world);` will evaluate to `"<span>"`. You can use this HTML formatted text like this: ``` TextView helloWorld = (TextView)findV...
All the styling supported by the XML resources system is explained in the Android documentation. [String Resources: Formatting and Styling](http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling) Anything included there can be used and set directly on `TextView`. If you need to ...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
Here's most of the examples. I don't think the `pre` tag is supported. ![enter image description here](https://i.stack.imgur.com/WdeFJ.png) This is the `strings.xml` file: ``` <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Formatting</string> <string name="link">&lt;b&gt;Hello Wor...
String.xml can contains HTML entities, like so: ``` <resources> <string name="hello_world">&lt;span&gt;</string> </resources> ``` In your code: `getResources().getString(R.string.hello_world);` will evaluate to `"<span>"`. You can use this HTML formatted text like this: ``` TextView helloWorld = (TextView)findV...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
The best way to add html source code in strings.xml is to use `<![CDATA[html source code]]>`. Here is an example: ``` <string name="html"><![CDATA[<p>Text</p>]]></string> ``` Then you can display this html in TextView using: ``` myTextView.setText(Html.fromHtml(getString(R.string.html))); ``` If you have links i...
String.xml can contains HTML entities, like so: ``` <resources> <string name="hello_world">&lt;span&gt;</string> </resources> ``` In your code: `getResources().getString(R.string.hello_world);` will evaluate to `"<span>"`. You can use this HTML formatted text like this: ``` TextView helloWorld = (TextView)findV...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
String.xml can contains HTML entities, like so: ``` <resources> <string name="hello_world">&lt;span&gt;</string> </resources> ``` In your code: `getResources().getString(R.string.hello_world);` will evaluate to `"<span>"`. You can use this HTML formatted text like this: ``` TextView helloWorld = (TextView)findV...
This Worked for me : ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <string name="app_name">Sangamner College</string> <string name="about_desc"><![CDATA[In order to make higher education available in the rural environment such as of Sangamner, Shikshan Prasarak Sanstha was established in 1960. Sangamner College...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
Here's most of the examples. I don't think the `pre` tag is supported. ![enter image description here](https://i.stack.imgur.com/WdeFJ.png) This is the `strings.xml` file: ``` <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Formatting</string> <string name="link">&lt;b&gt;Hello Wor...
All the styling supported by the XML resources system is explained in the Android documentation. [String Resources: Formatting and Styling](http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling) Anything included there can be used and set directly on `TextView`. If you need to ...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
The best way to add html source code in strings.xml is to use `<![CDATA[html source code]]>`. Here is an example: ``` <string name="html"><![CDATA[<p>Text</p>]]></string> ``` Then you can display this html in TextView using: ``` myTextView.setText(Html.fromHtml(getString(R.string.html))); ``` If you have links i...
All the styling supported by the XML resources system is explained in the Android documentation. [String Resources: Formatting and Styling](http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling) Anything included there can be used and set directly on `TextView`. If you need to ...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
All the styling supported by the XML resources system is explained in the Android documentation. [String Resources: Formatting and Styling](http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling) Anything included there can be used and set directly on `TextView`. If you need to ...
This Worked for me : ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <string name="app_name">Sangamner College</string> <string name="about_desc"><![CDATA[In order to make higher education available in the rural environment such as of Sangamner, Shikshan Prasarak Sanstha was established in 1960. Sangamner College...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
The best way to add html source code in strings.xml is to use `<![CDATA[html source code]]>`. Here is an example: ``` <string name="html"><![CDATA[<p>Text</p>]]></string> ``` Then you can display this html in TextView using: ``` myTextView.setText(Html.fromHtml(getString(R.string.html))); ``` If you have links i...
Here's most of the examples. I don't think the `pre` tag is supported. ![enter image description here](https://i.stack.imgur.com/WdeFJ.png) This is the `strings.xml` file: ``` <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Formatting</string> <string name="link">&lt;b&gt;Hello Wor...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
Here's most of the examples. I don't think the `pre` tag is supported. ![enter image description here](https://i.stack.imgur.com/WdeFJ.png) This is the `strings.xml` file: ``` <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">Formatting</string> <string name="link">&lt;b&gt;Hello Wor...
This Worked for me : ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <string name="app_name">Sangamner College</string> <string name="about_desc"><![CDATA[In order to make higher education available in the rural environment such as of Sangamner, Shikshan Prasarak Sanstha was established in 1960. Sangamner College...
13,425,002
I would like display for example this html code: ``` <body> <p><b>Hello World</b></p> <p>This is a test of the URL <a href="http://www.example.com"> Example</a></p> <p><b>This text is bold</b></p> <p><em>This text is emphasized</em></p> <p><code>This is computer output</code></p> <p>This is<su...
2012/11/16
[ "https://Stackoverflow.com/questions/13425002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1792618/" ]
The best way to add html source code in strings.xml is to use `<![CDATA[html source code]]>`. Here is an example: ``` <string name="html"><![CDATA[<p>Text</p>]]></string> ``` Then you can display this html in TextView using: ``` myTextView.setText(Html.fromHtml(getString(R.string.html))); ``` If you have links i...
This Worked for me : ``` <?xml version="1.0" encoding="utf-8"?> ``` ``` <string name="app_name">Sangamner College</string> <string name="about_desc"><![CDATA[In order to make higher education available in the rural environment such as of Sangamner, Shikshan Prasarak Sanstha was established in 1960. Sangamner College...
37,090,998
When I'm trying to launch my emulator, I'm getting this type of error message in my Event log: > > 19:26:47 ProcessNotCreatedException: Error launching emulator: Cannot > run program > "C:\Users\Tadas\AppData\Local\Android\sdk\tools\emulator.exe": > CreateProcess error=2, The system cannot find the file specified ...
2016/05/07
[ "https://Stackoverflow.com/questions/37090998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154921/" ]
Firstly find that if you file is there or not by running the below in the Command Console. ``` dir C:\Users\Tadas\AppData\Local\Android\sdk\tools\emulator.exe ``` If you don't find it there, that means the file has been removed. Then you might want to locate where your emulator is. If you find it else where, go to...
Try this. Two items to check, a corrupted emulator.exe, and your pc is not able to load it due to low memory.
37,090,998
When I'm trying to launch my emulator, I'm getting this type of error message in my Event log: > > 19:26:47 ProcessNotCreatedException: Error launching emulator: Cannot > run program > "C:\Users\Tadas\AppData\Local\Android\sdk\tools\emulator.exe": > CreateProcess error=2, The system cannot find the file specified ...
2016/05/07
[ "https://Stackoverflow.com/questions/37090998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6154921/" ]
Firstly find that if you file is there or not by running the below in the Command Console. ``` dir C:\Users\Tadas\AppData\Local\Android\sdk\tools\emulator.exe ``` If you don't find it there, that means the file has been removed. Then you might want to locate where your emulator is. If you find it else where, go to...
You may not missing the only *emulator.exe* but the whole *tools* folder. So lookup for tools folder inside **SDK** dir. If it's missing find another **SDK** and copy it's tools folder into you original **SDK** folder.
29,700,507
I am creating e-learning that users will take a quiz. Upon submit they will be sent to the results page where it will show them their scores. If the user passes a link will pop up to a certificate they can print out. I cannot get the certificate to populate variables(first name, last name, etc). Here is what I have: i...
2015/04/17
[ "https://Stackoverflow.com/questions/29700507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4739372/" ]
As far as I know, you CANNOT open a native Play Store app without sending your to background. You can use [WebView](http://developer.android.com/reference/android/webkit/WebView.html), but this is a whole different thing.
You can do it using webview. Just load url of application in your application's webview.
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
**It depends.** Yes, posting your own answer gives you more reputation (any reputation for users above 2k). But that's not really why we're here, no? We're here to provide expertise on a subject, not just to earn imaginary internet points. With this in mind, it absolutely depends on what the edit entails. Remember the...
### Outdated answers without any possible use are bad and should not exist Ideally, we want users that come to this site to find an answer to a question, to find the best answer immediately, right on top, accepted and/or highly upvoted. **However**, this does not mean that the entirety of an answer should be changed ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Having recently updated one of my own answers and also having stumbled upon this post, I feel compelled to give my two cents on the issue. Some backstory: I noticed an old answer of mine having received some upvotes and also a bounty prizing my contribution. When I checked the answer, despite still valid, misses some ...
I think it's best to edit the information into the answer. One option is to add an answer with the new information. This is only good if the Question asker, changes the accepted answer. This is unlikely to happen though. So the problem is that the new (up to date) answer will be below the outdated (possibly incorrect)...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
**It depends.** Yes, posting your own answer gives you more reputation (any reputation for users above 2k). But that's not really why we're here, no? We're here to provide expertise on a subject, not just to earn imaginary internet points. With this in mind, it absolutely depends on what the edit entails. Remember the...
I disagree with the other answers. **It really depends on what sort of editing you are doing.** **TL;DR** Edit if you're just updating old information, post a new answer if you're adding content. --- I believe edits **should be used if you are updating the existing, obselete information. You're not adding anything; ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
**It depends.** Yes, posting your own answer gives you more reputation (any reputation for users above 2k). But that's not really why we're here, no? We're here to provide expertise on a subject, not just to earn imaginary internet points. With this in mind, it absolutely depends on what the edit entails. Remember the...
I think it's best to edit the information into the answer. One option is to add an answer with the new information. This is only good if the Question asker, changes the accepted answer. This is unlikely to happen though. So the problem is that the new (up to date) answer will be below the outdated (possibly incorrect)...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Having recently updated one of my own answers and also having stumbled upon this post, I feel compelled to give my two cents on the issue. Some backstory: I noticed an old answer of mine having received some upvotes and also a bounty prizing my contribution. When I checked the answer, despite still valid, misses some ...
I disagree with the other answers. **It really depends on what sort of editing you are doing.** **TL;DR** Edit if you're just updating old information, post a new answer if you're adding content. --- I believe edits **should be used if you are updating the existing, obselete information. You're not adding anything; ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Answers are our bread and butter. They're the whole reason the site *exists*. We also provide our strongest rewards for answers: 10 whole rep per upvote, along with perhaps an accept. There's lots of incentive for answering a question. In fact, that's our heaviest moderation task; sorting the chaff from the wheat. We ...
I disagree with the other answers. **It really depends on what sort of editing you are doing.** **TL;DR** Edit if you're just updating old information, post a new answer if you're adding content. --- I believe edits **should be used if you are updating the existing, obselete information. You're not adding anything; ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Having recently updated one of my own answers and also having stumbled upon this post, I feel compelled to give my two cents on the issue. Some backstory: I noticed an old answer of mine having received some upvotes and also a bounty prizing my contribution. When I checked the answer, despite still valid, misses some ...
### Outdated answers without any possible use are bad and should not exist Ideally, we want users that come to this site to find an answer to a question, to find the best answer immediately, right on top, accepted and/or highly upvoted. **However**, this does not mean that the entirety of an answer should be changed ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Answers are our bread and butter. They're the whole reason the site *exists*. We also provide our strongest rewards for answers: 10 whole rep per upvote, along with perhaps an accept. There's lots of incentive for answering a question. In fact, that's our heaviest moderation task; sorting the chaff from the wheat. We ...
Changing an existing answer is a tricky and even dangerous thing with regards to old questions. In the case of games, you can never assume everybody is using the latest and greatest version. I know people who still play MC 1.2 and 1.4 At the same time, new information exists and a new answer therefore exists. Where, t...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Answers are our bread and butter. They're the whole reason the site *exists*. We also provide our strongest rewards for answers: 10 whole rep per upvote, along with perhaps an accept. There's lots of incentive for answering a question. In fact, that's our heaviest moderation task; sorting the chaff from the wheat. We ...
Having recently updated one of my own answers and also having stumbled upon this post, I feel compelled to give my two cents on the issue. Some backstory: I noticed an old answer of mine having received some upvotes and also a bounty prizing my contribution. When I checked the answer, despite still valid, misses some ...
10,765
It is a given that, with time, questions and answers will become out dated. Good answers will not always apply to future patches, and questions may concern issues that simply do not exist in newer patches. I have been linked to a few meta posts regarding the appropriate action. [The consensus here](https://gaming.meta...
2015/08/04
[ "https://gaming.meta.stackexchange.com/questions/10765", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/-1/" ]
Answers are our bread and butter. They're the whole reason the site *exists*. We also provide our strongest rewards for answers: 10 whole rep per upvote, along with perhaps an accept. There's lots of incentive for answering a question. In fact, that's our heaviest moderation task; sorting the chaff from the wheat. We ...
### Outdated answers without any possible use are bad and should not exist Ideally, we want users that come to this site to find an answer to a question, to find the best answer immediately, right on top, accepted and/or highly upvoted. **However**, this does not mean that the entirety of an answer should be changed ...
24,258,176
Trying to build an app, like so ![enter image description here](https://i.stack.imgur.com/3CsGZ.png) App has two collections **movies** ``` { "_id" : "S7mGgtJhiQ3GZavqn", "cast_id" : [ "pBnAFGaxNGLkDGuPk", "7HZkmd6BofNmjXRyw" ], "date" : "31-May-2014", "name" : "Rakshak", "vo...
2014/06/17
[ "https://Stackoverflow.com/questions/24258176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/932307/" ]
There are few fixes needed to make your example working, so I decided to create quick meteor project: <https://github.com/parhelium/meteor-so-movies-cast> Result: ![result](https://i.stack.imgur.com/gpHtP.png) Fixed code: ``` <template name="cast"> <a href="{{link}}">{{name}}</a>&#44; </template> Template.movi...
Your code is not working because you are not using the cast\_id array on the movie object. Instead you are trying to find cast with the \_id associated with the movie. In the movie template helpers the data context is set to the movie object. Instead you should set the data context to the cast\_id entries for the cas...
50,609,263
I have a custo workflow that creates an account and opportunities. Sometimes I have this error: Account with Id = "xxxxxx" does not exist. I don't know what's wrong in my code knowing that I find the account in the CRM. Here are the steps of my plugin code: 1. Find the account by num (if it doesn't exist, I creat...
2018/05/30
[ "https://Stackoverflow.com/questions/50609263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4807469/" ]
You haven't shown us the entire plugin, so this is just a guess, but you're probably sharing your IOrganizationService at the class level, which is causing race conditions in your code, and one thread creates a new account in a different context, then its service gets overwritten by another thread, which is in a differ...
Whenever you are trying to consume the created record in the same transaction, convert the plugin into Asynchronous mode - this will work.
991,167
I am running a webserver (in this case airflow) on an Ubuntu 18.04 machine which needs to access a SQL Server database which is on the domain/AD. **Q: How can I use Kerberos authentication in a systemd service to access a MSSQL database on the domain?** *Subqestion: How might I automate renewal of tickets? I toiled w...
2019/11/08
[ "https://serverfault.com/questions/991167", "https://serverfault.com", "https://serverfault.com/users/547852/" ]
The usual way to do this is to have a *separate* service that keeps your Kerberos ticket refreshed, and in the MS SQL service set the `KRB5CCNAME` environment variable to the path of the credentials cache that the other service is keeping refreshed. In the MS SQL service: ``` # systemd service file ... [Service] Envi...
In recent MIT Kerberos versions client keytabs were introduced. They are used by the `GSS-API` to obtain a credential cache if it is missing. You just have to find the default location: ``` krb5-config --defcktname ``` and create the keytab using `kadmin`: ``` ktadd -k <location> airflow@EXAMPLE.COM ```
4,344,929
I am trying to pass parameters to my stored procedure. They are like this ``` @p_latitude='',@p_longitude='',@p_miles='',@p_searchtext='',@p_maptownid=182,@p_regionid=0 ``` From code I am passing the parameters like ``` cmd.Parameters.Add("@p_latitude", SqlDbType.NVarChar).Value="''"; cmd.Parameters.Add("@p_longit...
2010/12/03
[ "https://Stackoverflow.com/questions/4344929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/502501/" ]
Empty strings should be passed as `""` not `"''"`. The apostrophes (`'`) will be passed in as the string value and not as string delimiters. The error message says you have a float column that you pass a nvarchar. I suspect that the @p\_latitude and @p\_longtitude params is the problem. Try to set the value directly a...
Try using DbType.String instead of SqlDbType.NVarChar Well actually, this is how I do it (they were all in different layers so I suggest you to do the same): ``` List<SqlParameter> parameters = new List<SqlParameter> { }; string status = "dummystatus"; string date = Datetime.Now; parameters.Add(new SqlParameter("@St...
4,344,929
I am trying to pass parameters to my stored procedure. They are like this ``` @p_latitude='',@p_longitude='',@p_miles='',@p_searchtext='',@p_maptownid=182,@p_regionid=0 ``` From code I am passing the parameters like ``` cmd.Parameters.Add("@p_latitude", SqlDbType.NVarChar).Value="''"; cmd.Parameters.Add("@p_longit...
2010/12/03
[ "https://Stackoverflow.com/questions/4344929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/502501/" ]
I'm guessing that latitude, longitude and miles are floating point numbers. If so, you need to pass them as such: ``` cmd.Parameters.AddWithValue("@p_latitude", 0.0); cmd.Parameters.AddWithValue("@p_longitude", 0.0); cmd.Parameters.AddWithValue("@p_miles", 0.0); ```
Try using DbType.String instead of SqlDbType.NVarChar Well actually, this is how I do it (they were all in different layers so I suggest you to do the same): ``` List<SqlParameter> parameters = new List<SqlParameter> { }; string status = "dummystatus"; string date = Datetime.Now; parameters.Add(new SqlParameter("@St...
4,344,929
I am trying to pass parameters to my stored procedure. They are like this ``` @p_latitude='',@p_longitude='',@p_miles='',@p_searchtext='',@p_maptownid=182,@p_regionid=0 ``` From code I am passing the parameters like ``` cmd.Parameters.Add("@p_latitude", SqlDbType.NVarChar).Value="''"; cmd.Parameters.Add("@p_longit...
2010/12/03
[ "https://Stackoverflow.com/questions/4344929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/502501/" ]
Empty strings should be passed as `""` not `"''"`. The apostrophes (`'`) will be passed in as the string value and not as string delimiters. The error message says you have a float column that you pass a nvarchar. I suspect that the @p\_latitude and @p\_longtitude params is the problem. Try to set the value directly a...
I'm guessing that latitude, longitude and miles are floating point numbers. If so, you need to pass them as such: ``` cmd.Parameters.AddWithValue("@p_latitude", 0.0); cmd.Parameters.AddWithValue("@p_longitude", 0.0); cmd.Parameters.AddWithValue("@p_miles", 0.0); ```
3,195,808
I've just stumbled across $$\left(e^{2\pi i}\right)^{\frac{1}{2}}=\sqrt 1=1\neq -1=e^{\pi i},$$do I have some error in my thoughts there or does $(a^b)^c=a^{(bc)}$ not hold for complex numbers?
2019/04/21
[ "https://math.stackexchange.com/questions/3195808", "https://math.stackexchange.com", "https://math.stackexchange.com/users/610635/" ]
Actually, that equality *makes no sense* for complex numbers. How do you even *define* $a^b$ if $a$ and $b$ are arbitrary complex numbers?
That's because $$ (e^{2\pi i})^{1/2}\neq e^{\pi i}, $$ even though their square is equal: $$ (e^{2\pi i})= (e^{\pi i})^2. $$ Just like what's in real numbers, every complex number have two square roots. The power $1/2$ placed at the top right corner just gives you one of them. $e^{\pi i}$ is another square root of $1$.
3,195,808
I've just stumbled across $$\left(e^{2\pi i}\right)^{\frac{1}{2}}=\sqrt 1=1\neq -1=e^{\pi i},$$do I have some error in my thoughts there or does $(a^b)^c=a^{(bc)}$ not hold for complex numbers?
2019/04/21
[ "https://math.stackexchange.com/questions/3195808", "https://math.stackexchange.com", "https://math.stackexchange.com/users/610635/" ]
Actually, that equality *makes no sense* for complex numbers. How do you even *define* $a^b$ if $a$ and $b$ are arbitrary complex numbers?
The complex numbers are just a distraction. We can rewrite your example as $$(-1)^2=1 \implies \big ((-1)^2 \big)^{1/2}=1^{1/2} \implies-1 = \sqrt 1 = 1 \implies -1 =1.$$ Do you see where we made the mistake above?
3,195,808
I've just stumbled across $$\left(e^{2\pi i}\right)^{\frac{1}{2}}=\sqrt 1=1\neq -1=e^{\pi i},$$do I have some error in my thoughts there or does $(a^b)^c=a^{(bc)}$ not hold for complex numbers?
2019/04/21
[ "https://math.stackexchange.com/questions/3195808", "https://math.stackexchange.com", "https://math.stackexchange.com/users/610635/" ]
The complex numbers are just a distraction. We can rewrite your example as $$(-1)^2=1 \implies \big ((-1)^2 \big)^{1/2}=1^{1/2} \implies-1 = \sqrt 1 = 1 \implies -1 =1.$$ Do you see where we made the mistake above?
That's because $$ (e^{2\pi i})^{1/2}\neq e^{\pi i}, $$ even though their square is equal: $$ (e^{2\pi i})= (e^{\pi i})^2. $$ Just like what's in real numbers, every complex number have two square roots. The power $1/2$ placed at the top right corner just gives you one of them. $e^{\pi i}$ is another square root of $1$.
44,303,193
I want to fill this list of MyModel with async method. The async method returns List of MyModel. I want to call MyClass.list in other functions. Code : ``` public static class MyClass { public static List<MyModel> list= await MyHelper.GetCache(); ``` I'm getting an error : > > Severity Code Descr...
2017/06/01
[ "https://Stackoverflow.com/questions/44303193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7739945/" ]
Simple solution is to have a separate macro for each different count. Using 2-level "stringify" macro pattern (read more about it [here](https://stackoverflow.com/questions/16989730/stringification-how-does-it-work)) you can do something like this: ``` #include <iostream> #include <sstream> #define XSTRINGIFY(s) #s ...
I'm not sure if this corresponds to what you're trying to achieve, but I generally use [this technique](https://stackoverflow.com/questions/9907160/how-to-convert-enum-names-to-string-in-c) to generate strings (or other lists generated from the strings like enum elements). E.g., ``` #define FOREACH_APPLY(GENERATE) \ ...
44,303,193
I want to fill this list of MyModel with async method. The async method returns List of MyModel. I want to call MyClass.list in other functions. Code : ``` public static class MyClass { public static List<MyModel> list= await MyHelper.GetCache(); ``` I'm getting an error : > > Severity Code Descr...
2017/06/01
[ "https://Stackoverflow.com/questions/44303193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7739945/" ]
The code below is working for what you've asked for with up to 1024 arguments and **without** using additional stuff like boost. It defines an `EVAL(...)` and also a `MAP(m, first, ...)` macro to do recursion and to use for each iteration the macro `m` with the next parameter `first`. With the use of that, your `MAGIC...
Simple solution is to have a separate macro for each different count. Using 2-level "stringify" macro pattern (read more about it [here](https://stackoverflow.com/questions/16989730/stringification-how-does-it-work)) you can do something like this: ``` #include <iostream> #include <sstream> #define XSTRINGIFY(s) #s ...
44,303,193
I want to fill this list of MyModel with async method. The async method returns List of MyModel. I want to call MyClass.list in other functions. Code : ``` public static class MyClass { public static List<MyModel> list= await MyHelper.GetCache(); ``` I'm getting an error : > > Severity Code Descr...
2017/06/01
[ "https://Stackoverflow.com/questions/44303193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7739945/" ]
Maybe there's a more efficient way, but you can simply use Boost.PP: ``` #define MAGIC_MACRO_ELEM(r, data, i, elem) \ BOOST_PP_COMMA_IF(i) BOOST_PP_STRINGIZE(elem) #define MAGIC_MACRO(...) \ BOOST_PP_SEQ_FOR_EACH_I(MAGIC_MACRO_ELEM, ~, BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))) ``` [See it live on Coliru](http:/...
I'm not sure if this corresponds to what you're trying to achieve, but I generally use [this technique](https://stackoverflow.com/questions/9907160/how-to-convert-enum-names-to-string-in-c) to generate strings (or other lists generated from the strings like enum elements). E.g., ``` #define FOREACH_APPLY(GENERATE) \ ...
44,303,193
I want to fill this list of MyModel with async method. The async method returns List of MyModel. I want to call MyClass.list in other functions. Code : ``` public static class MyClass { public static List<MyModel> list= await MyHelper.GetCache(); ``` I'm getting an error : > > Severity Code Descr...
2017/06/01
[ "https://Stackoverflow.com/questions/44303193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7739945/" ]
The code below is working for what you've asked for with up to 1024 arguments and **without** using additional stuff like boost. It defines an `EVAL(...)` and also a `MAP(m, first, ...)` macro to do recursion and to use for each iteration the macro `m` with the next parameter `first`. With the use of that, your `MAGIC...
Maybe there's a more efficient way, but you can simply use Boost.PP: ``` #define MAGIC_MACRO_ELEM(r, data, i, elem) \ BOOST_PP_COMMA_IF(i) BOOST_PP_STRINGIZE(elem) #define MAGIC_MACRO(...) \ BOOST_PP_SEQ_FOR_EACH_I(MAGIC_MACRO_ELEM, ~, BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))) ``` [See it live on Coliru](http:/...
44,303,193
I want to fill this list of MyModel with async method. The async method returns List of MyModel. I want to call MyClass.list in other functions. Code : ``` public static class MyClass { public static List<MyModel> list= await MyHelper.GetCache(); ``` I'm getting an error : > > Severity Code Descr...
2017/06/01
[ "https://Stackoverflow.com/questions/44303193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7739945/" ]
The code below is working for what you've asked for with up to 1024 arguments and **without** using additional stuff like boost. It defines an `EVAL(...)` and also a `MAP(m, first, ...)` macro to do recursion and to use for each iteration the macro `m` with the next parameter `first`. With the use of that, your `MAGIC...
I'm not sure if this corresponds to what you're trying to achieve, but I generally use [this technique](https://stackoverflow.com/questions/9907160/how-to-convert-enum-names-to-string-in-c) to generate strings (or other lists generated from the strings like enum elements). E.g., ``` #define FOREACH_APPLY(GENERATE) \ ...
32,453,058
We have a requirement in app that we need variable number of decimal places for a field, rule for number of decimal places is returned from web service and user can change that rule from web portal suppose `float number = 125.879601223` what i need, if ``` int numberOfDecimalPlaces = 4 NSString *convertedString = @"...
2015/09/08
[ "https://Stackoverflow.com/questions/32453058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3098402/" ]
``` NSString *patternStr = [NSString stringWithFormat:@"%%0.%df", numberOfDecimalPlaces]; NSString *convertedString = [NSString stringWithFormat:patternStr, number]; ```
You can use: ``` NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; [formatter setMaximumFractionDigits:numberOfDecimalPlaces]; [formatter setRoundingMode: NSNumberFormatterRoundUp]; NSString * convertedString = [formatter stringFromNumber:[NSNu...
32,453,058
We have a requirement in app that we need variable number of decimal places for a field, rule for number of decimal places is returned from web service and user can change that rule from web portal suppose `float number = 125.879601223` what i need, if ``` int numberOfDecimalPlaces = 4 NSString *convertedString = @"...
2015/09/08
[ "https://Stackoverflow.com/questions/32453058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3098402/" ]
``` NSString *patternStr = [NSString stringWithFormat:@"%%0.%df", numberOfDecimalPlaces]; NSString *convertedString = [NSString stringWithFormat:patternStr, number]; ```
Use the `*` modifier in the string format: ``` NSString *convertedString = [NSString stringWithFormat: @"%.*f", numberOfDecimalPlaces, number]; ```
32,453,058
We have a requirement in app that we need variable number of decimal places for a field, rule for number of decimal places is returned from web service and user can change that rule from web portal suppose `float number = 125.879601223` what i need, if ``` int numberOfDecimalPlaces = 4 NSString *convertedString = @"...
2015/09/08
[ "https://Stackoverflow.com/questions/32453058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3098402/" ]
You can use: ``` NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; [formatter setMaximumFractionDigits:numberOfDecimalPlaces]; [formatter setRoundingMode: NSNumberFormatterRoundUp]; NSString * convertedString = [formatter stringFromNumber:[NSNu...
Use the `*` modifier in the string format: ``` NSString *convertedString = [NSString stringWithFormat: @"%.*f", numberOfDecimalPlaces, number]; ```
7,021,608
I folllowed this : <http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup> . But when I try to access <http://localhost:3000/pages/> it returns "Routing Error No route matches "/pages"" This is my routes.rb ``` Sample4App::Application.routes.draw do get "users/new" match '/signup', ...
2011/08/11
[ "https://Stackoverflow.com/questions/7021608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
It seems like your missing the actual route for '/pages/'. Try adding this to your routes.rb ``` match '/pages' => 'pages#home' ```
Add this in roots ``` root :to => 'pages#home' ``` So, you can access <http://localhost:3000> or add ``` match '/pages', :to => 'pages#home' ``` so you can access <http://localhost:3000/pages>
7,021,608
I folllowed this : <http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup> . But when I try to access <http://localhost:3000/pages/> it returns "Routing Error No route matches "/pages"" This is my routes.rb ``` Sample4App::Application.routes.draw do get "users/new" match '/signup', ...
2011/08/11
[ "https://Stackoverflow.com/questions/7021608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
It seems like your missing the actual route for '/pages/'. Try adding this to your routes.rb ``` match '/pages' => 'pages#home' ```
Try this: ``` Sample4App::Application.routes.draw do get "users/new" match 'signup' => 'users#new' match 'contact' => 'pages#contact' match 'about' => 'pages#about' match 'help' => 'pages#help' match 'pages' => 'pages#home' root :to => 'pages#index' end ``` And make sure you have `ind...
7,021,608
I folllowed this : <http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup> . But when I try to access <http://localhost:3000/pages/> it returns "Routing Error No route matches "/pages"" This is my routes.rb ``` Sample4App::Application.routes.draw do get "users/new" match '/signup', ...
2011/08/11
[ "https://Stackoverflow.com/questions/7021608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
It seems like your missing the actual route for '/pages/'. Try adding this to your routes.rb ``` match '/pages' => 'pages#home' ```
try this ``` root :to => 'pages#index' ``` like everyone said earlier but did You deleted *index.html.erb* from */public/* folder? Delete it and try again - this should resolve the problem :)
7,021,608
I folllowed this : <http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup> . But when I try to access <http://localhost:3000/pages/> it returns "Routing Error No route matches "/pages"" This is my routes.rb ``` Sample4App::Application.routes.draw do get "users/new" match '/signup', ...
2011/08/11
[ "https://Stackoverflow.com/questions/7021608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
Try this: ``` Sample4App::Application.routes.draw do get "users/new" match 'signup' => 'users#new' match 'contact' => 'pages#contact' match 'about' => 'pages#about' match 'help' => 'pages#help' match 'pages' => 'pages#home' root :to => 'pages#index' end ``` And make sure you have `ind...
Add this in roots ``` root :to => 'pages#home' ``` So, you can access <http://localhost:3000> or add ``` match '/pages', :to => 'pages#home' ``` so you can access <http://localhost:3000/pages>
7,021,608
I folllowed this : <http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup> . But when I try to access <http://localhost:3000/pages/> it returns "Routing Error No route matches "/pages"" This is my routes.rb ``` Sample4App::Application.routes.draw do get "users/new" match '/signup', ...
2011/08/11
[ "https://Stackoverflow.com/questions/7021608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
Try this: ``` Sample4App::Application.routes.draw do get "users/new" match 'signup' => 'users#new' match 'contact' => 'pages#contact' match 'about' => 'pages#about' match 'help' => 'pages#help' match 'pages' => 'pages#home' root :to => 'pages#index' end ``` And make sure you have `ind...
try this ``` root :to => 'pages#index' ``` like everyone said earlier but did You deleted *index.html.erb* from */public/* folder? Delete it and try again - this should resolve the problem :)
16,653,081
I'm running Solaris on my machine and I would need to install the Date::Calc perl module in order for one of my scripts to work. When I run the following command: ``` sudo perl -MCPAN -e 'install Date::Calc' ``` I get the following error: ``` Tests succeeded but one dependency not OK (Bit::Vector) STBEY/Date-Cal...
2013/05/20
[ "https://Stackoverflow.com/questions/16653081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1103412/" ]
The error means that [Bit::Vector](https://metacpan.org/module/Bit%3a%3aVector) (a dependency of Date::Calc) failed to install for some reason. Bit::Vector requires compiling C code, which means your CPAN configuration will need access to the C compiler and libraries (and headers) that were used to build your perl. F...
So it turns out that the only option is to install the [Oracle Solaris Studio](http://www.oracle.com/technetwork/server-storage/solarisstudio/overview/index.html) prior to installation of new perl modules which need to compile C code. From [a related discussion at Oracle Solaris forum](https://forums.oracle.com/forums...
59,332
Not a date comes to your mind at first, but rather a specific date in time: > > This date's human readable form is written as **dd/mm/yyyy**, > > and when converted to a Unix Timestamp (epoch time), it's **ddmmyyyy00**. > > > * dd is the two-digit day of the month * mm is the two-digit month month of the ye...
2018/01/16
[ "https://puzzling.stackexchange.com/questions/59332", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10499/" ]
Is this what you're looking for? > > 0705199200 converts to dd/mm/yyyy 07/05/1992 (00:40) > > >
The closest match I have found is > > 07/05/1992 > > > which has a timestamp of > > 705196800 > > > which is only 2400 away from what it should be. I used a small javascript program for it. ``` console.log("start"); var best = 1e9; for( var y=1970; y<2069; y++ ){ for( var m=1; m<=12; m++ ){...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
Your code works, but in `main`, the return value of `method1` is ignored. And calling `method1` in `method2` is unecessary. You can let `method2` accept parameter `String[] strings`: ``` public static void method2(String[] strings) { for (String str : strings) System.out.println(str); } ``` and pass th...
Proper way of doing the above is like below.You have to take the return value of the method one and insert it into method two as a parameter. ``` public class Hihihi { public static void main(String args[]) { String[] test=method1(); method2(test); } ...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
Your code works, but in `main`, the return value of `method1` is ignored. And calling `method1` in `method2` is unecessary. You can let `method2` accept parameter `String[] strings`: ``` public static void method2(String[] strings) { for (String str : strings) System.out.println(str); } ``` and pass th...
You are almost there: the return of your `method1()` should be used in the first call (you are actually ignoring it), and you have to use that return value (I've made some notes in the code aswell): ``` public static void main(String args[]) { String[] result = method1(); //TAKE THE VALUE HERE method2(result);//p...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
At first, correct your `method2` It has to be able to accept an array of `String` elements as parameter: ``` public static void method2(String[] test) { // this line is not needed -> String[] test = method1(); for(String str : test) System.out.println(str); } ``` This way, you actually pass ...
Your code works, but in `main`, the return value of `method1` is ignored. And calling `method1` in `method2` is unecessary. You can let `method2` accept parameter `String[] strings`: ``` public static void method2(String[] strings) { for (String str : strings) System.out.println(str); } ``` and pass th...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
At first, correct your `method2` It has to be able to accept an array of `String` elements as parameter: ``` public static void method2(String[] test) { // this line is not needed -> String[] test = method1(); for(String str : test) System.out.println(str); } ``` This way, you actually pass ...
Proper way of doing the above is like below.You have to take the return value of the method one and insert it into method two as a parameter. ``` public class Hihihi { public static void main(String args[]) { String[] test=method1(); method2(test); } ...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
If you want that the data "flows" trough main as you should do this: ``` public static void main(String args[]){ String[] arr = method1(); method2(arr); System.exit(0); } public static String[] method1(){ String[] xs = new String[] {"sunshine","road","73","11"}; String[] test = new Str...
Proper way of doing the above is like below.You have to take the return value of the method one and insert it into method two as a parameter. ``` public class Hihihi { public static void main(String args[]) { String[] test=method1(); method2(test); } ...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
At first, correct your `method2` It has to be able to accept an array of `String` elements as parameter: ``` public static void method2(String[] test) { // this line is not needed -> String[] test = method1(); for(String str : test) System.out.println(str); } ``` This way, you actually pass ...
You are almost there: the return of your `method1()` should be used in the first call (you are actually ignoring it), and you have to use that return value (I've made some notes in the code aswell): ``` public static void main(String args[]) { String[] result = method1(); //TAKE THE VALUE HERE method2(result);//p...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
If you want that the data "flows" trough main as you should do this: ``` public static void main(String args[]){ String[] arr = method1(); method2(arr); System.exit(0); } public static String[] method1(){ String[] xs = new String[] {"sunshine","road","73","11"}; String[] test = new Str...
You are almost there: the return of your `method1()` should be used in the first call (you are actually ignoring it), and you have to use that return value (I've made some notes in the code aswell): ``` public static void main(String args[]) { String[] result = method1(); //TAKE THE VALUE HERE method2(result);//p...
52,094,393
When to examine the `InnerException` property of the `Exception` class and its derivatives? Microsoft's "Best practices for exceptions" doesn't provide any advise on when to examine for inner exceptions. Should I do it only when exceptions are rethrown and caught in my code? Should I do it always, even when I enclose i...
2018/08/30
[ "https://Stackoverflow.com/questions/52094393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9752275/" ]
At first, correct your `method2` It has to be able to accept an array of `String` elements as parameter: ``` public static void method2(String[] test) { // this line is not needed -> String[] test = method1(); for(String str : test) System.out.println(str); } ``` This way, you actually pass ...
If you want that the data "flows" trough main as you should do this: ``` public static void main(String args[]){ String[] arr = method1(); method2(arr); System.exit(0); } public static String[] method1(){ String[] xs = new String[] {"sunshine","road","73","11"}; String[] test = new Str...
4,170,389
Recently I came across this summation: $$\sum\_{k=0}^n\cos\Bigl(k\frac{2\pi}{n}\Bigr)$$ when I was trying to evaluate the following summation $$\sum\_{k=0}^{n} z^k+z^{-k}$$ where $z \in \mathbb{C}, z=\operatorname{cis}(\frac{2\pi}{n})$ But I got stuck... Could anyone give me a tip ? Thanks in advance!
2021/06/11
[ "https://math.stackexchange.com/questions/4170389", "https://math.stackexchange.com", "https://math.stackexchange.com/users/852800/" ]
$\sum\limits\_{k=0}^n z^k=\frac{1-z^{n+1}}{1-z}$ $\sum\limits\_{k=0}^n z^{-k}=z\frac{1-z^{-(n+1)}}{z-1}$ Is that where you started.
**Hint**: $\cos\dfrac{2k\pi}n$ is the real part of $\:\Bigl(\mathrm e^{\tfrac{2i\pi}n}\Bigr)^{\!k}$.