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
1,164,033
This code works fine: ``` import MySQLdb db = MySQLdb.connect("localhost", "root", "","bullsorbit") cursor = db.cursor() cursor.execute("Select * from table where conditions'") numrows = int(cursor.rowcount) print 'Total number of Pages : %d ' % numrows ``` but if I give my IP address ``` db = MySQLdb.conn...
2009/07/22
[ "https://Stackoverflow.com/questions/1164033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Code 2003 is a [standard MySQL client error](http://dev.mysql.com/doc/refman/5.1/en/error-messages-client.html): > > Error: 2003 (CR\_CONN\_HOST\_ERROR) Message: Can't connect to MySQL server on '%s' (%d) > > > I'd guess that your user is not allowed to connect to the MySQL server using an iP-address. What happen...
For the `2003` error, another possibility is that too many connections are being attempted in too short of time. I noticed this same behavior when I had `127.0.0.1` as my connect string. First I replaced it with `localhost` which got me further but still the same `2003` error. Then I saw that if I scaled back the numbe...
51,315,125
I was trying to connect to my local database through the php code but I get this error: > > Syntax error, unexpected '$result' (T\_VARIABLE), expecting ',' or ')' > > > and I don't understand where's the problem. Here's my code: ``` <?php $hostname = "localhost"; $username = "root"; $password = ...
2018/07/12
[ "https://Stackoverflow.com/questions/51315125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8144155/" ]
Your problem is in this line: ``` echo("Errore aggiunta news: " . mysqli_error(mysqli $result)); ``` It should be: ``` echo("Errore aggiunta news: " . mysqli_error($result)); ```
You should pass dbname too in `mysqli_connect` ``` $dbConnected = @mysqli_connect($hostname, $username, $password, $databaseName); ``` and to execute query. ``` $result = $dbConnected->query("select * from tablename"); ``` Further your query should be: ``` $query = "INSERT INTO news(titolo, testo, data) ...
6,773,302
I have a templated class with an templated member function ``` template<class T> class A { public: template<class CT> CT function(); }; ``` Now I want to specialize the templated member function in 2 ways. First for having the same type as the class: ``` template<class T> template<> // Line gcc gives an er...
2011/07/21
[ "https://Stackoverflow.com/questions/6773302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491605/" ]
Yes, this is the problem: ``` error: enclosing class templates are not explicitly specialized ``` You cannot specialize a member without also specializing the class. What you **can** do is put the code from `function` in a separate class and specialize that, much like basic\_string depends on a separate char\_trai...
You can use overload, if you change the implementation. ``` template <typename T> class Foo { public: template <typename CT> CT function() { return helper((CT*)0); } private: template <typename CT> CT helper(CT*); T helper(T*) { return (T)0.0; } bool helper(bool*) { return false; } }; ``` Simple and e...
68,502,921
I am a little stuck with the following problem: I want to take the following dictionaries: ``` gasDict ={'Chair': {'CO2': 0.4, 'Methane': 0.5, 'Other': 0.6},'House': {'CO2': 0.4, 'Methane': 0.2, 'Other': 0.3}} ``` ``` purchaseDict = {'Bob': ['Chair', 'House'], 'Jim': ['Chair']} ``` And create the following datafr...
2021/07/23
[ "https://Stackoverflow.com/questions/68502921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16505659/" ]
Try: ```py gasDict = { "Chair": {"CO2": 0.4, "Methane": 0.5, "Other": 0.6}, "House": {"CO2": 0.4, "Methane": 0.2, "Other": 0.3}, } purchaseDict = {"Bob": ["Chair", "House"], "Jim": ["Chair"]} df = pd.DataFrame( {"Name": k, "Purchase": vv, **gasDict[vv]} for k, v in purchaseDict.items() for vv in ...
We can use [`DataFrame.from_dict`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.from_dict.html) to convert `gasDict` and a list comprehension for `purchaseDict`. Then [`join`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.join.html#pandas-dataframe-join) them together: ``` gasDict = {'...
68,502,921
I am a little stuck with the following problem: I want to take the following dictionaries: ``` gasDict ={'Chair': {'CO2': 0.4, 'Methane': 0.5, 'Other': 0.6},'House': {'CO2': 0.4, 'Methane': 0.2, 'Other': 0.3}} ``` ``` purchaseDict = {'Bob': ['Chair', 'House'], 'Jim': ['Chair']} ``` And create the following datafr...
2021/07/23
[ "https://Stackoverflow.com/questions/68502921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16505659/" ]
We can use [`DataFrame.from_dict`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.from_dict.html) to convert `gasDict` and a list comprehension for `purchaseDict`. Then [`join`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.join.html#pandas-dataframe-join) them together: ``` gasDict = {'...
An alternative based off of @Henry Ecker's answer. Instead of using a comprehension, you can also construct a `DataFrame` and use `.explode` ```py gasDict = { "Chair": {"CO2": 0.4, "Methane": 0.5, "Other": 0.6}, "House": {"CO2": 0.4, "Methane": 0.2, "Other": 0.3}, } purchaseDict = {"Bob": ["Chair", "House"], ...
68,502,921
I am a little stuck with the following problem: I want to take the following dictionaries: ``` gasDict ={'Chair': {'CO2': 0.4, 'Methane': 0.5, 'Other': 0.6},'House': {'CO2': 0.4, 'Methane': 0.2, 'Other': 0.3}} ``` ``` purchaseDict = {'Bob': ['Chair', 'House'], 'Jim': ['Chair']} ``` And create the following datafr...
2021/07/23
[ "https://Stackoverflow.com/questions/68502921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16505659/" ]
Try: ```py gasDict = { "Chair": {"CO2": 0.4, "Methane": 0.5, "Other": 0.6}, "House": {"CO2": 0.4, "Methane": 0.2, "Other": 0.3}, } purchaseDict = {"Bob": ["Chair", "House"], "Jim": ["Chair"]} df = pd.DataFrame( {"Name": k, "Purchase": vv, **gasDict[vv]} for k, v in purchaseDict.items() for vv in ...
An alternative based off of @Henry Ecker's answer. Instead of using a comprehension, you can also construct a `DataFrame` and use `.explode` ```py gasDict = { "Chair": {"CO2": 0.4, "Methane": 0.5, "Other": 0.6}, "House": {"CO2": 0.4, "Methane": 0.2, "Other": 0.3}, } purchaseDict = {"Bob": ["Chair", "House"], ...
121,185
While developing more and more customized Wordpress themes, I began adding more custom functions to my theme's functions.php file. While I try to make their names to be self-explanatory, I think this is not enough. Considering that you might not be the only web developer working on a theme, or that there might be some...
2013/11/04
[ "https://wordpress.stackexchange.com/questions/121185", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/27835/" ]
I almost used the same convention as @GhostToas but to me I usually use classes to minimize conflict. For internal or company project: `class MyCompany_Classname {}` For Client specific project: `class ClientProject_Classname {}` Using a class will absolutely help you avoid conflicts and thus, you can name your functio...
As I work for a company, I typically prepend my function names with our company nickname, for functions that tend to stick around. Example: `mycompany_custom_excerpt()`. For project-specific functions, I tend to use a nickname that represents the project (such as the theme's name). Example: `client_related_physicians...
36,380,250
I have to handle some strings, I should put them **N** positions to left to organize the string. Here's my code for while: ``` private String toLeft() { String word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // Example byte lpad = 2; // Example StringBuilder sb = new StringBuilder(); for (int i = 0; i < word.len...
2016/04/03
[ "https://Stackoverflow.com/questions/36380250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4911842/" ]
I think you have misunderstood what your (homework?) requirements are asking you to do. Lets look at your examples: > > VQREQFGT // 2 positions to left == TOPCODER > > > Makes sense. Each character in the output is two characters before the corresponding input. But read on ... > > ABCDEFGHIJKLMNOPQRSTUVWXYZ // ...
> > what can I do to prevent it? > > > You make it wrap around. If you want a value to go from 10 to 19 and then start at 10 again, in each iteration you subtract 10, increase by one, take the remainder of that divided by 20, and add 10 again. Only here, 10 is `'A'`, 19 is `Z`, and instead of increasing by one...
36,380,250
I have to handle some strings, I should put them **N** positions to left to organize the string. Here's my code for while: ``` private String toLeft() { String word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // Example byte lpad = 2; // Example StringBuilder sb = new StringBuilder(); for (int i = 0; i < word.len...
2016/04/03
[ "https://Stackoverflow.com/questions/36380250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4911842/" ]
I think you have misunderstood what your (homework?) requirements are asking you to do. Lets look at your examples: > > VQREQFGT // 2 positions to left == TOPCODER > > > Makes sense. Each character in the output is two characters before the corresponding input. But read on ... > > ABCDEFGHIJKLMNOPQRSTUVWXYZ // ...
Please read [@StephenC's excellent answer](https://stackoverflow.com/a/36380473/5221149) about wrap-around. In short, you don't *shift* left, you *rotate* left, such that `B` → `A` → `Z` → `Y`. When you rotate, you wrap around to the other end. So, for letters you want `A`-`Z` to rotate. The easiest rotation method is...
21,673,786
I already tried every version of this script found here and there, but it's still not working. I have a controller doing certain actions after saving an order in the back-end. One of this action is to produce automatically an invoice on certain conditions. Usual redirect sends me back to the order view: I'd like to go ...
2014/02/10
[ "https://Stackoverflow.com/questions/21673786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2182672/" ]
[mlpack](http://www.mlpack.org/index.html) appears to have Lagrange multipliers, see [the docs](http://www.mlpack.org/doxygen.php?doc=classmlpack_1_1optimization_1_1AugLagrangianFunction.html). These allow you to solve equations with constraints.
you can use [NLopt](http://ab-initio.mit.edu/wiki/index.php/NLopt) library for optimization and construct your objective function as a computation of squered innovations (probably using COBYLA algorithm). You can use also QuantLib's [General Linear Leaast Squeres](http://quantlib.org/reference/class_quant_lib_1_1_gene...
21,296,211
I have `MyPanel` of size (1200,800) which is embedded in a parent `MainPanel` (whose size can change with the size of the `MainFrame`) : ``` import wx class MyPanel(wx.Panel): # panel embedded in the main panel def __init__(self, parent): wx.Panel.__init__(self, parent, -1, size=(1200,800)) size...
2014/01/22
[ "https://Stackoverflow.com/questions/21296211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422096/" ]
Just apply my previous answer to the panel that you want to maintain the aspect ration on. Not a 100% clear on the exact behavior you want but this should get you close enough. ``` import wx class MyPanel(wx.Panel): # panel embedded in the main panel def __init__(self, parent): wx.Panel.__in...
You need to be using sizers for this type of thing, and if you are then using [`wx.SHAPED`](http://www.wxpython.org/docs/api/wx.Sizer-class.html#Add) in the `sizer.Add` flags will maintain the aspect ratio as the size is changed.
236,932
I'm looking for some feedback on this code I wrote tackling a general solution to the age old "Add 2 numbers represented by Linked Lists". This specific one aims to be able to sum any given number of linked lists. Ofcourse, the input linked lists must contain the number in reverse order. ``` #include<stdio.h> #includ...
2020/02/09
[ "https://codereview.stackexchange.com/questions/236932", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/218057/" ]
The answer uses this structure declared in the program: ``` typedef struct ListNode { // Basic Node data structure of a Linked List int val; struct ListNode* next; } node_t; ``` Symbolic Constants for Return From `main()` and `exit()` -------------------------------------------------------- The program ...
There's enough to review in just the `appendNode()` function; much of this applies to the rest of the code, too. --- Don't cast the result of `malloc()` like this: > > > ``` > node = (node_t*)malloc(sizeof(node_t)); > > ``` > > If declared properly, `malloc()` returns a `void*`; that's assignable to any pointe...
236,932
I'm looking for some feedback on this code I wrote tackling a general solution to the age old "Add 2 numbers represented by Linked Lists". This specific one aims to be able to sum any given number of linked lists. Ofcourse, the input linked lists must contain the number in reverse order. ``` #include<stdio.h> #includ...
2020/02/09
[ "https://codereview.stackexchange.com/questions/236932", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/218057/" ]
The answer uses this structure declared in the program: ``` typedef struct ListNode { // Basic Node data structure of a Linked List int val; struct ListNode* next; } node_t; ``` Symbolic Constants for Return From `main()` and `exit()` -------------------------------------------------------- The program ...
The description of `resvalAppend()` is beside the point to the point of being misleading: * there is no source code entity `resval` * there is *one* recursive call, at most (serving no purpose I can discern) * `overflow` no longer is a global variable * *added to the result Linked List* better be *appended* to avo...
236,932
I'm looking for some feedback on this code I wrote tackling a general solution to the age old "Add 2 numbers represented by Linked Lists". This specific one aims to be able to sum any given number of linked lists. Ofcourse, the input linked lists must contain the number in reverse order. ``` #include<stdio.h> #includ...
2020/02/09
[ "https://codereview.stackexchange.com/questions/236932", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/218057/" ]
The answer uses this structure declared in the program: ``` typedef struct ListNode { // Basic Node data structure of a Linked List int val; struct ListNode* next; } node_t; ``` Symbolic Constants for Return From `main()` and `exit()` -------------------------------------------------------- The program ...
> > feedback on speed and optimization > > > **O(n) to O(1).** Consider changing `appendNode()` from O(n) to O(1). Rather than have a link-list point to the head, let the LL point to the tail **and** the tail point to the head. To append to the end of the list or to the front is a similar O(1) operation. ``` /...
15,481,520
I'm developing an app and I have a sing-in/sign-out process. When the user clicks in the sign-out button I want the user to be taken to the home screen. To do this I created the following method in the app delegate: ``` - (void) restartAppWhenLogOut{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScr...
2013/03/18
[ "https://Stackoverflow.com/questions/15481520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973242/" ]
I tried to figure out the error..but didn't find out..so, i suggest you try to setting up the navigation bar manually..
Creating a new window is forbidden: ["To change the content your app displays, you can change the window’s root view; you don’t create a new window."](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html) UIKit isn't intended to work tha...
15,481,520
I'm developing an app and I have a sing-in/sign-out process. When the user clicks in the sign-out button I want the user to be taken to the home screen. To do this I created the following method in the app delegate: ``` - (void) restartAppWhenLogOut{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScr...
2013/03/18
[ "https://Stackoverflow.com/questions/15481520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/973242/" ]
Following `json` advice this is what I did in the `viewDidLoad`of the view controllor with the UINavigationBar problem: ``` [self.navigationController.navigationBar setFrame:CGRectMake(0, 20, 320, 44)]; ``` I hope it helps!
Creating a new window is forbidden: ["To change the content your app displays, you can change the window’s root view; you don’t create a new window."](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html) UIKit isn't intended to work tha...
66,068,149
I just want to validate if the string that i received is a valid date using date-fns. I gonna receive a date like this '29/10/1989', BR date. I want to transform it into 29-10-1989 and check if its valid. Anyone can help me with this? ``` const parsedDate = parseISO('29/10/1989') ``` this code above doesnt work, i g...
2021/02/05
[ "https://Stackoverflow.com/questions/66068149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10184333/" ]
Try `parse` with `locale` options like this: ```js import { parse, isValid, format } from 'date-fns'; import { enGB } from 'date-fns/locale'; const parsedDate = parse('29/10/1989', 'P', new Date(), { locale: enGB }); const isValidDate = isValid(parsedDate); const formattedDate = format(parsedDate, 'dd-MM-yyyy'); ```
I came up with this (based on Anatoly answer): ``` import { parse, isValid, format } from 'date-fns'; import { enGB } from 'date-fns/locale'; function isValidDate(day, month, year) { const parsed = parse(`${day}/${month}/${year}`, 'P', new Date(), { locale: enGB }) return isValid(parsed) } console.log(isValidDat...
42,942,808
There is a android library. workflow like that: > > A1->A2-A3->Library activity->A3 > > > I need to hide library activity when user click physical `back button`. Also, the library activity saved some data, so that I cannot `destroy` or `finish()` the library activity. > > A1->A2->A3->lib--->return to previous A...
2017/03/22
[ "https://Stackoverflow.com/questions/42942808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724918/" ]
You should override `onBackPressed` method in your activity like this: ``` @Override public void onBackPressed() { super.onBackPressed(); //change your View from A3 to A2 } ``` You can save data using `SharedPreferences`.
Just make library activity `android:noHistory="true"` in manifest. And save data you require some where else.
42,942,808
There is a android library. workflow like that: > > A1->A2-A3->Library activity->A3 > > > I need to hide library activity when user click physical `back button`. Also, the library activity saved some data, so that I cannot `destroy` or `finish()` the library activity. > > A1->A2->A3->lib--->return to previous A...
2017/03/22
[ "https://Stackoverflow.com/questions/42942808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7724918/" ]
If currently visible activity is from the library, and you can not edit the code for it, then it is not possible to handle the backpress of the activity. However, If you are calling this library activity with an `Intent` from your Activity, What you can do is, Write a class that `extends LibraryActivity` and call th...
Just make library activity `android:noHistory="true"` in manifest. And save data you require some where else.
29,101,089
i have browsed all over the internet and right now i stuck in generating the Shared library. First Java File : ``` import java.io.*; public class JavaToC { public native void helloC(); static { System.loadLibrary("HelloWorld"); } public static void main(String[] args) { new JavaToC().helloC(); }} ``` Afte...
2015/03/17
[ "https://Stackoverflow.com/questions/29101089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3753081/" ]
You also need to add 1 to the month, as `localtime` returns it zero-based, and you should use format specifiers in the `printf` so that the field sizes are constant. ``` use strict; use warnings; my ($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime; $wday = qw( Sun Mon Tue Wed Thu Fri Sat )[$wday]; $year += ...
`time()` will give you UTC. `localtime` will adjust based on `$ENV{'TZ'}` - the only thing I can think of that might be causing your problem, is that if this isn't set correctly. Try printing it as part of your script. [`Time::Piece`](http://perldoc.perl.org/Time/Piece.html) is a good module for this: ``` $t->tzof...
3,601
I was wondering if I'll have the option to add something like `\listoffootnotes` in my document like I can use `\listoffigures` or tables... Anyone knows how?
2010/09/30
[ "https://tex.stackexchange.com/questions/3601", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/1331/" ]
I wouldn't recommend a `\listoffootnotes` command for this — instead, you should define a new command like `\externallink{...}` which then populates a `\listoflinks` command. Then write ``` \footnote{\externallink{{...}} ``` Or something along those lines. Anyway, to create new "List of..." lists, you can use the to...
From your clarification, this is how I would try to do it: Use two separate bibliographies, with the help of the [`multibib`](https://ctan.org/pkg/multibib?lang=en) package and give each an appropriate name. Set the first one for the books and articles, and the second one for the URLs (that is, your footnotes). See [t...
50,780,806
currently, I'm trying doing a code to add a new student to the database table. but when one of the textboxes is not filled when pressing submit, the solution crashes. please show me a way to write my code: ``` Imports System.Data.OleDb Public Class AddNewStudent Dim cnnOLEDB As New OleDbConnection Dim cmdInser...
2018/06/10
[ "https://Stackoverflow.com/questions/50780806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9920142/" ]
You can set the `inFocusDisplaying` method in the init call to `None` This will prevent all notifications from showing when the app is open. For Ionic, documentation on this is here: <https://documentation.onesignal.com/docs/cordova-sdk#section--infocusdisplaying-> OneSignal does not have a way to stop notifications...
**for who faced this issue** the good hack to disable notification in specific page ```js // set it to None on page init ngOnInit(){ this.oneSignal.startInit("APP ID", "SENDER ID"); this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.None); this.oneSignal.endInit(); } // and when this page a...
13,000,492
I'm trying to implement a logic where I'm trying to subtract each element of an array from every other element of the array and then find the minimum difference of the result. eg : a=[10,7,3,6] so I subtract 10 from every other element of the array to begin with (result will be 3,7,4) then move over to the next eleme...
2012/10/21
[ "https://Stackoverflow.com/questions/13000492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1763441/" ]
You might want to consider a different algorithm for finding the closest pair. Your current algorithm compares every pair of values, when you really only need to compare each value to the next biggest value. You can do that by doing something like: 1) sort your array `a` 2) Compare neighbors in `a` to find the smallest...
Here's a somewhat dense one-liner that doesn't use NumPy: ``` >>> from itertools import combinations >>> a = [10, 7, 3, 6] >>> closest_pair = min((abs(x-y), (i, j)) for (i,x), (j, y) in combinations(enumerate(a), 2))[1] >>> closest_pair (1, 3) ``` Here's how it works... `combinations` is used to create all the pair...
203,931
I have a Centos VM with Samba server and a user on that machine called smbuser in group smbuser. I can connect to my samba share /home/smbuser from my Windows 7 PC no problem. Also on the Centos VM I have another folder /home/ftpuser owned by ftpuser:ftpuser. I set up another samba share to allow smbuser access to this...
2010/11/19
[ "https://serverfault.com/questions/203931", "https://serverfault.com", "https://serverfault.com/users/58788/" ]
<http://www.unixref.com/guides/chmodGuide.html> they also have a nice automatic calculator at the bottom!
Try adding: ``` valid users = @commongroup force group = commongroup create mask = 0775 directory mask = 0775 ``` To your share in your smb.conf file where "commongroup" is a group name both belong to. For the above to work both users should be in a common group, and you might need to chown the folders that already ...
46,769,218
I have a specific problem regarding `Scanner` and its way of doing input from `System.in`. **What I want to do:** I need to read a single input given from `System.in`. The problem is that this input can have more than one line (the input can have many `\n` characters). **What I tried:** The obvious thing I tried i...
2017/10/16
[ "https://Stackoverflow.com/questions/46769218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4359296/" ]
If you want to read all input, on multiple lines, into a list of strings, one element per input line, then the user will have to indicate when the input has ended. This is often done by using the End-of-File character: on the Windows Command Prompt, it's Ctrl-Z, and on Linux, OS X and the IntelliJ IDE input window on a...
If you press Command + D on OS X or Control + D on Windows, you will insert an end of line character. When the scanner reaches an end of line character, `hasNextLine` will return false and the loop will terminate. So remove this: ``` if(line.isEmpty()){ break; } ``` and type an end of line character after your...
46,769,218
I have a specific problem regarding `Scanner` and its way of doing input from `System.in`. **What I want to do:** I need to read a single input given from `System.in`. The problem is that this input can have more than one line (the input can have many `\n` characters). **What I tried:** The obvious thing I tried i...
2017/10/16
[ "https://Stackoverflow.com/questions/46769218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4359296/" ]
If you want to read all input, on multiple lines, into a list of strings, one element per input line, then the user will have to indicate when the input has ended. This is often done by using the End-of-File character: on the Windows Command Prompt, it's Ctrl-Z, and on Linux, OS X and the IntelliJ IDE input window on a...
Use this type for reading ``` String read = ""; Scanner sc = new Scanner(System.in); String line; while (sc.hasNextLine()) { line = sc.nextLine(); if (line.isEmpty()) { break; } read += line + "\n"; } System.out.println(read); ``` Here, first we check i...
32,667,891
I have a string in my `string.xml`: ``` <string name="date_time_short">%2$d.%2$d. %1$s %2$d:%2$d</string> ``` Now i want to set the values from code: ``` String.format(context.getResources().getString(R.string.date_time_short), day, month, at, hour, minute); ``` But i get the error: ``` Wrong argument count, for...
2015/09/19
[ "https://Stackoverflow.com/questions/32667891", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2391849/" ]
The number in %1$s for example indicates the index in your Object... argument. So in your example, the correct definition of the string would be : ``` <string name="date_time_short">%1$d.%2$d. %3$s %4$d:%5$d</string> ```
try this `<string name="date_time_short">%1$s.%2$s. %3$s %4$s:%5$s</string>`
35,424,703
can someone please give me an idea on how will i set focus on my textbox when I click the radiobutton assigned to it? Im using angular js. Thanks for any idea
2016/02/16
[ "https://Stackoverflow.com/questions/35424703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5501017/" ]
I created [example](http://plnkr.co/edit/rpKlwheIJ4GFf07Fnpc2?p=preview) for you. **HTML:** ``` <body ng-app="scopeExample"> <div ng-controller="MyController"> <div ng-repeat='item in mas'> <input type="radio" name='somename' ng-model="item.select" value="true" ng-click='clear(item)'> <input type='t...
I will provide you pseudo code which you can alter on the basis of your needs. For now, the code has one radio button which when selected will focus on the input element. However, you can achieve those on list, on checkbox as per your need. HTML: ``` <div ng-controller="MyCtrl"> <input type="radio" ng-model="focu...
4,226,811
Learning about SOA. Is it mostly decoupling by way of web services, one service provides web services to another, thereby staying decoupled and encapsulated? Thanks. edit: that and maybe a good front end to them like some MVC design?
2010/11/19
[ "https://Stackoverflow.com/questions/4226811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
SOA is commonly implemented using web services but can be implemented using any method of decoupling the service implementation from the interface. These are then often presented to the business in a directory when apps can request details for any service provision that offers the desired service criteria. MVC is a pa...
Here's an answer I provided to another question a while ago which may help with SOA principles: [Rebuild N-tier app into Service-Oriented Architecture (SOA)?](https://stackoverflow.com/questions/2349352/rebuild-n-tier-app-into-service-oriented-architecture-soa/2366496#2366496) Also the following is an intro to SOA: <h...
4,226,811
Learning about SOA. Is it mostly decoupling by way of web services, one service provides web services to another, thereby staying decoupled and encapsulated? Thanks. edit: that and maybe a good front end to them like some MVC design?
2010/11/19
[ "https://Stackoverflow.com/questions/4226811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
Here's an answer I provided to another question a while ago which may help with SOA principles: [Rebuild N-tier app into Service-Oriented Architecture (SOA)?](https://stackoverflow.com/questions/2349352/rebuild-n-tier-app-into-service-oriented-architecture-soa/2366496#2366496) Also the following is an intro to SOA: <h...
Here is a good selection of links that challenge the idea that SOA is only about web services, it explores the idea that every class in the application is a service and we can use many different transports (web, tcp, queues) within our SOA. SOA is the methodology you use to build a service orientated application. Here...
4,226,811
Learning about SOA. Is it mostly decoupling by way of web services, one service provides web services to another, thereby staying decoupled and encapsulated? Thanks. edit: that and maybe a good front end to them like some MVC design?
2010/11/19
[ "https://Stackoverflow.com/questions/4226811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
Here's an answer I provided to another question a while ago which may help with SOA principles: [Rebuild N-tier app into Service-Oriented Architecture (SOA)?](https://stackoverflow.com/questions/2349352/rebuild-n-tier-app-into-service-oriented-architecture-soa/2366496#2366496) Also the following is an intro to SOA: <h...
Despite the (incorrect) selected answer I have to state that SOA has nothing to do with web services. The "service" term is so overloaded in English, so people are getting confused sometimes. SOA is an architectural style, a set of guidances and principles that help us model our systems as "systems which consist of ot...
4,226,811
Learning about SOA. Is it mostly decoupling by way of web services, one service provides web services to another, thereby staying decoupled and encapsulated? Thanks. edit: that and maybe a good front end to them like some MVC design?
2010/11/19
[ "https://Stackoverflow.com/questions/4226811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
SOA is commonly implemented using web services but can be implemented using any method of decoupling the service implementation from the interface. These are then often presented to the business in a directory when apps can request details for any service provision that offers the desired service criteria. MVC is a pa...
Here is a good selection of links that challenge the idea that SOA is only about web services, it explores the idea that every class in the application is a service and we can use many different transports (web, tcp, queues) within our SOA. SOA is the methodology you use to build a service orientated application. Here...
4,226,811
Learning about SOA. Is it mostly decoupling by way of web services, one service provides web services to another, thereby staying decoupled and encapsulated? Thanks. edit: that and maybe a good front end to them like some MVC design?
2010/11/19
[ "https://Stackoverflow.com/questions/4226811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28045/" ]
SOA is commonly implemented using web services but can be implemented using any method of decoupling the service implementation from the interface. These are then often presented to the business in a directory when apps can request details for any service provision that offers the desired service criteria. MVC is a pa...
Despite the (incorrect) selected answer I have to state that SOA has nothing to do with web services. The "service" term is so overloaded in English, so people are getting confused sometimes. SOA is an architectural style, a set of guidances and principles that help us model our systems as "systems which consist of ot...
1,780,708
I'm working on a login script, and I want to send the input to a PHP script, check it, and then do something if it matches the one I have in the config.php file. pseudo php code (admin\_login.php) ``` <?php require("../config.php"); if($_POST['password'] == $password) { $showLoginPage = true; } else { ...
2009/11/23
[ "https://Stackoverflow.com/questions/1780708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/214225/" ]
Either just modify your php script to return a http status code of 404 when login fails. This way your callback function won't fire and you remain on the login page. But you would need to come up with something to tell the user the login failed. Or you consider using the `$.ajax()` call instead of `$.post()`. Now you ...
Export JSON from your PHP code, and do whatever you like with the objects you get from this JSON :)
42,575,577
If first conversion is failed, then how to do another conversion? I have a trigger that after data being insert to table, trigger will take the Hex data stored in the column, do conversion and update on another column (same row). Currently the information from our client is, the programmer might send custom Hex data....
2017/03/03
[ "https://Stackoverflow.com/questions/42575577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3436326/" ]
Check if first two characters are **0x** and then do conversion. ``` SELECT CASE WHEN LEFT([HexData], 2) = '0x' THEN CONVERT(varchar(max), CONVERT(varbinary(MAX), [HexData], 1)) ELSE CONVERT(varchar(max), CONVERT(varbinary(MAX), [HexData], 2)) END FROM tableName ```
Use [TRY\_CONVERT](https://msdn.microsoft.com/en-us/library/hh230993.aspx) in SQL Server 2012+ ``` DECLARE @Hexdata varchar(200) = '0x68656c6c6f' IF TRY_CONVERT(varbinary(MAX), @Hexdata, 2) IS NOT NULL SELECT TRY_CONVERT(varchar(max),CONVERT(varbinary(MAX), @Hexdata, 2)); ELSE IF TRY_CONVERT(varbinary(MAX), @Hexd...
42,575,577
If first conversion is failed, then how to do another conversion? I have a trigger that after data being insert to table, trigger will take the Hex data stored in the column, do conversion and update on another column (same row). Currently the information from our client is, the programmer might send custom Hex data....
2017/03/03
[ "https://Stackoverflow.com/questions/42575577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3436326/" ]
Not sure about the performance, but `REPLACE` will have shorter syntax. Something like above: ``` SELECT CONVERT(varchar(max), CONVERT(varbinary(MAX), REPLACE([HexData], '0x', ''), 2)) AS ConvertedHex FROM tablename ```
Check if first two characters are **0x** and then do conversion. ``` SELECT CASE WHEN LEFT([HexData], 2) = '0x' THEN CONVERT(varchar(max), CONVERT(varbinary(MAX), [HexData], 1)) ELSE CONVERT(varchar(max), CONVERT(varbinary(MAX), [HexData], 2)) END FROM tableName ```
42,575,577
If first conversion is failed, then how to do another conversion? I have a trigger that after data being insert to table, trigger will take the Hex data stored in the column, do conversion and update on another column (same row). Currently the information from our client is, the programmer might send custom Hex data....
2017/03/03
[ "https://Stackoverflow.com/questions/42575577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3436326/" ]
Not sure about the performance, but `REPLACE` will have shorter syntax. Something like above: ``` SELECT CONVERT(varchar(max), CONVERT(varbinary(MAX), REPLACE([HexData], '0x', ''), 2)) AS ConvertedHex FROM tablename ```
Use [TRY\_CONVERT](https://msdn.microsoft.com/en-us/library/hh230993.aspx) in SQL Server 2012+ ``` DECLARE @Hexdata varchar(200) = '0x68656c6c6f' IF TRY_CONVERT(varbinary(MAX), @Hexdata, 2) IS NOT NULL SELECT TRY_CONVERT(varchar(max),CONVERT(varbinary(MAX), @Hexdata, 2)); ELSE IF TRY_CONVERT(varbinary(MAX), @Hexd...
35,252,741
When I paste the following script between `<script></script>` inside the html document it works fine. However, when I load it through `<script src="example.js></script>` it only partially runs (the first section runs but the second does not). Here is the code: ``` //SMOOTH SCROLL $(function() { $('a[href*="#"]:...
2016/02/07
[ "https://Stackoverflow.com/questions/35252741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395909/" ]
I'm sumarizing comments and some additional research: Simple anwer: currently impossible ================================== There is currently no cross-platform way to retrive syntax error position from `new Function()` or `eval()` call. Partial solutions ================= 1. Firefox support non-standard properties...
**Solution for browser:** You can use latest Firefox to get the required information like error line number and column number inside the string. Example: ``` var testWithSyntaxError = "{\n\n\n\nvar x=3;\n =2;}"; try { var f=new Function('',testWithSyntaxError); } catch(e) { console.log(e instanceof...
35,252,741
When I paste the following script between `<script></script>` inside the html document it works fine. However, when I load it through `<script src="example.js></script>` it only partially runs (the first section runs but the second does not). Here is the code: ``` //SMOOTH SCROLL $(function() { $('a[href*="#"]:...
2016/02/07
[ "https://Stackoverflow.com/questions/35252741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395909/" ]
In Chromium-based browsers, as you've seen, putting `try`/`catch` around something that throws a SyntaxError while V8 is *parsing* the code (before actually running it) won't produce anything helpful; it will describe the line that *caused the evaluation* of the problematic script in the stack trace, but no details on ...
**Solution for browser:** You can use latest Firefox to get the required information like error line number and column number inside the string. Example: ``` var testWithSyntaxError = "{\n\n\n\nvar x=3;\n =2;}"; try { var f=new Function('',testWithSyntaxError); } catch(e) { console.log(e instanceof...
2,292,743
I know that given a certain function $f(x)$, there are some values of $x$ that could be in its domain but not in its derivative's. However, I believe that all the values that belong to the domain of $f'(x)$, have to belong to the domain of the original function as well. Is this true? If yes, how can it be proved?
2017/05/23
[ "https://math.stackexchange.com/questions/2292743", "https://math.stackexchange.com", "https://math.stackexchange.com/users/308167/" ]
It depends on how you define the domain of $f'(x)$. For me the definition of the domain of $f'(x)$ is $$\mbox{dom}(f')=\left\{x\in\mbox{dom}(f): \lim\_{h\to 0}\frac{f(x+h)-f(x)}{h}\ \ \ \mbox{exists and it is finite}\right\}$$ so $\mbox{dom}(f')\subseteq\mbox{dom}(f)$ by definition. Note that $x$ must be an element of...
Please read this question : [Differentiable only on interior points](https://math.stackexchange.com/questions/685369/differentiable-only-on-interior-points) In fact in addition to Ixion's answer, $f'$ could be defined in $x\_0$ if $x\_0\in\operatorname{dom}(f)\cap\overline{\operatorname {dom}(f)\setminus\{x\_0\}}$ bec...
61,861,139
currently I'm getting this error ``` The action 'show' could not be found for Api::V1::ImagesController ``` my routes file looks like this ``` namespace :api do namespace :v1 do ... resources :images ... end end ``` I can also see that the resources method has not created the new e...
2020/05/18
[ "https://Stackoverflow.com/questions/61861139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4586802/" ]
``` namespace :api do namespace :v1 do resources :images do get :new end end end ``` Or if you want to do this to multiple resources use a routing concern: ``` concern :has_new do get :new end namespace :api do namespace :v1 do resources :images, concerns: :has_new resources :videos, c...
Do you want to have a show route? If you do, then you need to add the show method. You don't have to actually have anything in there. `def show; end` If you don't want to include the show route and still use the resources helper, you could always use `only` in your resource. `resources :images, only: [:new]`
55,992,239
I'm trying to make a C++ research code written by colleagues easily usable by new graduate students. What I'd like to do is a package that **abstracts the underlying structure of the project with a clean programming interface**. This should be **simple** enough for my colleagues to help maintain it, without being worl...
2019/05/05
[ "https://Stackoverflow.com/questions/55992239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194830/" ]
On the one hand, you already know which calls were `.push()`ed to `externalCalls`, based on `someCondition1`, etc. But perhaps it's better to build `externalCalls` in a different way so it always has the same length: ```js const conditions = [true, someCondition1, etc] const calls = [call1, call2, etc] const external...
there is no direct way to know the source of the response of promise.all. but you can add more information to the response of call1, call2, call3 so your modified code would look like that: ``` let call1 = fetch(url).then(data1 => ({...data1, source: 'call1'})); let call2 = fetch(url).then(data2 => ({...data2, sourc...
55,992,239
I'm trying to make a C++ research code written by colleagues easily usable by new graduate students. What I'd like to do is a package that **abstracts the underlying structure of the project with a clean programming interface**. This should be **simple** enough for my colleagues to help maintain it, without being worl...
2019/05/05
[ "https://Stackoverflow.com/questions/55992239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194830/" ]
there is no direct way to know the source of the response of promise.all. but you can add more information to the response of call1, call2, call3 so your modified code would look like that: ``` let call1 = fetch(url).then(data1 => ({...data1, source: 'call1'})); let call2 = fetch(url).then(data2 => ({...data2, sourc...
My code ``` const promiseFor1stAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { resolve({ data: "1st api data" }); }, 2000); }); }; const promiseFor2edAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { r...
55,992,239
I'm trying to make a C++ research code written by colleagues easily usable by new graduate students. What I'd like to do is a package that **abstracts the underlying structure of the project with a clean programming interface**. This should be **simple** enough for my colleagues to help maintain it, without being worl...
2019/05/05
[ "https://Stackoverflow.com/questions/55992239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194830/" ]
On the one hand, you already know which calls were `.push()`ed to `externalCalls`, based on `someCondition1`, etc. But perhaps it's better to build `externalCalls` in a different way so it always has the same length: ```js const conditions = [true, someCondition1, etc] const calls = [call1, call2, etc] const external...
If someCondition1 is false, you don't push anything, then if someCondition2 is true, you push call3(), so you should expect call3 to be in the second item of the returned array. Therefore, instead you can just return undefined for calls which have no value, keeping the calls in the array having synchronised indexes. `...
55,992,239
I'm trying to make a C++ research code written by colleagues easily usable by new graduate students. What I'd like to do is a package that **abstracts the underlying structure of the project with a clean programming interface**. This should be **simple** enough for my colleagues to help maintain it, without being worl...
2019/05/05
[ "https://Stackoverflow.com/questions/55992239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194830/" ]
On the one hand, you already know which calls were `.push()`ed to `externalCalls`, based on `someCondition1`, etc. But perhaps it's better to build `externalCalls` in a different way so it always has the same length: ```js const conditions = [true, someCondition1, etc] const calls = [call1, call2, etc] const external...
My code ``` const promiseFor1stAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { resolve({ data: "1st api data" }); }, 2000); }); }; const promiseFor2edAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { r...
55,992,239
I'm trying to make a C++ research code written by colleagues easily usable by new graduate students. What I'd like to do is a package that **abstracts the underlying structure of the project with a clean programming interface**. This should be **simple** enough for my colleagues to help maintain it, without being worl...
2019/05/05
[ "https://Stackoverflow.com/questions/55992239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194830/" ]
If someCondition1 is false, you don't push anything, then if someCondition2 is true, you push call3(), so you should expect call3 to be in the second item of the returned array. Therefore, instead you can just return undefined for calls which have no value, keeping the calls in the array having synchronised indexes. `...
My code ``` const promiseFor1stAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { resolve({ data: "1st api data" }); }, 2000); }); }; const promiseFor2edAPICall = () => { return new Promise((resolve) => { return setTimeout(() => { r...
45,316,207
I have a WooCommerce Shop with 850+ products that needs editing. Without having to purchase an Extended/Pro Plugin to mass edit these products... I am trying to do this through phpMyAdmin. The site is a little bit of "Add to Cart" and "Ask for Quote", so we're using the RFQ Toolkit Plugin, to handle this. The BIG issu...
2017/07/26
[ "https://Stackoverflow.com/questions/45316207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8366824/" ]
I understand that you are looking for inserting a new row on the wp\_postmeta table (not updating an existing one) for each product, so maybe this is what you are looking for: ``` INSERT INTO wp_postmeta ( post_id, meta_key, meta_value ) SELECT ID, '_gpls_woo_rfq_rfq_enable', 'yes' FROM wp_po...
Much thanks to Fernando M. for your excellent answer! :) YES, this was exactly what I needed. You are great! :) ``` INSERT INTO wp_postmeta ( post_id, meta_key, meta_value ) SELECT ID, '_gpls_woo_rfq_rfq_enable', 'yes' FROM wp_posts WHERE post_type = 'product' ```
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
**Exalted** would fit this although it's much more obviously prevalent in the 1st Age of the setting (which is playable) then the current age. In the first age magic is common and developed enough to provide a standard of living that is arguably better then ours is. They have internet, flying cars, money chits and mor...
Epic of Aerth: Mythus Fantasy (Dangerous Journeys RPG) ------------------------------------------------------ Aerth is a parallel world with our own Earth, where instead of taking the path of science like we did, they found that magic worked and used it to improve their lives. The things we consider myth and legend ar...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
[Earthdawn](http://www.redbrick-limited.com/cms/index.php?categoryid=18) has magic being infused into the world. * Players use magic to enhance skill like abilities called talents. The commodity as you put it is your Legend. * The game rewards roleplaying and boasting of your deeds to spread your legend. * You can sp...
Amazing Engine: Magitech ======================== Horrible system, excellent setting materials. In the book, it replaces modern technology with magical equivalents. Cars and trains are powered by bound elementals. Television is replaced with Crystal Ball Networks. Etc. Really quite a cool read, but the system is oft...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
Epic of Aerth: Mythus Fantasy (Dangerous Journeys RPG) ------------------------------------------------------ Aerth is a parallel world with our own Earth, where instead of taking the path of science like we did, they found that magic worked and used it to improve their lives. The things we consider myth and legend ar...
Amazing Engine: Magitech ======================== Horrible system, excellent setting materials. In the book, it replaces modern technology with magical equivalents. Cars and trains are powered by bound elementals. Television is replaced with Crystal Ball Networks. Etc. Really quite a cool read, but the system is oft...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
**Planescape** is another great example, although in this case it is less about a "standard" fantasy world with a lot of wizards, and more about a world where **everything** is supernatural. Sigil, the main city of the setting, is filled with portals to other fantastic places. Below are some of the ways this setting a...
Just thought of this a bit ago, but I'd like to offer **[Cthulhutech](http://www.cthulhutech.com/)** Ever since the re-emergence of the Great Old Ones and the war with the Migou/Nazzadi, magic is pretty common, though heavily regulated by the government. Spells have a Power/Legality ratings, and sorcerers are requir...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
**Exalted** would fit this although it's much more obviously prevalent in the 1st Age of the setting (which is playable) then the current age. In the first age magic is common and developed enough to provide a standard of living that is arguably better then ours is. They have internet, flying cars, money chits and mor...
Amazing Engine: Magitech ======================== Horrible system, excellent setting materials. In the book, it replaces modern technology with magical equivalents. Cars and trains are powered by bound elementals. Television is replaced with Crystal Ball Networks. Etc. Really quite a cool read, but the system is oft...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
The Eberron setting for D&D features magic used on this level, with trains pulled by magic, for example. Check the [wikipedia page](http://en.wikipedia.org/wiki/Eberron) for details.
[Earthdawn](http://www.redbrick-limited.com/cms/index.php?categoryid=18) has magic being infused into the world. * Players use magic to enhance skill like abilities called talents. The commodity as you put it is your Legend. * The game rewards roleplaying and boasting of your deeds to spread your legend. * You can sp...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
Epic of Aerth: Mythus Fantasy (Dangerous Journeys RPG) ------------------------------------------------------ Aerth is a parallel world with our own Earth, where instead of taking the path of science like we did, they found that magic worked and used it to improve their lives. The things we consider myth and legend ar...
One of the first games to have this level of high-magic economic integration was **Torg**. (Torg was a cross-genre game featuring multiple 'realms' with different rules, but I'm referring here only to the fantasy setting, Aysle, as described in the fantasy/magic Torg sourcebook.) Magic is not only common, but literall...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
**Planescape** is another great example, although in this case it is less about a "standard" fantasy world with a lot of wizards, and more about a world where **everything** is supernatural. Sigil, the main city of the setting, is filled with portals to other fantastic places. Below are some of the ways this setting a...
Epic of Aerth: Mythus Fantasy (Dangerous Journeys RPG) ------------------------------------------------------ Aerth is a parallel world with our own Earth, where instead of taking the path of science like we did, they found that magic worked and used it to improve their lives. The things we consider myth and legend ar...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
### RuneQuest 2nd & 3rd Eds (Chaosium, and the Avalon Hill/Chaosium and Games Workshop/Chaosium editions). As with HeroQuest/HeroWars, this is Roleplaying on Glorantha, and almost every character has some starting magic, and most WILL be using it. Even the farmer is likely to have a spell or two.
Amazing Engine: Magitech ======================== Horrible system, excellent setting materials. In the book, it replaces modern technology with magical equivalents. Cars and trains are powered by bound elementals. Television is replaced with Crystal Ball Networks. Etc. Really quite a cool read, but the system is oft...
8,770
Some fantasy RPGs treat magic as arcane and thus rare, possibly subject to suspicion by the masses. Other games treat magic as somewhat more prevelant but not ubiquitous. At some point in this trend, magic may become so commonplace as to be considered a commodity. **What published fantasy RPG and/or setting features ...
2011/06/28
[ "https://rpg.stackexchange.com/questions/8770", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/72/" ]
[HeroQuest](http://rpggeek.com/rpgitem/49819/heroquest-roleplaying-in-glorantha) -------------------------------------------------------------------------------- This is my only experience of Glorantha, Greg Stafford's fantasy world. But at least in the Robin D. Laws' version, **everyone** has magic. Magic is in ever...
### RuneQuest 2nd & 3rd Eds (Chaosium, and the Avalon Hill/Chaosium and Games Workshop/Chaosium editions). As with HeroQuest/HeroWars, this is Roleplaying on Glorantha, and almost every character has some starting magic, and most WILL be using it. Even the farmer is likely to have a spell or two.
14,991
I need to play videos on my drupal 6 site that would run well on IOS device (HTML5?). Is such solution available? My site currently serving flv files using jwplayer 6.x-1.1.
2011/11/08
[ "https://drupal.stackexchange.com/questions/14991", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/3918/" ]
If you are looking for a ready to use function, take a look at [comment\_render()](http://api.drupal.org/api/drupal/modules--comment--comment.module/function/comment_render/6). Example use (say the node you want comments for has nid = 5): ``` <?php $node = node_load(5); print comment_render($node); ?> ``` Or els...
In Drupal 7 and onwards `comment_render` has been removed. Instead, you can load comments like this. ``` $result = db_select('comment') ->fields('comment', array('name','subject')) ->condition('nid', $node->nid, '=') ->execute() ->fetchAssoc(); f...
14,991
I need to play videos on my drupal 6 site that would run well on IOS device (HTML5?). Is such solution available? My site currently serving flv files using jwplayer 6.x-1.1.
2011/11/08
[ "https://drupal.stackexchange.com/questions/14991", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/3918/" ]
If you are looking for a ready to use function, take a look at [comment\_render()](http://api.drupal.org/api/drupal/modules--comment--comment.module/function/comment_render/6). Example use (say the node you want comments for has nid = 5): ``` <?php $node = node_load(5); print comment_render($node); ?> ``` Or els...
If you like to load the complete comment objects you can use this: ``` $result = db_select('comment') ->fields('comment', array('cid')) ->condition('nid', $node->nid, '=') ->execute(); $cids = $result->fetchCol(); $comments=comment_load_multiple($cids); foreach($comments as $comment) { //do some stuff with t...
14,991
I need to play videos on my drupal 6 site that would run well on IOS device (HTML5?). Is such solution available? My site currently serving flv files using jwplayer 6.x-1.1.
2011/11/08
[ "https://drupal.stackexchange.com/questions/14991", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/3918/" ]
If you like to load the complete comment objects you can use this: ``` $result = db_select('comment') ->fields('comment', array('cid')) ->condition('nid', $node->nid, '=') ->execute(); $cids = $result->fetchCol(); $comments=comment_load_multiple($cids); foreach($comments as $comment) { //do some stuff with t...
In Drupal 7 and onwards `comment_render` has been removed. Instead, you can load comments like this. ``` $result = db_select('comment') ->fields('comment', array('name','subject')) ->condition('nid', $node->nid, '=') ->execute() ->fetchAssoc(); f...
39,294,866
I am attempting to build an EDI 855 file via the EdiFabric.Definitions.X12\_004010\_855 class purchased through EdiFabric. I am running into issues, trying to convert this object to a valid EDI 855 file. Here's what I'm doing: **Create new M\_855 object:** ``` var m_855 = new M_855(); m_855.S_ST = new EdiFabric.Defi...
2016/09/02
[ "https://Stackoverflow.com/questions/39294866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2658389/" ]
Correct method is `=!=` not `!=`.
Used below syntaxt itemLHS("LHS") !== itemRHS("RHS")
7,355,828
Yes, I am aware one is a framework and the other a CMS. However, I am a one man team that develops projects/websites for myself and I have a limited amount of time to get these projects off the ground, so speed is crucial. Basically I am looking for the easiest and fastest method for creating web apps without being l...
2011/09/08
[ "https://Stackoverflow.com/questions/7355828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877593/" ]
I would suggest using CodeIgniter. The logic is simple, and it doesn't really have limitations, unlike WordPress. WordPress is designed for blogs, and if you are looking for flexibility, I would go with CodeIgniter. CodeIgniter has one of the best documentation available as well. <http://codeigniter.com/user_guide/ind...
If what you develop is web applications, especially for high-traffic sites, then why not to also consider Doctrine? It is a really good framework for developing webapps. Regarding WordPress - if what you need is mostly webapps with extensive user interaction and complex data structures - WP can't handle that efficientl...
7,355,828
Yes, I am aware one is a framework and the other a CMS. However, I am a one man team that develops projects/websites for myself and I have a limited amount of time to get these projects off the ground, so speed is crucial. Basically I am looking for the easiest and fastest method for creating web apps without being l...
2011/09/08
[ "https://Stackoverflow.com/questions/7355828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877593/" ]
I would suggest using CodeIgniter. The logic is simple, and it doesn't really have limitations, unlike WordPress. WordPress is designed for blogs, and if you are looking for flexibility, I would go with CodeIgniter. CodeIgniter has one of the best documentation available as well. <http://codeigniter.com/user_guide/ind...
I agree with tpae. Definitely WP is not meant to be used for web apps. So forget about it. CI is great, easy to learn, and in combo with [Backbone.js](http://documentcloud.github.com/backbone/) and Phil's [REST\_Controller](http://philsturgeon.co.uk/blog/2011/03/video-set-up-a-rest-api-with-codeigniter) it's a beauty ...
7,355,828
Yes, I am aware one is a framework and the other a CMS. However, I am a one man team that develops projects/websites for myself and I have a limited amount of time to get these projects off the ground, so speed is crucial. Basically I am looking for the easiest and fastest method for creating web apps without being l...
2011/09/08
[ "https://Stackoverflow.com/questions/7355828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877593/" ]
If what you develop is web applications, especially for high-traffic sites, then why not to also consider Doctrine? It is a really good framework for developing webapps. Regarding WordPress - if what you need is mostly webapps with extensive user interaction and complex data structures - WP can't handle that efficientl...
I agree with tpae. Definitely WP is not meant to be used for web apps. So forget about it. CI is great, easy to learn, and in combo with [Backbone.js](http://documentcloud.github.com/backbone/) and Phil's [REST\_Controller](http://philsturgeon.co.uk/blog/2011/03/video-set-up-a-rest-api-with-codeigniter) it's a beauty ...
32,392,776
i am new to MVC and working on view having list of users and by selection on userid details should display on the screen... getting Error on selection of id like 'abc.xyx' .. is doing some wrong... Error while select id field contains '.' Dot in it Example : xyz.abc View links ``` <td> @Html.ActionLink(...
2015/09/04
[ "https://Stackoverflow.com/questions/32392776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1414281/" ]
yes solve it by Change In Web.config File section and add `<system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <validation validateIntegratedModeConfiguration="false" /> </system.webServer>`
In the system.web section of your web.config(.net 4) ``` <httpRuntime relaxedUrlToFileSystemMapping="true" /> ```
64,013,667
I have 2 question: 1. Consider the situation where Alice runs a owned Set-UID program by Bob. The program wants to read the file contained in / etc / data, readable by Alice, but by no one else. Can this program access the file? 2. Consider the situation where a process wants to access a file for reading; the effectiv...
2020/09/22
[ "https://Stackoverflow.com/questions/64013667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10347699/" ]
These are really the same question, and the answer in both cases is no, *unless* the program uses `setresuid` to change its effective UID to its real UID, or it uses `setfsuid` (Linux-specific) to change its filesystem UID to its real UID. But the program would have to be designed for this scenario; an ordinary program...
Here is a concrete example of how to answer your part 1 question in code: ``` #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> static void flipuids(void) { uid_t r = getuid(); uid_t e = geteuid(); if (setreuid(e, r)) { perror("failed to flip"); exit(1); ...
22,242,787
I have been trying to figure out how to select data related to one id between to tables without limit it to the joined table. I tried using UNION, Inner join, JOIN, but it limit me to show records that are only in both tables. By example: ``` Table 1 (users) id | name | register 1 | John | 2014-03-01 2 | Kate | ...
2014/03/07
[ "https://Stackoverflow.com/questions/22242787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3201616/" ]
You need a `LEFT OUTER JOIN` instead of the plain `JOIN` (also known as `INNER JOIN`), like this: ``` SELECT U.id, name, register, B.birthday FROM users as U LEFT JOIN birthday as B ON B.user = U.id ``` A LEFT JOIN between `users` and `birthday` tables will contain all records of the "left" table (users), even if...
Use [left outer join](http://docs.oracle.com/javadb/10.8.1.2/ref/rrefsqlj18922.html) instead of [inner join](http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj35034.html).. ``` SELECT U.id, name, register, B.birthday FROM users as U left join birthday as B ON B.user = U.id ```
41,620,097
I have a class with a couple of methods. Here is my function mapping: ``` public void Connect(string SourceFile, OleDbConnection Connection, OleDbCommand Command) { zConnect(SourceFile, Connection, Command); } public void Tablenames2cmb(OleDbConnection Connection, ComboBox TargetComboBox) { zTablenames2cmb(Co...
2017/01/12
[ "https://Stackoverflow.com/questions/41620097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6109854/" ]
They are quite different. Yes, both affect how newlines are treated, but they switch behaviour for different concepts. * `re.MULTILINE` affects where `^` and `$` *anchors* match. Without the switch, `^` and `$` match only at the start and end, respectively, of the *whole text*. With the switch, they also match just b...
It is not doing the same thing, `DOTALL` matches the newline character as well, while `MULTILINE` enables `^` and `$` to work on every line. Example: ``` The quick brown fox jumps over the lazy dog. ``` Here, `.+` would yield two results (the first and the second line) with no `DOTALL` mode. If `DOTALL` is turned...
36,956,751
``` char[][] moveup() { for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { if(board[i][j]=='X' && board [i-1][j]=='!' ) { board [i][j]='!'; board [i-1][j]='X'; } } } return board; } ``` This is my code and *I want to pass this 2d array then in to a vector* so i want to return a 2d array b...
2016/04/30
[ "https://Stackoverflow.com/questions/36956751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6275428/" ]
I do not know why you use this format but here is a hack with `pandas`: ``` import pandas as pd df = pd.DataFrame(x) df_ = df.groupby('id')['vonmises'].max().reset_index() In [213]: df_.merge(df, on=['id','vonmises'])[['id','vonmises','subcase']] Out[213]: array([[ 2., 400., 44.], [ 3., 400., 33.]...
Here's an approach using `np.sort` (or `argsort`) followed by `itertools.groupby`. But this grouping tools produces a generator of generators, which is messier to work with. ``` In [29]: x = np.rec.array([(22,2,200.,2000.), (44,2,400.,4000.), (55,5,500.,5000.), (33,3,400.,3000.)], dtype={'names':['subcas...
36,956,751
``` char[][] moveup() { for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { if(board[i][j]=='X' && board [i-1][j]=='!' ) { board [i][j]='!'; board [i-1][j]='X'; } } } return board; } ``` This is my code and *I want to pass this 2d array then in to a vector* so i want to return a 2d array b...
2016/04/30
[ "https://Stackoverflow.com/questions/36956751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6275428/" ]
I do not know why you use this format but here is a hack with `pandas`: ``` import pandas as pd df = pd.DataFrame(x) df_ = df.groupby('id')['vonmises'].max().reset_index() In [213]: df_.merge(df, on=['id','vonmises'])[['id','vonmises','subcase']] Out[213]: array([[ 2., 400., 44.], [ 3., 400., 33.]...
Here's an approach without groupby: ``` # sort as desired x.sort(order=['id','vonmises']) # keep the first element, and every element with a different id to the one before it keep = np.empty(x.shape, dtype=np.bool) keep[0] = True keep[1:] = x[:-1].id != x[1:].id x_filt = x[keep] ``` Which gives: ``` rec.array([(2...
36,956,751
``` char[][] moveup() { for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { if(board[i][j]=='X' && board [i-1][j]=='!' ) { board [i][j]='!'; board [i-1][j]='X'; } } } return board; } ``` This is my code and *I want to pass this 2d array then in to a vector* so i want to return a 2d array b...
2016/04/30
[ "https://Stackoverflow.com/questions/36956751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6275428/" ]
I do not know why you use this format but here is a hack with `pandas`: ``` import pandas as pd df = pd.DataFrame(x) df_ = df.groupby('id')['vonmises'].max().reset_index() In [213]: df_.merge(df, on=['id','vonmises'])[['id','vonmises','subcase']] Out[213]: array([[ 2., 400., 44.], [ 3., 400., 33.]...
Using the [numpy\_indexed](https://github.com/EelcoHoogendoorn/Numpy_arraysetops_EP) package, this would be a simple one-liner: ``` import numpy_indexed as npi ids, maxvonmises = npi.group_by(x.id).max(x.vonmises) ``` Probably similar performance to pandas, but a lot more readable, and no need to adapt your dataform...
121,480
Hi i got a requirement like create a validation rule based on probability. The requirement is user cannot modify some custom field called forecast units If probability is under 70% So, i write a validation rule like ``` AND(ISCHANGED( Forecast_Units__c ),Probability < 0.70) ``` It works fine but when i create any...
2016/05/11
[ "https://salesforce.stackexchange.com/questions/121480", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/24207/" ]
According to the [docs](https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISCHANGED) > > ISCHANGED function returns FALSE when evaluating any field on a newly created record. > > > So your validation will never fire when you are creating a record. You might want to add `...
That is because the validation will only fire on the field being changed. To make it work on creation you would need to use ISNEW So I think the following will work updated based on Adrian's input and checking that Forecast\_Units\_\_c is populated. ``` AND(Probability < .7, OR(AND(ISNEW(),NOT(ISBLANK( Forecas...
121,480
Hi i got a requirement like create a validation rule based on probability. The requirement is user cannot modify some custom field called forecast units If probability is under 70% So, i write a validation rule like ``` AND(ISCHANGED( Forecast_Units__c ),Probability < 0.70) ``` It works fine but when i create any...
2016/05/11
[ "https://salesforce.stackexchange.com/questions/121480", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/24207/" ]
According to the [docs](https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISCHANGED) > > ISCHANGED function returns FALSE when evaluating any field on a newly created record. > > > So your validation will never fire when you are creating a record. You might want to add `...
**EDIT:** This validation below is incorrect, the only thing you can learn from it is how to *DO NOT USE* a combination of `ISNEW()` and `ISCHANGED()` formulas in Validation Rules )) ``` AND( NOT( ISNEW()), ISCHANGED( Forecast_Units__c ), Probability < 0.70 ) ``` Would allow you to bypass this validation when new...
121,480
Hi i got a requirement like create a validation rule based on probability. The requirement is user cannot modify some custom field called forecast units If probability is under 70% So, i write a validation rule like ``` AND(ISCHANGED( Forecast_Units__c ),Probability < 0.70) ``` It works fine but when i create any...
2016/05/11
[ "https://salesforce.stackexchange.com/questions/121480", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/24207/" ]
That is because the validation will only fire on the field being changed. To make it work on creation you would need to use ISNEW So I think the following will work updated based on Adrian's input and checking that Forecast\_Units\_\_c is populated. ``` AND(Probability < .7, OR(AND(ISNEW(),NOT(ISBLANK( Forecas...
**EDIT:** This validation below is incorrect, the only thing you can learn from it is how to *DO NOT USE* a combination of `ISNEW()` and `ISCHANGED()` formulas in Validation Rules )) ``` AND( NOT( ISNEW()), ISCHANGED( Forecast_Units__c ), Probability < 0.70 ) ``` Would allow you to bypass this validation when new...
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
It is not the FrontEnd that does the evaluation but the Kernel. You can use [MathematicaScript](http://reference.wolfram.com/mathematica/ref/program/MathematicaScript.html) to automate it.
If this is for a specific notebook, have you tried setting the relevant cells in the notebook to have the property [InitializationCell](http://reference.wolfram.com/mathematica/ref/menuitem/InitializationCell.html)? Or do you want to do this with any notebook? If the latter, Sjoerd's answer works better.
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
You can try this: In C:\Program Files\Wolfram Research\Mathematica\7.0 create a file called firstgo.m containing: ``` UsingFrontEnd[Module[{}, file = "C:\\Temp\\Test.nb"; targetnotebook = NotebookOpen[file, Visible -> True]; SelectionMove[targetnotebook, Next, Cell]; SelectionEvaluate[targetnotebook]; NotebookSave[ta...
It is not the FrontEnd that does the evaluation but the Kernel. You can use [MathematicaScript](http://reference.wolfram.com/mathematica/ref/program/MathematicaScript.html) to automate it.
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
Aha...!! ``` Needs["JLink`"]; $FrontEndLaunchCommand="C:\\Program Files\\Wolfram Research\\Mathematica\\6.0\\Mathematica.exe"; ConnectToFrontEnd[]; UseFrontEnd[Module[{}, ... ``` follow up..for completeness --- the above $FrontEndLaunchCommand causes the GUI to come up so you can observe the evaluation (What I want...
It is not the FrontEnd that does the evaluation but the Kernel. You can use [MathematicaScript](http://reference.wolfram.com/mathematica/ref/program/MathematicaScript.html) to automate it.
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
It is not the FrontEnd that does the evaluation but the Kernel. You can use [MathematicaScript](http://reference.wolfram.com/mathematica/ref/program/MathematicaScript.html) to automate it.
I don't know if the topic is still active, but for those who are stopped at the "initialization cell warning" problem, you can change this to "Flase" in the > > Option Inspector -> Notebook Options -> Evaluation Options -> InitializationCellWarning ->False > > >
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
You can try this: In C:\Program Files\Wolfram Research\Mathematica\7.0 create a file called firstgo.m containing: ``` UsingFrontEnd[Module[{}, file = "C:\\Temp\\Test.nb"; targetnotebook = NotebookOpen[file, Visible -> True]; SelectionMove[targetnotebook, Next, Cell]; SelectionEvaluate[targetnotebook]; NotebookSave[ta...
If this is for a specific notebook, have you tried setting the relevant cells in the notebook to have the property [InitializationCell](http://reference.wolfram.com/mathematica/ref/menuitem/InitializationCell.html)? Or do you want to do this with any notebook? If the latter, Sjoerd's answer works better.
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
Aha...!! ``` Needs["JLink`"]; $FrontEndLaunchCommand="C:\\Program Files\\Wolfram Research\\Mathematica\\6.0\\Mathematica.exe"; ConnectToFrontEnd[]; UseFrontEnd[Module[{}, ... ``` follow up..for completeness --- the above $FrontEndLaunchCommand causes the GUI to come up so you can observe the evaluation (What I want...
If this is for a specific notebook, have you tried setting the relevant cells in the notebook to have the property [InitializationCell](http://reference.wolfram.com/mathematica/ref/menuitem/InitializationCell.html)? Or do you want to do this with any notebook? If the latter, Sjoerd's answer works better.
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
Aha...!! ``` Needs["JLink`"]; $FrontEndLaunchCommand="C:\\Program Files\\Wolfram Research\\Mathematica\\6.0\\Mathematica.exe"; ConnectToFrontEnd[]; UseFrontEnd[Module[{}, ... ``` follow up..for completeness --- the above $FrontEndLaunchCommand causes the GUI to come up so you can observe the evaluation (What I want...
You can try this: In C:\Program Files\Wolfram Research\Mathematica\7.0 create a file called firstgo.m containing: ``` UsingFrontEnd[Module[{}, file = "C:\\Temp\\Test.nb"; targetnotebook = NotebookOpen[file, Visible -> True]; SelectionMove[targetnotebook, Next, Cell]; SelectionEvaluate[targetnotebook]; NotebookSave[ta...
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
You can try this: In C:\Program Files\Wolfram Research\Mathematica\7.0 create a file called firstgo.m containing: ``` UsingFrontEnd[Module[{}, file = "C:\\Temp\\Test.nb"; targetnotebook = NotebookOpen[file, Visible -> True]; SelectionMove[targetnotebook, Next, Cell]; SelectionEvaluate[targetnotebook]; NotebookSave[ta...
I don't know if the topic is still active, but for those who are stopped at the "initialization cell warning" problem, you can change this to "Flase" in the > > Option Inspector -> Notebook Options -> Evaluation Options -> InitializationCellWarning ->False > > >
7,423,179
Is there a way to start up a mathematica front end (GUI) from a (Windows) command prompt and have it eval a notebook without further user action? even though mathematica.exe takes the -run and -initfile options they dont work the same as they do with math.exe. (-run ''<<file.m'' wants to open a file named ''<<file.m''...
2011/09/14
[ "https://Stackoverflow.com/questions/7423179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004168/" ]
Aha...!! ``` Needs["JLink`"]; $FrontEndLaunchCommand="C:\\Program Files\\Wolfram Research\\Mathematica\\6.0\\Mathematica.exe"; ConnectToFrontEnd[]; UseFrontEnd[Module[{}, ... ``` follow up..for completeness --- the above $FrontEndLaunchCommand causes the GUI to come up so you can observe the evaluation (What I want...
I don't know if the topic is still active, but for those who are stopped at the "initialization cell warning" problem, you can change this to "Flase" in the > > Option Inspector -> Notebook Options -> Evaluation Options -> InitializationCellWarning ->False > > >
29,057,602
I'm working with Laravel 5 (Elixir) and homestead v2.5 in Ubuntu 14.10. When I typed gulp and press enter in homestead ssh, I found the following error: ``` Error: Cannot find module './lib/notifiers/notify-send' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Modu...
2015/03/15
[ "https://Stackoverflow.com/questions/29057602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4590908/" ]
This happened to me too with an unfinished previous installation. A better solution I found was just removing **node\_modules/** folder inside my project and run again `[sudo] npm install`. Hope this helps somebody else, regards! Update Note: **"sudo"** is not needed, a better practice is solve permissions issue in ...
SOLVED! Make new project and run sudo npm install.
119,823
The particular Basmati rice I normally use (Aldi own brand), cooks perfectly with seperate, non-sticky grains using the following method. In a large pan of cold water (3 or 4 times the volume of rice), bring rice to the boil. Reduce heat, cover, and simmer gently for 5 minutes over a low heat. Drain well, add back to t...
2022/02/12
[ "https://cooking.stackexchange.com/questions/119823", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/67481/" ]
I wouldn't take the risk of messing around with the temperatures to be honest. Rice can cause food poisoning if not cooked or kept at proper temparatures. Also it seems like the method you are using is too complicated IMHO. You could try the absorption method instead, it's so simple, and you really can't really go wro...
Similar to Billy's method… I do this will all rice types [except risotto etc] rice:water ratio about 1:1.6 [ie a cup of rice to one and 'about half' cups water. No rinsing. These timings work best with a 240v supply - ie, EU kettles are a lot faster than US ones. Put the kettle on. Put your smallest saucepan pan...
70,743,464
I am using SQL-Server. I want to run a nested query, get the results and do two inner joins on the complete nested query results. My nested query is as follows: ``` SELECT table1.unique_id, table1.a1, table1.a2, table1.cty, table1.ctry, FROM table1 WHERE table1.unique_id IN ( SELECT unique_id FROM tab...
2022/01/17
[ "https://Stackoverflow.com/questions/70743464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17927416/" ]
Try the directive below it's based off the package <https://www.npmjs.com/package/ion-custom-scrollbar> but just grabbed the directive instead ``` import { Directive, ElementRef, Input, OnInit } from '@angular/core'; @Directive({ selector: '[scrollbar]' }) export class ScrollbarDirective implements OnInit { ...
If nothing works with plain CSS, you can try to use <https://www.npmjs.com/package/ion-custom-scrollbar>
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
This is a partial answer to the case where we aren't requiring that $W$ be closed under multiplication. Specifically, this is the case when $W$ has codimension $1$. I'm going to assume $V=F^n$, where $F$ is our base field, so $\mbox{End}(V)=M\_n(F)$. In this case, we can describe $W$ by a nonzero matrix $A$, i.e., $M\...
I'm going to add another partial answer, this time regarding the case where we do require that $W$ be closed under multiplication. Namely: If $W$ is closed under multiplication, and $\dim W>n^2-2n+2$, then the only way $W$ can fix every vector is if $W$ contains the identity. As Julian Rosen pointed out in the commen...
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
The question is closely related to the notion of algebraic reflexivity. The (algebraic) reflexive closure of $W$ is the space of all operators $g \in End(V)$ such that $g(x) \in Wx$ for all $x \in V$. The author asks when the identity operator belongs to the reflexive closure of the operator space $W$. I will consi...
This is a partial answer to the case where we aren't requiring that $W$ be closed under multiplication. Specifically, this is the case when $W$ has codimension $1$. I'm going to assume $V=F^n$, where $F$ is our base field, so $\mbox{End}(V)=M\_n(F)$. In this case, we can describe $W$ by a nonzero matrix $A$, i.e., $M\...
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
For subspaces that are stable under multiplication, there's an even more profound result that holds for all fields : > > Given a finite-dimensional vector space $V$ and a linear subspace $W$ of $End(V)$ > that is stable under multiplication *but does not contain the identity*, > there are linear subspaces $V\_1$ ...
This is a partial answer to the case where we aren't requiring that $W$ be closed under multiplication. Specifically, this is the case when $W$ has codimension $1$. I'm going to assume $V=F^n$, where $F$ is our base field, so $\mbox{End}(V)=M\_n(F)$. In this case, we can describe $W$ by a nonzero matrix $A$, i.e., $M\...
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
The question is closely related to the notion of algebraic reflexivity. The (algebraic) reflexive closure of $W$ is the space of all operators $g \in End(V)$ such that $g(x) \in Wx$ for all $x \in V$. The author asks when the identity operator belongs to the reflexive closure of the operator space $W$. I will consi...
I'm going to add another partial answer, this time regarding the case where we do require that $W$ be closed under multiplication. Namely: If $W$ is closed under multiplication, and $\dim W>n^2-2n+2$, then the only way $W$ can fix every vector is if $W$ contains the identity. As Julian Rosen pointed out in the commen...
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
For subspaces that are stable under multiplication, there's an even more profound result that holds for all fields : > > Given a finite-dimensional vector space $V$ and a linear subspace $W$ of $End(V)$ > that is stable under multiplication *but does not contain the identity*, > there are linear subspaces $V\_1$ ...
I'm going to add another partial answer, this time regarding the case where we do require that $W$ be closed under multiplication. Namely: If $W$ is closed under multiplication, and $\dim W>n^2-2n+2$, then the only way $W$ can fix every vector is if $W$ contains the identity. As Julian Rosen pointed out in the commen...
115,446
Suppose V is a finite-dimensional vector space and I have a linear subspace of its endomorphisms $$W \subseteq \mbox{End}(V).$$ How can I easily check if every vector of $V$ is fixed by some element of $W$? I would also be interested in any nice conditions on $W$ that imply $$\forall v \in V: \;\;\; v \in Wv,$$ even i...
2012/12/04
[ "https://mathoverflow.net/questions/115446", "https://mathoverflow.net", "https://mathoverflow.net/users/9068/" ]
The question is closely related to the notion of algebraic reflexivity. The (algebraic) reflexive closure of $W$ is the space of all operators $g \in End(V)$ such that $g(x) \in Wx$ for all $x \in V$. The author asks when the identity operator belongs to the reflexive closure of the operator space $W$. I will consi...
For subspaces that are stable under multiplication, there's an even more profound result that holds for all fields : > > Given a finite-dimensional vector space $V$ and a linear subspace $W$ of $End(V)$ > that is stable under multiplication *but does not contain the identity*, > there are linear subspaces $V\_1$ ...
31,902,025
In my VS2013 project with reference to: * EntityFramework 6.1.3, * EntityFramework.SqlServerCompact (for SQLServerCompact 4.0) I am facing an error in my edx file. VisualStudio says: ``` Exception has been thrown by the target of an invocation ``` and the edmx file cannot be opened or updated. Anyone can help t...
2015/08/09
[ "https://Stackoverflow.com/questions/31902025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5138288/" ]
I got all the nuget packages installed for private deployment and however have the same error while opening EDMX diagrams. **Exception has been thrown by the target of an invocation.** Designer is not working with SqlServerCe.4.0 provider in app.config file. Try to remove this line temporary to make it open: ``` ...
In my case it was my connection string. Pay very close to your connection string, maybe copy and paste it into a console application and see if it works by getting one row from the database.
12,621,535
I have two images which I want to compare using python and opencv. I understood how to extract surf features from a single images from this book: Programming Computer Vision with Python. I extract the features as follows: ``` import cv2 from numpy import * # read image im = cv2.imread('empire.jpg') # downsample im...
2012/09/27
[ "https://Stackoverflow.com/questions/12621535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/601836/" ]
There is a FLANN implementation for Python OpenCV, I have used it myself and it works very well. Initially it wasn't easy to figure out, but the [this question](https://stackoverflow.com/questions/8301962/opencv-pythons-api-flannbasedmatcher/8311498#8311498) helped me a lot, see [Esteban Angee's](https://stackoverflow....
Matching SURF descriptors is normally done using k-nearest neighbours (with k=2). Certainly for C++ OpenCV has a built-in class for doing this - Fast approximate nearest neighbour descriptor matcher ([FLANN\_matcher](http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html?high...
11,448,555
I know there are many examples, but essentially without any garbage usually involved, how can one do an image stack using the new `HTML5 + CSS3` style, that is: * only single image displayed at the time * next image shown over the previous image after some event (e.g. a mouse-down; round-robin) I would like to know h...
2012/07/12
[ "https://Stackoverflow.com/questions/11448555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/684534/" ]
I found pretty good examples for a slideshow if that's what you are looking for without to much extra in it. One with showing a timer for the next photo and an other one that changes the background. Both CSS3 solutions and nice step per step tutorials [Timed slideshow (box)](http://coding.smashingmagazine.com/2012/04...
Personally I'd use jQuery Cycle - <http://jquery.malsup.com/cycle/> ``` <div id="shuffle" class="pics"> <img src="http://cloud.github.com/downloads/malsup/cycle/beach1.jpg" width="200" height="200" /> <img src="http://cloud.github.com/downloads/malsup/cycle/beach2.jpg" width="200" height="200" /> ...
11,448,555
I know there are many examples, but essentially without any garbage usually involved, how can one do an image stack using the new `HTML5 + CSS3` style, that is: * only single image displayed at the time * next image shown over the previous image after some event (e.g. a mouse-down; round-robin) I would like to know h...
2012/07/12
[ "https://Stackoverflow.com/questions/11448555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/684534/" ]
I found pretty good examples for a slideshow if that's what you are looking for without to much extra in it. One with showing a timer for the next photo and an other one that changes the background. Both CSS3 solutions and nice step per step tutorials [Timed slideshow (box)](http://coding.smashingmagazine.com/2012/04...
this is the best that I have ever found ``` .stack { position: relative; z-index: 10; } .stack img { max-width: 180px; height: 180px; vertical-align: bottom; border: 5px solid #fff; border-radius: 3px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sha...
31,998,565
**ApplicationContext** ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.sp...
2015/08/13
[ "https://Stackoverflow.com/questions/31998565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4559577/" ]
The beans are eagerly initialized by default which means the container ["eagerly create and configure all singleton beans as part of the initialization process"](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-factory-lazy-init). Simply, the @PostConstruct methods are called o...
Beans are eagerly created by default. If you'd like to delay this you can use [lazy-initialization](http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-factory-lazy-init).
45,035,665
I am needing to read a excel file using lib JXL with UTF-8 Encoding. I already try using WorkbookSettings as bellow: ``` WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding("UTF-8"); Workbook workbook = Workbook.getWorkbook(fileInputStream,ws); ``` But didn't work. I also try to convert the output stri...
2017/07/11
[ "https://Stackoverflow.com/questions/45035665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291174/" ]
I resolved the problem changing the WorkbookSettings to: ``` WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding("Cp1252"); ``` I belived it is the format the file is.
You can also pass the JXL encoding as parameter for the JVM: ``` -Djxl.encoding=ISO-8859-1 ```
52,103,701
My xml code is : ``` <Spinner android:id="@+id/destination" android:layout_width="344dp" android:layout_height="30dp" android:autofillHints="Choose destination" android:spinnerMode="dropdown" /> ``` I want to add hint (without using dummy entry) as to be shown to user when the activity starts. Th...
2018/08/30
[ "https://Stackoverflow.com/questions/52103701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9153273/" ]
Are you sure you need a regex ? Something like this can calculate the ratio in a row : ``` >>> a = list('abce') >>> b = list('abcd') ( 100 - (sum(i != j for i, j in zip(key, 'air')) / float(len(a))) * 100 ) 75.0 ``` But if `b = list('bdce')` it will just be 50%
You may use this alternation based approach: ``` >>> key = 'rain' >>> l_word = int(len(key) *3 /4) >>> my_regex = re.compile(r'^' + key[0:l_word] + '|' + key[-l_word:] + '$') >>> print (my_regex.pattern) ^rai|ain$ >>> print bool(my_regex.search('air')) False >>> print bool(my_regex.search('12Qain')) True >>> print ...
52,103,701
My xml code is : ``` <Spinner android:id="@+id/destination" android:layout_width="344dp" android:layout_height="30dp" android:autofillHints="Choose destination" android:spinnerMode="dropdown" /> ``` I want to add hint (without using dummy entry) as to be shown to user when the activity starts. Th...
2018/08/30
[ "https://Stackoverflow.com/questions/52103701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9153273/" ]
Are you sure you need a regex ? Something like this can calculate the ratio in a row : ``` >>> a = list('abce') >>> b = list('abcd') ( 100 - (sum(i != j for i, j in zip(key, 'air')) / float(len(a))) * 100 ) 75.0 ``` But if `b = list('bdce')` it will just be 50%
This approach uses n-grams to allow for varying ratios and varying lengths of the key, while simultaneously ensuring that the letters must be continuous. ``` import re import math key = 'paint' n = math.ceil(len(key) * 0.75) # use ceiling for when len(key) * 3 is not a factor of 4 def ngrams(key, n): output = []...