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
44,421,711
I already have **oracle SQL developer** installed in my machine. I want to install another **oracle SQL developer** in my computer that I want to use for my personal web application. Of course I can work with one SQL developer, but in order to ease my maintenance I am planing to have two. So, do they conflict? Can I run my applications smoothly?
2017/06/07
[ "https://Stackoverflow.com/questions/44421711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7539039/" ]
yes you can have two copies of SQL Developer 'installed' on your computer. There's not an install process - there's nothing written to the registry for example, and there's no un-installer. You unzip the application to a directory, and run the EXE. SQL Developer will write its preferences to your User AppData Roaming profiles folder. If they're the same exact version #, they'll share a parent directory, but there is a system\_cache folder that can handle multiple instances of the app. The framework uses the system\_cache folder under user settings to ... 1. Speed up SQL Developer startup. 2. Persist certain settings if multiple instances are opened. Each additional instance creates a system\_cache\_N, where N=1,2,.. [![enter image description here](https://i.stack.imgur.com/Ud3Ty.jpg)](https://i.stack.imgur.com/Ud3Ty.jpg) In your scenario, I can't think why you would need to do this. You could simply start up the application twice - it would have the same net effect. > > > > > > So, do they conflict? Can I run my applications smoothly? > > No. And, yes. But you don't need to do this. > > > > > > > > >
Yes, you can have 2 instance of sql developer on same machine without conflicting each other. They both can share same TNS file if you want to or keep them separately. I have used 2 instances of it and never faced any issue. In my case they were or different version, but that doesn't matter.
20,543,746
In Rust 0.8: ``` struct TwoStr { one: ~str, two: ~str, } #[test] fn test_contents() { let strs = TwoStr { one: ~"pillar", two: ~"post", }; assert_eq!(strs.one, ~"pillar"); assert_eq!(strs.two, ~"post"); } ``` The code won't even compile. The `rust test` thinks there's an error in the second `assert_eq`: > > error: use of partially moved value: `strs` > > > It is somewhat counter-intuitive. I mean, whatever effects the first `assert_eq` may have, it should be well out of the scope when the execution reaches the second `assert_eq`. Unless of course, it does some spawn behind the scene. Does it? If not, why this mysterious error? Hopefully there's no fundamental flaws in my understanding of Rust pointers.
2013/12/12
[ "https://Stackoverflow.com/questions/20543746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794457/" ]
In Rust 0.8, `assert_eq!` is defined as ``` macro_rules! assert_eq ( ($given:expr , $expected:expr) => ( { let given_val = $given; let expected_val = $expected; // check both directions of equality.... if !((given_val == expected_val) && (expected_val == given_val)) { fail!(\"assertion failed: `(left == right) && (right == \ left)` (left: `%?`, right: `%?`)\", given_val, expected_val); } } ) ) ``` Note here that it moves both arguments into local let-bindings `given_val` and `expected_val`. This is what is causing your error. In current master, this has been fixed. `assert_eq!` now takes references to the arguments: ``` macro_rules! assert_eq ( ($given:expr , $expected:expr) => ( { let given_val = &($given); let expected_val = &($expected); // check both directions of equality.... if !((*given_val == *expected_val) && (*expected_val == *given_val)) { fail!("assertion failed: `(left == right) && (right == left)` \ (left: `{:?}`, right: `{:?}`)", *given_val, *expected_val) } } ) ) ``` This means that it no longer moves its arguments, which fixes your error. If you need to stick with rust 0.8, you can change this to using `assert!()` instead and do the comparison directly, which will avoid the move. But my recommendation is to upgrade to latest master.
It works on Git master. It must be a bug that was fixed after 0.8 was cut. In general, the released versions are not constrained to be particularly stable before release - they're essentially just snapshots. The definition of the `assert_eq!` macro, in [libsyntax](https://github.com/mozilla/rust/blob/a6310f6ad3434a03d5c257db5eae85b7b7522c29/src/libsyntax/ext/expand.rs#L768), takes references to the arguments, so the arguments should not be moved and you can use them after you call the macro. If you do find another bug, try to compile master if you can, or just make a new [issue](https://github.com/mozilla/rust/issues?direction=desc&sort=created&state=open).
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
Another way to do it would be this: ``` var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } ``` Then, when you use it, you call `Data.init()` in your initialization code to save the current values so they can be restored later with `Data.reset()`. This has the advantage that maintenance is easier. When you add or change a variable to your data structure, it is automatically incorporated into the reset function without you having to make any specific changes. You can see it work here: <http://jsfiddle.net/jfriend00/EtWfn/>.
Sounds simple enough. Would this work for you? ``` // after the Data structure is defined copy it to another variable var OriginalData = Data; // When you need to reset your Data to the Original values Data = OriginalData; ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
`Data` is a `dynamic` object. You could just add a function that will reset all the values: ``` var Data = { prop1: false, prop2: true, prop3: null, reset: function () { this.prop1 = false; this.prop2 = true; this.prop3 = null; } } ```
A more elegant way of copying default values without losing the reference: ``` function createData() { return { prop1: 1, prop2: 2, prop3: [3] reset: function() { Object.assign(this, createData()) } } } var data = createData() data.prop1 = "not default anymore" data.reset() console.log(data.prop1) // 1 ``` As mentioned earlier, you still need to remove properties that were added later if this is the case.
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
Another way to do it would be this: ``` var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } ``` Then, when you use it, you call `Data.init()` in your initialization code to save the current values so they can be restored later with `Data.reset()`. This has the advantage that maintenance is easier. When you add or change a variable to your data structure, it is automatically incorporated into the reset function without you having to make any specific changes. You can see it work here: <http://jsfiddle.net/jfriend00/EtWfn/>.
try that: ``` var Data = { prop1: false, prop2: true, prop3: null } var DataOriginal = { prop1: false, prop2: true, prop3: null } Data.prop1 = 'abc'; Data = DataOriginal; ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
The simplest way that avoids having to duplicate all of the default values is to just use a more traditional constructor and instantiate your Data object from there. Then when you need to reset you can just throw away your old object and instantiate a new one. Note: in the following code I've used the JS convention that functions intended to be used as object constructors start with an uppercase letter, and the variable referencing an instance starts with lowercase. ``` function Data() { this.prop1 = false; this.prop2 = true; this.prop3 = null; } var data = new Data(); data.prop1 = "abc"; // change some properties of data data.prop3 = "something else"; data = new Data(); // "reset" by getting a new instance ``` If you don't like having to use "new" you could just write a non-constructor style function that returns an object: ``` function getData() { return { prop1: false, prop2: true, prop3: null }; } var data = getData(); data.prop1 = "abc"; data = getData(); // reset ``` If for some reason you need the reset to keep the same actual instance rather than getting a new identical one then you will need to change the properties back one by one as per Frits van Campen's answer (you'd also need to add some code to delete any extra properties that were added along the way).
Sounds simple enough. Would this work for you? ``` // after the Data structure is defined copy it to another variable var OriginalData = Data; // When you need to reset your Data to the Original values Data = OriginalData; ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
A more elegant way of copying default values without losing the reference: ``` function createData() { return { prop1: 1, prop2: 2, prop3: [3] reset: function() { Object.assign(this, createData()) } } } var data = createData() data.prop1 = "not default anymore" data.reset() console.log(data.prop1) // 1 ``` As mentioned earlier, you still need to remove properties that were added later if this is the case.
There is a bug in a response above... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.init(); Data.reset(); alert(Data.prop3); ``` The "init" function allows you to mutate Original state after entering data by reentrancy. To protect against this the "init" function could be transformed by wrapping it in a closure (IIFE expression) , thus securing the original state and preventing mutation of the properties after the 1st call to the "init"... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init : function() { (() =>{ var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; })()}, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.reset(); alert(Data.prop3); ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
`Data` is a `dynamic` object. You could just add a function that will reset all the values: ``` var Data = { prop1: false, prop2: true, prop3: null, reset: function () { this.prop1 = false; this.prop2 = true; this.prop3 = null; } } ```
try that: ``` var Data = { prop1: false, prop2: true, prop3: null } var DataOriginal = { prop1: false, prop2: true, prop3: null } Data.prop1 = 'abc'; Data = DataOriginal; ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
Another way to do it would be this: ``` var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } ``` Then, when you use it, you call `Data.init()` in your initialization code to save the current values so they can be restored later with `Data.reset()`. This has the advantage that maintenance is easier. When you add or change a variable to your data structure, it is automatically incorporated into the reset function without you having to make any specific changes. You can see it work here: <http://jsfiddle.net/jfriend00/EtWfn/>.
The simplest way that avoids having to duplicate all of the default values is to just use a more traditional constructor and instantiate your Data object from there. Then when you need to reset you can just throw away your old object and instantiate a new one. Note: in the following code I've used the JS convention that functions intended to be used as object constructors start with an uppercase letter, and the variable referencing an instance starts with lowercase. ``` function Data() { this.prop1 = false; this.prop2 = true; this.prop3 = null; } var data = new Data(); data.prop1 = "abc"; // change some properties of data data.prop3 = "something else"; data = new Data(); // "reset" by getting a new instance ``` If you don't like having to use "new" you could just write a non-constructor style function that returns an object: ``` function getData() { return { prop1: false, prop2: true, prop3: null }; } var data = getData(); data.prop1 = "abc"; data = getData(); // reset ``` If for some reason you need the reset to keep the same actual instance rather than getting a new identical one then you will need to change the properties back one by one as per Frits van Campen's answer (you'd also need to add some code to delete any extra properties that were added along the way).
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
Another way to do it would be this: ``` var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } ``` Then, when you use it, you call `Data.init()` in your initialization code to save the current values so they can be restored later with `Data.reset()`. This has the advantage that maintenance is easier. When you add or change a variable to your data structure, it is automatically incorporated into the reset function without you having to make any specific changes. You can see it work here: <http://jsfiddle.net/jfriend00/EtWfn/>.
There is a bug in a response above... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.init(); Data.reset(); alert(Data.prop3); ``` The "init" function allows you to mutate Original state after entering data by reentrancy. To protect against this the "init" function could be transformed by wrapping it in a closure (IIFE expression) , thus securing the original state and preventing mutation of the properties after the 1st call to the "init"... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init : function() { (() =>{ var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; })()}, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.reset(); alert(Data.prop3); ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
`Data` is a `dynamic` object. You could just add a function that will reset all the values: ``` var Data = { prop1: false, prop2: true, prop3: null, reset: function () { this.prop1 = false; this.prop2 = true; this.prop3 = null; } } ```
There is a bug in a response above... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init: function() { var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; }, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.init(); Data.reset(); alert(Data.prop3); ``` The "init" function allows you to mutate Original state after entering data by reentrancy. To protect against this the "init" function could be transformed by wrapping it in a closure (IIFE expression) , thus securing the original state and preventing mutation of the properties after the 1st call to the "init"... ```js var Data = { prop1: false, prop2: true, prop3: null, // save initial values init : function() { (() =>{ var origValues = {}; for (var prop in this) { if (this.hasOwnProperty(prop) && prop != "origValues") { origValues[prop] = this[prop]; } } this.origValues = origValues; })()}, // restore initial values reset: function() { for (var prop in this.origValues) { this[prop] = this.origValues[prop]; } } } Data.init(); Data.prop1 = true; Data.prop2 = false; Data.prop3 = "xxx"; Data.reset(); alert(Data.prop3); ```
8,440,357
Here I want to reset all properties of Data to their original values, how I do that? ``` var Data = { prop1: false, prop2: true, prop3: null } Some code executes & sets Data.prop1 = "abc"; ``` I never instantiated Data, is that a problem?
2011/12/09
[ "https://Stackoverflow.com/questions/8440357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/314963/" ]
A more elegant way of copying default values without losing the reference: ``` function createData() { return { prop1: 1, prop2: 2, prop3: [3] reset: function() { Object.assign(this, createData()) } } } var data = createData() data.prop1 = "not default anymore" data.reset() console.log(data.prop1) // 1 ``` As mentioned earlier, you still need to remove properties that were added later if this is the case.
Sounds simple enough. Would this work for you? ``` // after the Data structure is defined copy it to another variable var OriginalData = Data; // When you need to reset your Data to the Original values Data = OriginalData; ```
25,505,002
i am using this T-SQL to repair my TFS suspected database ``` EXEC sp_resetstatus [TFS_Projects]; ALTER DATABASE [TFS_Projects] SET EMERGENCY DBCC checkdb([TFS_Projects]) ALTER DATABASE [TFS_Projects] SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB ([TFS_Projects], REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE [TFS_Projects] SET MULTI_USER ``` but when i use this T-SQL i will get error > > Database 'TFS\_Projects' cannot be opened due to inaccessible files or insufficient memory or disk space. > > > how can i repair my SQL database? i am using SQL Server 2012 **UPDATE 1:** this error will Occurred in line : > > DBCC checkdb([TFS\_Projects]) > > > **UPDATE 2:** i have 20GB free on hard drive that my mdf and ldf on it **UPDATE 3:** i can not chek Autogrow becuase when i right click on db the error will appear mdf and ldf is not readonly and i am loged in by windows administartor, and loged in sql server by sa
2014/08/26
[ "https://Stackoverflow.com/questions/25505002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742432/" ]
1) If possible add more hard drive space either by removing of unnecessary files from hard drive or add new hard drive with larger size. 2) Check if the database is set to Autogrow on. 3) Check if the account which is trying to access the database has enough permission to perform operation. 4) Make sure that .mdf and .ldf file are not marked as read only on operating system file system level. Found here: <http://blog.sqlauthority.com/2007/08/02/sql-server-fix-error-945-database-cannot-be-opened-due-to-inaccessible-files-or-insufficient-memory-or-disk-space-see-the-sql-server-error-log-for-details/>
Probably your database is corrupt either due to an unexpected server restart or filesystem corruption. You can use `CheckDB` to check for issues & remove the suspect status. However, the best bet is to restore it from a working backup. Some reasons for when this happens are 1. Database is corupted database files are being "opened" or held by some process (operating system, other program(s)...) 2. Not enough disk space for SQL Server 3. Insufficient memory (RAM) for SQL Server 4. Unexpected SQL Server shutdown caused by power failure [How to repair a suspect database](http://matijabozicevic.com/blog/sql-server-development/how-to-repair-a-suspect-database-in-sql-server)
25,505,002
i am using this T-SQL to repair my TFS suspected database ``` EXEC sp_resetstatus [TFS_Projects]; ALTER DATABASE [TFS_Projects] SET EMERGENCY DBCC checkdb([TFS_Projects]) ALTER DATABASE [TFS_Projects] SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB ([TFS_Projects], REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE [TFS_Projects] SET MULTI_USER ``` but when i use this T-SQL i will get error > > Database 'TFS\_Projects' cannot be opened due to inaccessible files or insufficient memory or disk space. > > > how can i repair my SQL database? i am using SQL Server 2012 **UPDATE 1:** this error will Occurred in line : > > DBCC checkdb([TFS\_Projects]) > > > **UPDATE 2:** i have 20GB free on hard drive that my mdf and ldf on it **UPDATE 3:** i can not chek Autogrow becuase when i right click on db the error will appear mdf and ldf is not readonly and i am loged in by windows administartor, and loged in sql server by sa
2014/08/26
[ "https://Stackoverflow.com/questions/25505002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742432/" ]
i update my answer becuase old answer is dangerous and will damage TFS database! this answer is from microsoft : <http://msdn.microsoft.com/en-us/library/jj620932.aspx> > > **To back up your databases** > > > > > > > Launch TFSBackup.exe. > > The TFSBackup.exe tool is in the Tools folder where you installed Team Foundation Server. The default location is C:\Program Files\Microsoft Team Foundation Server 12.0\Tools. > > In Source SQL Server Instance, enter the name of the SQL Server instance that hosts the TFS databases you want to back up and choose Connect. > > In Select databases to backup, choose the databases to back up. > > Need help? List of TFS 2010 databases on MSDN; List of TFS 2012 databases on MSDN. > > In Backup Databases to, enter the name of a network share that is configured with read/write access for Everyone, or accept the default location in the file system of the SQL Server you connected to in step 2. > > Note Note > > If you want to overwrite backups stored in this network location, you can choose Overwrite existing database backups at this location. > > Choose Backup Now. > > The Backup tool reports progress on each database being backed up. > > Choose Close. > > Restore your data > > > > > > > > > **To restore your TFS data** > > > > > > > Launch TFSRestore.exe. > > The TFSRestore.exe tool is in the Tools folder where you installed Team Foundation Server. The default location is C:\Program Files\Microsoft Team Foundation Server 12.0\Tools. > > In Target SQL Server Instance, enter the SQL Server instance you will use as the data tier and choose Connect. > > Choose Add Share and enter the UNC path to the network share that is configured with read/write access to Everyone where you stored the backups of your TFS data. For example, \servername\sharename. > > If the backup files are located on the file system of the server that is running TFSRestore.exe, you can use the drop down box to select a local drive. > > Note Note > > The service account for the instance of SQL Server you identified at the start of this procedure must have read access to this share. > > In the left hand navigation pane, choose the network share or local disk you identified in the previous step. > > The TFS Restore Tool displays the database backups stored on the file share. > > Select the check boxes for the databases you want to restore to the SQL Server you identified at the start of this procedure. > > Important note Important > > For SharePoint, you must only restore the WSS\_Content database. Do not restore the WSS\_AdminContent or WSS\_Config databases. You want the new SharePoint Foundation versions of these databases, not the ones from the previous version of SharePoint or from a SharePoint installation running on any other server. > > Choose Overwrite the existing database(s) and then choose Restore. > > The Database Restore Tool restores your data and displays progress reports. > > Choose Close. > > > > > > > > >
1) If possible add more hard drive space either by removing of unnecessary files from hard drive or add new hard drive with larger size. 2) Check if the database is set to Autogrow on. 3) Check if the account which is trying to access the database has enough permission to perform operation. 4) Make sure that .mdf and .ldf file are not marked as read only on operating system file system level. Found here: <http://blog.sqlauthority.com/2007/08/02/sql-server-fix-error-945-database-cannot-be-opened-due-to-inaccessible-files-or-insufficient-memory-or-disk-space-see-the-sql-server-error-log-for-details/>
25,505,002
i am using this T-SQL to repair my TFS suspected database ``` EXEC sp_resetstatus [TFS_Projects]; ALTER DATABASE [TFS_Projects] SET EMERGENCY DBCC checkdb([TFS_Projects]) ALTER DATABASE [TFS_Projects] SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB ([TFS_Projects], REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE [TFS_Projects] SET MULTI_USER ``` but when i use this T-SQL i will get error > > Database 'TFS\_Projects' cannot be opened due to inaccessible files or insufficient memory or disk space. > > > how can i repair my SQL database? i am using SQL Server 2012 **UPDATE 1:** this error will Occurred in line : > > DBCC checkdb([TFS\_Projects]) > > > **UPDATE 2:** i have 20GB free on hard drive that my mdf and ldf on it **UPDATE 3:** i can not chek Autogrow becuase when i right click on db the error will appear mdf and ldf is not readonly and i am loged in by windows administartor, and loged in sql server by sa
2014/08/26
[ "https://Stackoverflow.com/questions/25505002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742432/" ]
i update my answer becuase old answer is dangerous and will damage TFS database! this answer is from microsoft : <http://msdn.microsoft.com/en-us/library/jj620932.aspx> > > **To back up your databases** > > > > > > > Launch TFSBackup.exe. > > The TFSBackup.exe tool is in the Tools folder where you installed Team Foundation Server. The default location is C:\Program Files\Microsoft Team Foundation Server 12.0\Tools. > > In Source SQL Server Instance, enter the name of the SQL Server instance that hosts the TFS databases you want to back up and choose Connect. > > In Select databases to backup, choose the databases to back up. > > Need help? List of TFS 2010 databases on MSDN; List of TFS 2012 databases on MSDN. > > In Backup Databases to, enter the name of a network share that is configured with read/write access for Everyone, or accept the default location in the file system of the SQL Server you connected to in step 2. > > Note Note > > If you want to overwrite backups stored in this network location, you can choose Overwrite existing database backups at this location. > > Choose Backup Now. > > The Backup tool reports progress on each database being backed up. > > Choose Close. > > Restore your data > > > > > > > > > **To restore your TFS data** > > > > > > > Launch TFSRestore.exe. > > The TFSRestore.exe tool is in the Tools folder where you installed Team Foundation Server. The default location is C:\Program Files\Microsoft Team Foundation Server 12.0\Tools. > > In Target SQL Server Instance, enter the SQL Server instance you will use as the data tier and choose Connect. > > Choose Add Share and enter the UNC path to the network share that is configured with read/write access to Everyone where you stored the backups of your TFS data. For example, \servername\sharename. > > If the backup files are located on the file system of the server that is running TFSRestore.exe, you can use the drop down box to select a local drive. > > Note Note > > The service account for the instance of SQL Server you identified at the start of this procedure must have read access to this share. > > In the left hand navigation pane, choose the network share or local disk you identified in the previous step. > > The TFS Restore Tool displays the database backups stored on the file share. > > Select the check boxes for the databases you want to restore to the SQL Server you identified at the start of this procedure. > > Important note Important > > For SharePoint, you must only restore the WSS\_Content database. Do not restore the WSS\_AdminContent or WSS\_Config databases. You want the new SharePoint Foundation versions of these databases, not the ones from the previous version of SharePoint or from a SharePoint installation running on any other server. > > Choose Overwrite the existing database(s) and then choose Restore. > > The Database Restore Tool restores your data and displays progress reports. > > Choose Close. > > > > > > > > >
Probably your database is corrupt either due to an unexpected server restart or filesystem corruption. You can use `CheckDB` to check for issues & remove the suspect status. However, the best bet is to restore it from a working backup. Some reasons for when this happens are 1. Database is corupted database files are being "opened" or held by some process (operating system, other program(s)...) 2. Not enough disk space for SQL Server 3. Insufficient memory (RAM) for SQL Server 4. Unexpected SQL Server shutdown caused by power failure [How to repair a suspect database](http://matijabozicevic.com/blog/sql-server-development/how-to-repair-a-suspect-database-in-sql-server)
442,001
My problem is that I want to delete the title "references" of thebibliography environment. I would like to build a `\section{7 REFERENCES}` and then use `\vspace{-xxcm}` to move the \bibitem that I wrote. I'm using article, and I do not want to use biblatex ou bibtex. Furthermore, I'm not a advanced user so I appreciate simple (if exists of course) ways to solve.[![enter image description here](https://i.stack.imgur.com/DkE9Q.png)](https://i.stack.imgur.com/DkE9Q.png) obs: Commands like `\renewcommand\refname{Reference}` simply didn't work in my case.
2018/07/17
[ "https://tex.stackexchange.com/questions/442001", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/153347/" ]
You said that using the `\renewcommand ...` approach did not work for you. However, the command you gave (`\renewcommand\refname{Reference}`) does not remove the heading but sets the heading to "Reference". Try `\renewcommand{\refname}{}`, which overwrites to heading to be blank (the `{}` part)
The way to do it depends on wether you are using the babel package or not, and on the documentcalss you are using. If you are using babel use: ``` \addto{\captionsLANGUAGE>}{\renewcommand{\refname}{{TITLE}}} ``` If you are **not** using babel use: ``` \renewcommand{\refname}{TITLE} ``` In TITLE goes the title you want, in LANGUAGE goes the language you are using. You have to put this line before the `\begin{document}` statement. Depending on the documentclass you are using, it might be necessary to replace`\refname` with `\bibname` (for example, *article* uses `\refname` while *book* uses`\bibname`). Use one of the following commands in case the previous did not work for you: If you are using babel: ``` \addto{\captionsLANGUAGE}{\renewcommand{\bibname}{{TITLE}}} ``` If you are **not** using babel: ``` \renewcommand{\bibname}{TITLE} ``` Here is an example using the babel package in portuguese language, and *article* as the documentclass: ``` \documentclass{article} \usepackage[portuguese]{babel} \addto{\captionsportuguese}{\renewcommand{\refname}{{7 REFERÊNCIAS}}} \begin{document} \section*{7 REFERÊNCIAS} \begin{thebibliography}{widest entry} \bibitem[1]{item1} {Item 1 bib} \end{thebibliography} \end{document} ``` [![Example 1](https://i.stack.imgur.com/pKQ7g.png)](https://i.stack.imgur.com/pKQ7g.png) To get what you asked for, you have two options: to remove the section line, or to set blank the bibliography title. In the following code, we do the latter: ``` \documentclass{article} \usepackage[portuguese]{babel} \addto{\captionsportuguese}{\renewcommand{\refname}{{}}} % Here is the change \begin{document} \section*{7 REFERÊNCIAS} \begin{thebibliography}{widest entry} \bibitem[1]{item1} {Item 1 bib} \end{thebibliography} \end{document} ``` [![Example 2](https://i.stack.imgur.com/c6A9m.png)](https://i.stack.imgur.com/c6A9m.png) Hope this answer your question.
73,903,446
``` mydat <- data.frame(name = c("James", "James", "James", "James", "Leila", "Leila", "Cici", "Bob", "Bob", "Holly", "Topaz", "Topaz"), code = c(123, 928, 981, 333, 981, 928, 463, 123, 928, 981, 333, 444)) > mydat name code 1 James 123 2 James 928 3 James 981 4 James 333 5 Leila 981 6 Leila 928 7 Cici 463 8 Bob 123 9 Bob 928 10 Holly 981 11 Topaz 333 12 Topaz 444 ``` In `mydat`, each person can have multiple `code`s associated with it. I want to tabulate the `code` column and assign the person the code that is most common. ``` > rbind(table(mydat), Total = colSums(table(mydat))) 123 333 444 463 928 981 Bob 1 0 0 0 1 0 Cici 0 0 0 1 0 0 Holly 0 0 0 0 0 1 James 1 1 0 0 1 1 Leila 0 0 0 0 1 1 Topaz 0 1 1 0 0 0 Total 2 2 1 1 3 3 ``` Bob has `code`s 123 and 928. Since 928 appears more often across `mydat` than 123, Bob will be assigned a `code` of 928. Cici has `code` 463, so Cici will be assigned a code of 463. Holly has `code` 981, so Holly will be assigned a code of 981. James has `code`s 123, 333, 928, and 981. Since 928 and 981 both appear more frequently than 123 and 333, James will be assigned `code`s 928 and 981. The final output should be: ``` > final_mydat name final_code 1 Bob 928 2 Cici 463 3 Holly 981 4 James 928 5 James 981 6 Leila 928 7 Leila 981 8 Topaz 333 ``` Is there a quick way to do this in R?
2022/09/30
[ "https://Stackoverflow.com/questions/73903446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3391549/" ]
``` library(dplyr) mydat %>% add_count(code) %>% group_by(name) %>% slice_max(n) %>% ungroup() # # A tibble: 8 × 3 # name code n # <chr> <dbl> <int> # 1 Bob 928 3 # 2 Cici 463 1 # 3 Holly 981 3 # 4 James 928 3 # 5 James 981 3 # 6 Leila 981 3 # 7 Leila 928 3 # 8 Topaz 333 2 ``` Add `... %>% select(-n)` if you want to get rid of the `n` column.
In base R we can do ``` by(transform(mydat, score=ave(code, code, FUN=length)), mydat$name, \(x) { with(x, x[score == max(score), ])}) |> c(make.row.names=FALSE) |> do.call(what=rbind) # name code score # 1 Bob 928 3 # 2 Cici 463 1 # 3 Holly 981 3 # 4 James 928 3 # 5 James 981 3 # 6 Leila 981 3 # 7 Leila 928 3 # 8 Topaz 333 2 ```
9,531,863
I have a asp .net web page(MVC) displaying 10,000 products. For this I am using a method. In that method I have to call an external web service 20 times. This is because the web service gives me 500 data at a time, so to get 10000 data I need to call the service 20 times. 20 calls makes the page load slow. Now I need to increase the performance. Since web service is external I cannot make changes there. Threading is an option I thought of. Since I can use page numbers (service is paging for the data) each service call is almost independent. Another option is using parallel linq. Should I use parallel linq, or choose threading? Someone please guide me here. Or let me know another way to achieve this. Note : this web page can be used by many users at a time. We have filters left side of the page.for that we need all the 10,000 data to construct filter.Otherwise pagewise info could have been enough.and caching is not possible since the huge overload on the server. at a time 400-1000 users can hit server.web service response time is 10 second so that we can hit them many time We have to hit the service 20 times to get all data.Now i need a solution to improve that hit.Is threading is the only option?
2012/03/02
[ "https://Stackoverflow.com/questions/9531863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117077/" ]
If you can't cache the data from the service, then just get the data you need, when you need to display it. I very much doubt that somebody wants to see all 10000 products on a single web page, and if they do, there is probably something wrong!
Threads, parallel linq will not help you here. Parallel Linq is meant for lots of CPU work to be shared over CPU cores, what you want to do is make 20 web requests at the same time. You will need to use threading to do that. You'll probably want to use the built in async capability of HttpWebRequest (see [BeginGetResponse](http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse.aspx)).
9,531,863
I have a asp .net web page(MVC) displaying 10,000 products. For this I am using a method. In that method I have to call an external web service 20 times. This is because the web service gives me 500 data at a time, so to get 10000 data I need to call the service 20 times. 20 calls makes the page load slow. Now I need to increase the performance. Since web service is external I cannot make changes there. Threading is an option I thought of. Since I can use page numbers (service is paging for the data) each service call is almost independent. Another option is using parallel linq. Should I use parallel linq, or choose threading? Someone please guide me here. Or let me know another way to achieve this. Note : this web page can be used by many users at a time. We have filters left side of the page.for that we need all the 10,000 data to construct filter.Otherwise pagewise info could have been enough.and caching is not possible since the huge overload on the server. at a time 400-1000 users can hit server.web service response time is 10 second so that we can hit them many time We have to hit the service 20 times to get all data.Now i need a solution to improve that hit.Is threading is the only option?
2012/03/02
[ "https://Stackoverflow.com/questions/9531863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117077/" ]
If you can't cache the data from the service, then just get the data you need, when you need to display it. I very much doubt that somebody wants to see all 10000 products on a single web page, and if they do, there is probably something wrong!
Consider calling that service asyncrhonously. Most of delay in calling webservice is caused by IO operations that can be done simultaneously. But getting 10000 items per each request is something very scarry :)
418,968
Ok, I have 2 very different values for degree of freedom(DOF) of diatomic molecules arising due to the difference in the vibrational DOF of the diatomic molecules. According to this [DOF wiki page](https://en.wikipedia.org/wiki/Degrees_of_freedom_(physics_and_chemistry)):- Under *Gas molecules section*, one can see the Vibrational DOF of linear molecules, which is $3N-5$. So, putting $N=2$, *Vibrational DOF(Diatomic Molecule)=1* and so, **Total DOF(Diatomic Molecule)=6** In other wiki page namely, [Molecular Vibration](https://en.wikipedia.org/wiki/Molecular_vibration):- It says > > A diatomic molecule has one normal mode of vibration. > > > But my textbook says otherwise. It's says the *vibration contributes 2 to total DOF of diatomic molecule* and so, **Total DOF(Diatomic Molecule)=7** Here's the image:- [![](https://i.stack.imgur.com/UhQoM.jpg)](https://i.stack.imgur.com/UhQoM.jpg) A [VIDEO](https://www.youtube.com/watch?v=IDANRDPDt84) also says as per my textbook. **Look under the *Syed Sumaid* comment**. There he explained why vibrational DOF of diatomic molecule should be 2 not 1(According to him). I am not able to understand which one is delivering the right information. *Is it 7 DOF as per my book/that video or 6 DOF as per the wiki links I have given?*
2018/07/22
[ "https://physics.stackexchange.com/questions/418968", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/155995/" ]
The term 'degrees of freedom' is ambiguous. In dynamics, and actually in most areas, it means the number of independent parameters needed to describe the system. These can be expressed in different ways (such as cartesian or polar co-ordinates) but the number is always the same. So a diatomic molecule has 6. (If the bond were rigid it would have 5.) In thermodynamics a 'degree of freedom' is a quadratic term in the energy. Each of these 'degrees of freedom' contributes ${1 \over 2} kT$ to the energy (classically). Often these match. A particle described by a co-ordinate $x$ (dynamic d.o.f.) has a kinetic energy contribution ${1\over 2} m \dot x^2$ (thermal d.o.f.), likewise $y$ and $z$, likewise angles and inertia. But for a spring, which corresponds to 1 (dynamic) degree of freedom there are two (thermal) degrees of freedom from two quadratic terms ${1 \over 2 } \mu \dot \xi^2+{1\over 2} k \xi^2$. Same story for polyatomic molecules but even more complicated. So diatomic molecule has 6 dynamic degrees of freedom and 7 thermal degrees of freedom. If a test paper asks 'How many d.o.f. has a diatomic molecule?' check the title of the paper before answering.
The textbook is correct, there are 7 degrees of freedom if the molecules are vibrating. The statement "a diatomic molecule has one normal mode of vibration" is true, however this vibrational energy has a kinetic energy $K=\frac{1}{2}m\dot\eta^2$ and a potential energy $U=\frac{1}{2}k\eta^2$ such that $\epsilon\_v=K+U$. Two degrees of freedom from the vibration plus three degrees of freedom $\epsilon\_t=\frac{1}{2}m(v\_x^2+v\_y^2+v\_z^2)$ for the $(x,y,z)$ translational kinetic energy plus two degrees of freedom $\epsilon\_r=\frac{1}{2}I\_y\omega\_y^2+\frac{1}{2}I\_z\omega\_z^2$ for the rotational kinetic energy adds up to seven total degrees of freedom. The rotational kinetic energy $\frac{1}{2}I\_x\omega\_x^2$ along the axis of the bond is zero because for diatomic molecules $I\_x\approx0$.
15,144,602
Here's a screen capture of my app. I'm using UIKit to create a PDF from some of the app data. I get no errors on the app itself but in the test section I get a bunch of them that look like the app can't find some CoreGraphics references. But CG is being imported in Tests.h... I can run the app, on simulator and device with no problems. Any idea what is causing this? To add a little more to this: I imported the class where I am making the PDF into another application and I am not getting the errors there, so that's good. So any ideas what could be happening? (And yes, the libraries are in my app) ![enter image description here](https://i.stack.imgur.com/txCaT.png)
2013/02/28
[ "https://Stackoverflow.com/questions/15144602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/468455/" ]
It is being imported but not linked. You need to link the CoreGraphics framework: Importing a class header A into class B allows class B to know what public API (variables, properties and methods) in class A can be used by other classes and that is why you do not get any errors until you compile. When you compile, you need the actual code (.m file if you will) to be able to execute the calls that class B is doing to class A variables, properties and methods. That code resides in the libraries/ frameworks you link to your project. Your code with the linked libraries together become the final compiled code. Here is what you need to do: 1. Single click on your project (top left of the navigator) 2. Select your Target project 3. Click on the "Build Phases" tab 4. Click on "Link Binary with Libraries" 5. Add CoreGraphics.framework That should solve it.
I solved it. I removed the libraries, reinstalled them and did a clean and that seemed to fix the issue.
160,131
I read [How can I copy a file and create the target directories at the same time?](https://unix.stackexchange.com/questions/41770/how-can-i-copy-a-file-and-create-the-target-directories-at-the-same-time) But the solution there only works if you want to copy **one** file. How would I copy multiple files into a directory, that doesn't exist yet and auto-create it with one command? for example: ``` cd /tmp/ mkdir a/ cd a/ touch x1 x2 cp --magic * ../b/c/d/ ``` so in the end the two files `x1` and `x2` are ordered like this: ``` /tmp/b/c/d/x1 /tmp/b/c/d/x2 ```
2014/10/08
[ "https://unix.stackexchange.com/questions/160131", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/20661/" ]
Use: ``` $ copy() { mkdir -p -- "${@: -1}" && cp -- "$@" ; } $ copy * ../b/c/d/ ``` Note: it works with bash, ksh93 and zsh. `"${@: -1}"` corresponds to the `${parameter:offset}` form: all parameters starting at the offset. The offset -1 corresponds to the last parameter, since negative offsets count from the end. The space is necessary, otherwise it would be the `${parameter:-word}` form. See the bash manual for more information. `"$@"` expands to the list of parameters, which is what is wanted for `cp`. Note 2: As suggested by mikeserv, you can use ``` eval 'mkdir -p -- "${'"$#"'}"' ``` which is more portable (POSIX), instead of ``` mkdir -p -- "${@: -1}" ``` Concerning the performance, the `eval` solution is much faster with bash 4.3.30, but the other solution is faster with ksh 93u+ and zsh 5.0.6 (ksh93 and zsh being much faster than bash in both cases); and dash 5.7 with the `eval` solution (the other one is not supported) is a bit faster than ksh93 with the `"${@: -1}"` solution. So, depending on your case (script, interactive use, support for specific shell features, etc.), make your choice... Note however that in the context of `cp` (which will take most of the time), these performance differences won't be noticeable. The script I used for the test: ``` i=50000 while [ $i -ne 0 ]; do # : "${@: -1}" eval ': "${'"$#"'}"' i=$((i-1)) done ``` (comment out the `eval` line and uncomment the previous line for the other solution), called with: ``` time sh ./tst `seq 1000` time bash ./tst `seq 1000` time ksh93 ./tst `seq 1000` time zsh ./tst `seq 1000` ```
I had this same problem and used `tar` to solve it! Like so: ``` tmpfile=/tmp/myfile.tar files="/some/folder/file1.txt /some/other/folder/file2.txt" targetfolder=/home/you/somefolder tar --file="$tmpfile" "$files"​ tar --extract --file="$tmpfile" --directory="$targetfolder" ``` In this case, `tar` will automatically create all (sub)folders for you! Best, Nabi
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
OK, I had a look at the page in IE6. Some tips. 1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is *much* easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out. 2. As bobince says, table-layout:fixed on the signupTable1 will help a lot 3. Also, for IE6, giving the td containing "welcome" a height of 100% helps. 4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this. Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.
Your page declares an XHTML doctype, yet it is not valid XHTML: <http://validator.w3.org/check?uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F&charset=%28detect+automatically%29&doctype=Inline&group=0> Furthermore, it's returned with a content-type header "text/html", which is *wrong* for something that's supposed to be XHTML. Unfortunately, [the correct content type will not work either](http://hixie.ch/advocacy/xhtml). So there are two things you have to do: * Don't use XHTML * Make your HTML validate *Then* you can start thinking about actual browser incompatibilities.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages. You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.) Also, I'd recommend you download a Tool like [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7. Then, really make sure your page is [valid](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F). (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it. On the long run, these tools are going to be very helpful: * [Firebug in Firefox](https://addons.mozilla.org/de/firefox/addon/60) (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information * The [Web Developer Toolbar in IE8](http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar) (press F12 to open it) that is similar to, if not as powerful, as Firebug.
If I were you, I would not bust my guts trying to make the site work for ancient browsers like IE 6. Indeed, one could argue that you would be doing the world a favor if you made your site *refuse to work* with IE6. Anything that can help to push IE6 into the grave is a good thing. If Google can say that IE6 is no longer supported ... so can you. Now if you were building this site as a money-making exercise, and demographic included a significant percentage of IE6 users, maybe the pain of supporting ancient non-standards-compliant browsers would be worth it. But otherwise, I'd say it is not.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages. You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.) Also, I'd recommend you download a Tool like [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7. Then, really make sure your page is [valid](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F). (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it. On the long run, these tools are going to be very helpful: * [Firebug in Firefox](https://addons.mozilla.org/de/firefox/addon/60) (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information * The [Web Developer Toolbar in IE8](http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar) (press F12 to open it) that is similar to, if not as powerful, as Firebug.
First, make both your HTML and CSS to validate: * HTML validator: <http://validator.w3.org/> * CSS validator: <http://jigsaw.w3.org/css-validator/> Then, if your valid code still fails in particular browser, find the problematic HTML element using the browser's debugging / inspection tools: * Safari / Chrome: built-in Inspector * Firefox: separate plugin, among the best is [Firebug](http://www.getfirebug.com/) * IE8: built-in [Developer Tools](http://msdn.microsoft.com/en-us/library/dd565628(v=VS.85).aspx) * IE6/7: must be [downloaded and installed from Microsoft](http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en) * Opera: built-in Developer Tools As long as you use valid [CSS 2.1](http://www.w3.org/TR/CSS2/cover.html#minitoc), differences between modern browsers should be minimal or almost non-existent. Yes, modern browsers do very good job in implementing standards, especially if you avoid bleeding-edge not-yet-fully-standardized techniques (CSS3, HTML5). (We are forgiving and count IE8 as "modern" here despite its CSS 2.1-only support, PNG issues, slow JS speed, etc.) Oh, one thing not related to validness: always remember that many UI elements (fonts, buttons, etc.) are **not** rendered in exactly equal sizes in different browsers / platforms. Also screen sizes may vary largely due to popularity of mobile browsing. That's why you should prefer elastic / fluid layouts and not rely on pixel-perfect rendering. Most IE 6/7 bugs are [the same old common ones repeating](http://www.google.com/search?client=safari&rls=en&q=most+common+ie6+bugs&ie=UTF-8&oe=UTF-8) and there are plenty of [resources about fixing them](http://www.virtuosimedia.com/tutorials/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs). Create separated stylesheet(s) for IE(s) and include them by using [conditional comments](http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx). As a final comment, as long as open standards / technologies are used, personally I couldn't care less supporting a decade old browser, except in form of [graceful degration](http://www.css3.info/graceful-degradation/), unless I'm paid generously for that. Browsers are free to upgrade, there are no reasons not to do that. No excuses. World is not static, show must go on, you won't see HD with your old tube telly, etc. I also think it's our responsibility as web developers to force the big masses to adopt new (open) technologies, because they save huge amount of our time, makes possible to create better end-user experience, etc., the list of benefits is endless. Again comparison to other industry: consumer electronics companies keep pushing out new things, although most people would happily use 20 years old tech unless forced to upgrade their (naturally conservative) mindsets.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
OK, I had a look at the page in IE6. Some tips. 1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is *much* easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out. 2. As bobince says, table-layout:fixed on the signupTable1 will help a lot 3. Also, for IE6, giving the td containing "welcome" a height of 100% helps. 4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this. Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.
The messed-up borders around the ‘welcome’ box and the wonky centering is because you're using ‘auto layout’ tables for page layout. This leaves you at the mercy of the auto table layout algorithm, which is complicated, unreliable, and a bit broken in IE. For places where you must use tables for anything more complicated than simple data, set `table-layout: fixed` on the `<table>` and add explicit `width` styles on either the first row of `<td>`​s, or on `<col/>` elements just inside the table. Columns you leave without a `width` style will share the remaining spare width between them. Set an explicit height on the rows containing fixed size images to stop them sharing the table height. However, for the main page layout here you would be *much* better off using CSS positioning or floats rather than tables. You can use nested divs (each with a separate background image) to achieve the image border effect without resorting to tables.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
OK, I had a look at the page in IE6. Some tips. 1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is *much* easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out. 2. As bobince says, table-layout:fixed on the signupTable1 will help a lot 3. Also, for IE6, giving the td containing "welcome" a height of 100% helps. 4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this. Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.
First, make both your HTML and CSS to validate: * HTML validator: <http://validator.w3.org/> * CSS validator: <http://jigsaw.w3.org/css-validator/> Then, if your valid code still fails in particular browser, find the problematic HTML element using the browser's debugging / inspection tools: * Safari / Chrome: built-in Inspector * Firefox: separate plugin, among the best is [Firebug](http://www.getfirebug.com/) * IE8: built-in [Developer Tools](http://msdn.microsoft.com/en-us/library/dd565628(v=VS.85).aspx) * IE6/7: must be [downloaded and installed from Microsoft](http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en) * Opera: built-in Developer Tools As long as you use valid [CSS 2.1](http://www.w3.org/TR/CSS2/cover.html#minitoc), differences between modern browsers should be minimal or almost non-existent. Yes, modern browsers do very good job in implementing standards, especially if you avoid bleeding-edge not-yet-fully-standardized techniques (CSS3, HTML5). (We are forgiving and count IE8 as "modern" here despite its CSS 2.1-only support, PNG issues, slow JS speed, etc.) Oh, one thing not related to validness: always remember that many UI elements (fonts, buttons, etc.) are **not** rendered in exactly equal sizes in different browsers / platforms. Also screen sizes may vary largely due to popularity of mobile browsing. That's why you should prefer elastic / fluid layouts and not rely on pixel-perfect rendering. Most IE 6/7 bugs are [the same old common ones repeating](http://www.google.com/search?client=safari&rls=en&q=most+common+ie6+bugs&ie=UTF-8&oe=UTF-8) and there are plenty of [resources about fixing them](http://www.virtuosimedia.com/tutorials/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs). Create separated stylesheet(s) for IE(s) and include them by using [conditional comments](http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx). As a final comment, as long as open standards / technologies are used, personally I couldn't care less supporting a decade old browser, except in form of [graceful degration](http://www.css3.info/graceful-degradation/), unless I'm paid generously for that. Browsers are free to upgrade, there are no reasons not to do that. No excuses. World is not static, show must go on, you won't see HD with your old tube telly, etc. I also think it's our responsibility as web developers to force the big masses to adopt new (open) technologies, because they save huge amount of our time, makes possible to create better end-user experience, etc., the list of benefits is endless. Again comparison to other industry: consumer electronics companies keep pushing out new things, although most people would happily use 20 years old tech unless forced to upgrade their (naturally conservative) mindsets.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages. You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.) Also, I'd recommend you download a Tool like [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7. Then, really make sure your page is [valid](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F). (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it. On the long run, these tools are going to be very helpful: * [Firebug in Firefox](https://addons.mozilla.org/de/firefox/addon/60) (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information * The [Web Developer Toolbar in IE8](http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar) (press F12 to open it) that is similar to, if not as powerful, as Firebug.
It looks the same in Firefox 3.6.2 as in Internet Explorer 8. However the old browsers are the evil ones: search the web for Internet Explorer + margin, because thats where Internet Explorer fails. Simple trick: do not use margin. ``` position:absolute; top: 80% left: 100px; ``` And then... google for specific stuff :)
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages. You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.) Also, I'd recommend you download a Tool like [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7. Then, really make sure your page is [valid](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F). (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it. On the long run, these tools are going to be very helpful: * [Firebug in Firefox](https://addons.mozilla.org/de/firefox/addon/60) (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information * The [Web Developer Toolbar in IE8](http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar) (press F12 to open it) that is similar to, if not as powerful, as Firebug.
Ok I fixed 2 errors finally figured them out changed ``` #loginForm { float: right; } #loginTable { margin: 20%; margin-top: 14%; } ``` to ``` #loginForm { float: right; margin-right: 5%; margin-top: 2.5%; } #loginTable { } ``` and added ``` <!--[if lte IE 7]> <style type = "text/css"> #loginForm{margin-top:-157px} </style> <![endif]--> ``` not a solution I like but one I will have to deal with. Ok still leaves the issue of I hear there is a 100% height problem and my horizontal borders wont stay the correct width.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
OK, I had a look at the page in IE6. Some tips. 1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is *much* easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out. 2. As bobince says, table-layout:fixed on the signupTable1 will help a lot 3. Also, for IE6, giving the td containing "welcome" a height of 100% helps. 4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this. Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.
If I were you, I would not bust my guts trying to make the site work for ancient browsers like IE 6. Indeed, one could argue that you would be doing the world a favor if you made your site *refuse to work* with IE6. Anything that can help to push IE6 into the grave is a good thing. If Google can say that IE6 is no longer supported ... so can you. Now if you were building this site as a money-making exercise, and demographic included a significant percentage of IE6 users, maybe the pain of supporting ancient non-standards-compliant browsers would be worth it. But otherwise, I'd say it is not.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages. You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.) Also, I'd recommend you download a Tool like [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7. Then, really make sure your page is [valid](http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F). (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it. On the long run, these tools are going to be very helpful: * [Firebug in Firefox](https://addons.mozilla.org/de/firefox/addon/60) (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information * The [Web Developer Toolbar in IE8](http://en.wikipedia.org/wiki/Internet_Explorer_Developer_Toolbar) (press F12 to open it) that is similar to, if not as powerful, as Firebug.
The messed-up borders around the ‘welcome’ box and the wonky centering is because you're using ‘auto layout’ tables for page layout. This leaves you at the mercy of the auto table layout algorithm, which is complicated, unreliable, and a bit broken in IE. For places where you must use tables for anything more complicated than simple data, set `table-layout: fixed` on the `<table>` and add explicit `width` styles on either the first row of `<td>`​s, or on `<col/>` elements just inside the table. Columns you leave without a `width` style will share the remaining spare width between them. Set an explicit height on the rows containing fixed size images to stop them sharing the table height. However, for the main page layout here you would be *much* better off using CSS positioning or floats rather than tables. You can use nested divs (each with a separate background image) to achieve the image border effect without resorting to tables.
2,565,853
I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[ You just got to see it to know what I'm talking about so here is the link: <http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/> Please give solutions that don't involve JavaScript.
2010/04/02
[ "https://Stackoverflow.com/questions/2565853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293307/" ]
OK, I had a look at the page in IE6. Some tips. 1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is *much* easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out. 2. As bobince says, table-layout:fixed on the signupTable1 will help a lot 3. Also, for IE6, giving the td containing "welcome" a height of 100% helps. 4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this. Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.
It looks the same in Firefox 3.6.2 as in Internet Explorer 8. However the old browsers are the evil ones: search the web for Internet Explorer + margin, because thats where Internet Explorer fails. Simple trick: do not use margin. ``` position:absolute; top: 80% left: 100px; ``` And then... google for specific stuff :)
28,402,585
I downloaded the jdk and netbeans am trying to install it but the error appears to me > > cannot prepare bundled jvm to run the installer > > > How can I fix this issue?
2015/02/09
[ "https://Stackoverflow.com/questions/28402585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3975271/" ]
Always check version of downloaded installer. If you have x64 system, and your installer is dedicated for x86 systems you will also see this error. ``` Cannot prepare bundled JVM to run the installer. ```
Look here: <https://netbeans.org/bugzilla/show_bug.cgi?id=203431> (you should install ia32-libs, if you have Ubuntu/Debian)
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
Google Ngram data provides a little insight although the introduction of the Segway was quite recent. There does seem to be a dip in the use of 'segue' since around 2003 which coincides somewhat with the rise of the Segway in the common consciousness. ![Google Books Ngram for 'segue' vs 'Segway'](https://i.stack.imgur.com/I4a4z.png) Perhaps 'segue' is at a disadvantage owing to its not having what might be called an 'intuitive' spelling. Hence the more phonetically appealing 'segway', boosted by the invention and subsequent naming of the ridiculous personal transport vehicle, is making inroads. (My personal opinion: the word is spelled 'segue' and always will be. Anything else is just laziness and poor literacy.)
The OED does not list *segway*, it only lists *segue*, as musical slang. > > **segue**, *n. Mus. slang.* > > > (ˈsɛgweɪ) > > > [f. prec.] > > > An uninterrupted transition from one song or melody to another. (Used of both live and pre-recorded music.) > > > As your commenter made a point of *segway* being *a vulgar imitation used by know-nothings*, you should then point him out that *segue* is not the correct Italian word for this concept. One should rather use *proseguimento* or *proseguire* (or many others, it really depends on the sentence). *Segue* means "it follows", therefore, you are saying: > > We're getting off-topic. Let's it follows to the next discussion point, shall we? > > > Which is meaningless. Also the correct italian pronunciation is not ˈsɛgweɪ but rather se'gwe Personally, I would just say: > > We're getting off-topic. Let's continue to the next discussion point, shall we? > > > What's wrong with that?
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
Google Ngram data provides a little insight although the introduction of the Segway was quite recent. There does seem to be a dip in the use of 'segue' since around 2003 which coincides somewhat with the rise of the Segway in the common consciousness. ![Google Books Ngram for 'segue' vs 'Segway'](https://i.stack.imgur.com/I4a4z.png) Perhaps 'segue' is at a disadvantage owing to its not having what might be called an 'intuitive' spelling. Hence the more phonetically appealing 'segway', boosted by the invention and subsequent naming of the ridiculous personal transport vehicle, is making inroads. (My personal opinion: the word is spelled 'segue' and always will be. Anything else is just laziness and poor literacy.)
<http://www.english-for-students.com/Segway-or-Segue.html> This sums it up: > > When you shift to a new topic or activity, you segue. > Many people unfamiliar with the unusual Italian spelling of the word misspell it as “segway.” > > > This error is being encouraged by the deliberately punning name used by the manufacturers of the Segway Human Transporter. > > >
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
<http://www.english-for-students.com/Segway-or-Segue.html> This sums it up: > > When you shift to a new topic or activity, you segue. > Many people unfamiliar with the unusual Italian spelling of the word misspell it as “segway.” > > > This error is being encouraged by the deliberately punning name used by the manufacturers of the Segway Human Transporter. > > >
The OED does not list *segway*, it only lists *segue*, as musical slang. > > **segue**, *n. Mus. slang.* > > > (ˈsɛgweɪ) > > > [f. prec.] > > > An uninterrupted transition from one song or melody to another. (Used of both live and pre-recorded music.) > > > As your commenter made a point of *segway* being *a vulgar imitation used by know-nothings*, you should then point him out that *segue* is not the correct Italian word for this concept. One should rather use *proseguimento* or *proseguire* (or many others, it really depends on the sentence). *Segue* means "it follows", therefore, you are saying: > > We're getting off-topic. Let's it follows to the next discussion point, shall we? > > > Which is meaningless. Also the correct italian pronunciation is not ˈsɛgweɪ but rather se'gwe Personally, I would just say: > > We're getting off-topic. Let's continue to the next discussion point, shall we? > > > What's wrong with that?
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
The only meaning of *segway* reported by the NOAD, and the OED, is the following: > > *Segway*: [trademark] a two-wheeled motorized personal vehicle consisting of a platform for the feet mounted above an axle and an upright post surmounted by handles. > > > As per the origin of the word, both the dictionaries say "an invented word based on *segue*." I would say that *segway* is not an acceptable substitute for *segue*.
*Segway*, *seque*, or *segue*. Ameriglish is an evolving language; in the last two years since this thread began, *segway* is gaining ground over *segue*, as vulgar an incorrect as some of us linguists and etymologists might find it. Be a hipster, use & co-create the Urban Dictionary, and Segway into the new lingo. There certainly is something very classy and non-irrelevant about using the original Italian pronunciation se'gwe; such a proseguimento used appropriately by a gentleman arriving at my door with CHILLED Argyle Champagne on one arm and any variety of lilies on the other will receive my affection, especially if his attire includes an eldredge knot, and he offers a ballet or opera where one might truly enjoy the nuances of proseguire. So that we don't fight it too hard and go mad, but appreciate the rapid and rabid segwaying of our common language, I offer this verifiable quantitative data, a woven tapestry of musical pun, *Soundgarden — by Crooked Steps*, compliments of famed composer Dave Grohl: <http://www.youtube.com/watch?v=oTaVHM6HGuQ&feature=youtu.be>
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
Google Ngram data provides a little insight although the introduction of the Segway was quite recent. There does seem to be a dip in the use of 'segue' since around 2003 which coincides somewhat with the rise of the Segway in the common consciousness. ![Google Books Ngram for 'segue' vs 'Segway'](https://i.stack.imgur.com/I4a4z.png) Perhaps 'segue' is at a disadvantage owing to its not having what might be called an 'intuitive' spelling. Hence the more phonetically appealing 'segway', boosted by the invention and subsequent naming of the ridiculous personal transport vehicle, is making inroads. (My personal opinion: the word is spelled 'segue' and always will be. Anything else is just laziness and poor literacy.)
The only meaning of *segway* reported by the NOAD, and the OED, is the following: > > *Segway*: [trademark] a two-wheeled motorized personal vehicle consisting of a platform for the feet mounted above an axle and an upright post surmounted by handles. > > > As per the origin of the word, both the dictionaries say "an invented word based on *segue*." I would say that *segway* is not an acceptable substitute for *segue*.
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
Google Ngram data provides a little insight although the introduction of the Segway was quite recent. There does seem to be a dip in the use of 'segue' since around 2003 which coincides somewhat with the rise of the Segway in the common consciousness. ![Google Books Ngram for 'segue' vs 'Segway'](https://i.stack.imgur.com/I4a4z.png) Perhaps 'segue' is at a disadvantage owing to its not having what might be called an 'intuitive' spelling. Hence the more phonetically appealing 'segway', boosted by the invention and subsequent naming of the ridiculous personal transport vehicle, is making inroads. (My personal opinion: the word is spelled 'segue' and always will be. Anything else is just laziness and poor literacy.)
*Segway*, *seque*, or *segue*. Ameriglish is an evolving language; in the last two years since this thread began, *segway* is gaining ground over *segue*, as vulgar an incorrect as some of us linguists and etymologists might find it. Be a hipster, use & co-create the Urban Dictionary, and Segway into the new lingo. There certainly is something very classy and non-irrelevant about using the original Italian pronunciation se'gwe; such a proseguimento used appropriately by a gentleman arriving at my door with CHILLED Argyle Champagne on one arm and any variety of lilies on the other will receive my affection, especially if his attire includes an eldredge knot, and he offers a ballet or opera where one might truly enjoy the nuances of proseguire. So that we don't fight it too hard and go mad, but appreciate the rapid and rabid segwaying of our common language, I offer this verifiable quantitative data, a woven tapestry of musical pun, *Soundgarden — by Crooked Steps*, compliments of famed composer Dave Grohl: <http://www.youtube.com/watch?v=oTaVHM6HGuQ&feature=youtu.be>
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
<http://www.english-for-students.com/Segway-or-Segue.html> This sums it up: > > When you shift to a new topic or activity, you segue. > Many people unfamiliar with the unusual Italian spelling of the word misspell it as “segway.” > > > This error is being encouraged by the deliberately punning name used by the manufacturers of the Segway Human Transporter. > > >
The question is hard to answer because the framing is unclear. A podcast (audio only) is referenced, but elsewhere it looks like the question is between the spelling "segway" and "segue". The only resolution for this contradiction is if the author believed that "segway" and "segue" are pronounced differently. Dictionaries would indicate that they are homophones. So perhaps an alternate pronunciation for "segue" is at play. I've heard my mother pronounce "segue" as "seeg". Whether that's a regional variant, a personal quirk, or a common error, I'm not sure, though she did study music so perhaps it was taught. Perhaps that's where the confusion lies.
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
<http://www.english-for-students.com/Segway-or-Segue.html> This sums it up: > > When you shift to a new topic or activity, you segue. > Many people unfamiliar with the unusual Italian spelling of the word misspell it as “segway.” > > > This error is being encouraged by the deliberately punning name used by the manufacturers of the Segway Human Transporter. > > >
*Segway*, *seque*, or *segue*. Ameriglish is an evolving language; in the last two years since this thread began, *segway* is gaining ground over *segue*, as vulgar an incorrect as some of us linguists and etymologists might find it. Be a hipster, use & co-create the Urban Dictionary, and Segway into the new lingo. There certainly is something very classy and non-irrelevant about using the original Italian pronunciation se'gwe; such a proseguimento used appropriately by a gentleman arriving at my door with CHILLED Argyle Champagne on one arm and any variety of lilies on the other will receive my affection, especially if his attire includes an eldredge knot, and he offers a ballet or opera where one might truly enjoy the nuances of proseguire. So that we don't fight it too hard and go mad, but appreciate the rapid and rabid segwaying of our common language, I offer this verifiable quantitative data, a woven tapestry of musical pun, *Soundgarden — by Crooked Steps*, compliments of famed composer Dave Grohl: <http://www.youtube.com/watch?v=oTaVHM6HGuQ&feature=youtu.be>
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
The only meaning of *segway* reported by the NOAD, and the OED, is the following: > > *Segway*: [trademark] a two-wheeled motorized personal vehicle consisting of a platform for the feet mounted above an axle and an upright post surmounted by handles. > > > As per the origin of the word, both the dictionaries say "an invented word based on *segue*." I would say that *segway* is not an acceptable substitute for *segue*.
The OED does not list *segway*, it only lists *segue*, as musical slang. > > **segue**, *n. Mus. slang.* > > > (ˈsɛgweɪ) > > > [f. prec.] > > > An uninterrupted transition from one song or melody to another. (Used of both live and pre-recorded music.) > > > As your commenter made a point of *segway* being *a vulgar imitation used by know-nothings*, you should then point him out that *segue* is not the correct Italian word for this concept. One should rather use *proseguimento* or *proseguire* (or many others, it really depends on the sentence). *Segue* means "it follows", therefore, you are saying: > > We're getting off-topic. Let's it follows to the next discussion point, shall we? > > > Which is meaningless. Also the correct italian pronunciation is not ˈsɛgweɪ but rather se'gwe Personally, I would just say: > > We're getting off-topic. Let's continue to the next discussion point, shall we? > > > What's wrong with that?
22,012
For a long time, I used the word *segway* in relative contentment, as a useful word to mean "to transition to." As in: > > We're getting off-topic. Let's segway to the next discussion point, shall we? > > > Then one day, and to my surprise, I was shocked, after making a comment on somebody's blog, to be haughtily corrected and informed that correct usage was actually [*segue*](http://en.wiktionary.org/wiki/segue), which apparently comes by the Italian *seguire*, meaning "to follow." I was additionally told that *segway* was a vulgar imitation used by know-nothings, a sort of word like *bonafied* that instantly revealed one's class and relative ignorance. Wow! I had little doubt that the use of *segway* was substatially bolstered by the hype and general pop-cultural awareness of Dean Kamen's [famous flop](http://en.wikipedia.org/wiki/Segway_PT), but back then, I'd always thought he'd fittingly named his vehicle after the word itself, and it was strange to me to learn that the Segway was in fact knowingly named after a corruption. On the other hand, this is a mistake I continually hear lots of people, even educated people, make — cf. for example, whoever Joel is talking to at the 61st minute of [the latest podcast](http://blog.stackoverflow.com/2011/04/podcast-88/). So has *segway* become acceptable as a replacement for *segue*? Can *segue* be considered all but dead? To be clear, as this is StackExchange, I'm not looking for, "ooh! I say it this way", and "no, I say it that way!" responses; I'm looking more for quantitative data, usage by established authorities (is the NYRB using *segway*?), and perhaps discussions from those who have written on this before.
2011/04/21
[ "https://english.stackexchange.com/questions/22012", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4763/" ]
The OED does not list *segway*, it only lists *segue*, as musical slang. > > **segue**, *n. Mus. slang.* > > > (ˈsɛgweɪ) > > > [f. prec.] > > > An uninterrupted transition from one song or melody to another. (Used of both live and pre-recorded music.) > > > As your commenter made a point of *segway* being *a vulgar imitation used by know-nothings*, you should then point him out that *segue* is not the correct Italian word for this concept. One should rather use *proseguimento* or *proseguire* (or many others, it really depends on the sentence). *Segue* means "it follows", therefore, you are saying: > > We're getting off-topic. Let's it follows to the next discussion point, shall we? > > > Which is meaningless. Also the correct italian pronunciation is not ˈsɛgweɪ but rather se'gwe Personally, I would just say: > > We're getting off-topic. Let's continue to the next discussion point, shall we? > > > What's wrong with that?
The question is hard to answer because the framing is unclear. A podcast (audio only) is referenced, but elsewhere it looks like the question is between the spelling "segway" and "segue". The only resolution for this contradiction is if the author believed that "segway" and "segue" are pronounced differently. Dictionaries would indicate that they are homophones. So perhaps an alternate pronunciation for "segue" is at play. I've heard my mother pronounce "segue" as "seeg". Whether that's a regional variant, a personal quirk, or a common error, I'm not sure, though she did study music so perhaps it was taught. Perhaps that's where the confusion lies.
12,313
So the TOR works basically by sending a encrypted packet across multiple computers. The packet is encrypted such that only the first computer on the relay knows the user's IP, and the last computer knows the destination IP (i.e the requested website). Would it be possible to find the IP of .onion websites by intercepting the packets at the end node?( Its possible to see the first destination from the packets being sent out by the computer) And since the TOR Browser is F.O.S.S, could it be possible to configure TOR to use 3 local servers to act as relay nodes, and intercept the packets sent to the last one, thus exposing the destination IP?
2016/08/06
[ "https://tor.stackexchange.com/questions/12313", "https://tor.stackexchange.com", "https://tor.stackexchange.com/users/13899/" ]
Any captcha system can be broken by paying people. The captcha *has* been attacked in the past by a nationstate adversary. The captcha isn't critical to the security of Tor, it does present problems for censorship circumvention. Breaking it would net you a subset of the bridges on bridgedb, it is partitioned so that a break on any one of the distribution methods will not compromise the entire set of bridges. There are infact many (and cheaper) ways to discover bridges with less work and effort, see for example [this report](https://research.torproject.org/techreports/ten-ways-discover-tor-bridges-2011-10-31.pdf) by arma. So "ispo *(sic)* facto we're all being spied on" doesn't hold. The previous "fact" (the captcha is defeatable) does not lead to the conclusion that we're being spied on, merely that powerful adversaries can use a largely redundant method to discover some of the bridgedb bridges. The captchas purpose is limited, and it's limitations well acknowledged. Worrying about the difficulty of the captcha is bikeshedding, at least against NSA level adversaries. *I'm not even going to waste time trying to deconstruct some of the other faulty logic and assumptions in your question. Even if they were right, the result is mostly irrelevant.*
> > 1.Any captcha can be cracked through manual human labour > 2. Government agencies have resources to perform massive amounts of human labour > 3. Therefore any CAPTCHA cannot be used > > > ispo facto we're all being spied on > > > The point of bridges is to circumvent network blocking of tor. If the operator of the network knows more tor guard nodes, they can make it harder for you to connect to tor. This doesn't *really* help them with surveillance. It lets them know that you're using tor, but the network is designed with the assumption that an attacker already knows that.
18,492
I am looking at Kinect Laser and couple of things that are not clear, so I thought I bring up here. First the known facts: - Kinect has a laser projector that works at 840nm - Output power of the laser is 60mW - The laser projector has a diffuser. I didn't break one and look inside but my guess is laser diode->collimator->diffuser is the path. - Kinect is a Class 1 safety device. My primary interest is understanding Kinect's laser safety. For interested parties, the following links discuss some of these stuff and I will not repeat them here. - A very informative [link](https://skeptics.stackexchange.com/questions/2625/is-the-kinect-ir-laser-safe) - An independent Kinect Laser output [measurement](http://www.youtube.com/watch?v=7qLDzLYPG-w) My approach is as follows: - Assume 60mW output power is correct - Diffuser efficiency is 50% and therefore 50% of the energy is lost - Diffuser output projects a rectangle image with angles of 45 degrees on both axis (vertical and horizontal)[Probably the angle is different but good enough for us to make some calculations) - Diffuser output is 20mm away from the Projector window (this is the glass in front of the laser diode, light output leaves this window and projects the image) Now, given 45 degree angle, the size of the rectangle at the output of the window is still 30mW spread over the size of the rectangle. (the size of the rectangle is tan(45)\*20mm\*2=40mm one side, 1600mm2 area of the light rectangle at the window.) Assuming uniform energy distribution, we get 30mW/1600mm2 = 1.875mW/cm2 This looks high to me. I am trying to figure out why it is given Class 1. Now the questions: * This light is not collimated, in fact is diverging, if you think of your eye, the eye will focus only a very small portion of this light to the retina. (model for eye is just a lens with focal length of 17mm) Assuming pupil size is 7mm, the area of the pupil is 0.39cm2. So the energy enters the eye would be 18.75\*0.39=7.3mW. If this was a straight line, you would end up blind since the lens would collimate that straight line, however in this case, the light comes with 45 degree angle, therefore eye will only be focusing on a very small portion of this energy properly. I am trying to figure out is this the reason why Kinect denoted a Class 1 certification. Even if I am off by 50%, there is still tons of energy coming out of Kinect laser. I did more checking on this, using the [attached](http://spie.org/Documents/Publications/00%20STEP%20Module%2002.pdf) pdf, one can conclude the beam from Kinect will have an area of d=f*theta, d=1.7*(45 degree in radians)=1.7\*785mrad->1.335cm. This is the dia1meter of the spot on your retina. The area is a=pi\*d^2/4=1.4cm2 so the retinal irradiance becomes E=7.3mW/1.4cm2=5.2mW/cm2. This still seems exceptionally high to me, even if it is diverging beam. * My second suspicion is that, Kinect is indeed dangerous however no sane person would stick his eye to the projector and at normal working distance (say 1meter) the energy entering to the eye would be very small (tan(45)\*1000\*2=2000mm, area is 4m2. 30mW/4m2 =7.5mW/m2=7.5 10e-4 mW/cm2 which is safe for eye. However if this is how Kinect got the Class 1 certification, it is pretty scary, since I am pretty sure some idiot out there will stick his eye to see what is inside. Any insights would be appreciated.. **[Update]** I have done some measurements today.. Here they are: Using a PD (Osram BPW34FA) and a 10K resistor. I manually touch to the surface of the projector's window with the PD and 10K resistor. I measure voltage across resistor using a scope. The result is approximately 500mV. (I took out the 4mW ambient measurement, it was 504 but when Kinect isn't there it is 4mW, so the delta due to Kinect is 500mW) Now, 500mV translates to 500uA current on this diode. (500mV/10K=500uA). At 7mm2 (assuming pD is uniform energy absorption, which is a reasonable assumption) per mm2, I get 71uA. The diode's efficiency is 0.65A/W, I simply use this to calculate incoming power per mm2, it translates into 109uW/mm2. I also measured the angles of the diverging pattern. They are 50 degrees vertically and 54 degrees horizontally. (Use a sony cam in nightshot mode and a ruler. The patter is not perfect rectangle but rectangle is a reasonable assumption) So, assuming the output of the diffuser is 12 mm away from the window, you get an approximate area of 12\*tan(50)= 14.4mm and similarly 17.7mm. So the total area of the beam at the window is 254mm2. Since we established per mm2, this thing emits 109uW, total energy output becomes 27.6mW, which is inline with 60mW laser output with 50% optical efficiency. I didn't break the Kinect to measure the depth of the diffuser output but I guess it could easily be 1mm, in this case the output power translates to 18mW at the window. Anyway it is high and I am still not understanding why it is Class 1. Hope you guys can help.
2011/08/21
[ "https://electronics.stackexchange.com/questions/18492", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/4861/" ]
I see a fundamental units problem in your math. You are using the symbol m which stands for milli (10^-3). The actual energies are µ (10^-6). [You are off by a factor of 10^-3](http://en.wikipedia.org/wiki/Micro-). Since most keyboards do not have a symbol for µ (micro), people often revert to an m (milli), and end up confusing the units. Hey, they both start with the same letter, right? :) Additionally, there is the question of "wall plug efficiency". While a diode may 60mW, even military grade lasers only have a 10-15% wall plug efficiency. Thus that means an output of around 6mW. Then any optical element will reduce power by around 50% for each element. Assuming at most 2 optical elements (nu-naturally low number), that means the output can at max be 1.5mW. [In the answer you quoted](https://skeptics.stackexchange.com/questions/2625/is-the-kinect-ir-laser-safe/2626), use this paragraph as a point of comparison: > > For the sake of comparison, sunlight is one kilowatt per square meter and perhaps 5% of that is near infrared i.e. 700 to 1000 nanometers. *Just going outside will expose you to much greater power densities of SWIR than the Kinect*. > > > Also, remember that even though the *generator* is 60 mW (yes, I used the correct units), there is a series of diffusers, optics, and such so that at the very extreme of the *exit aperture*, the power density is <25 μW (again, note the symbol). The series of steps required to get at the 60 mW generator would indicate a *willful intent to cause self harm, and be beyond simple mechanical failure*. Your initial assumption is incorrect. > > My approach is as follows: - Assume 60mW output power is correct - Diffuser efficiency is 50% and therefore 50% of the energy is lost > > > The diffusers and optics reduce the power to <25 μW at the aperture. Run your math with that figure and you'll have an accurate representation.
Glossary: mW - milliWatt uW - microWatt LLQ is correct about the factor of 1000 error. I'm not so sure about a number of his other assertions which do not have references and which are not necessarily true. He gave a similar answer on April 29th here [on Stack Exchange skeptics](https://skeptics.stackexchange.com/questions/2625/is-the-kinect-ir-laser-safe) but sadly did not reference it in his current reply. His path from 60 mW to 25 uW is uncertain. He cites a number of optical steps with a 50% loss in each (and there is no reason that loss needs to be anything like 50% depending on the function performed.) Frank's window size measure meant has a factor of 1o error (40mm x 40mm = 1600 mm^2, not 160 mm^2) but also there is a jump from mm^2 to cm^2. All easily done but needs checking. Going back to Frank's original assumptions, **IF** the LASER is 60 mW optical output then I think it feasible that it **may** output around 30 mW. Re the youtube video - the person doing the measurement does not state (afaik) what the aperture of the sensor used is. This may be available elsewhere. The aperture has a very substantial effect on the result. At small distances he was measuring in excess of 1 mW of LASER energy while not intercepting all of the beam. I have an instrument which **may** be able to make a useful measurement of this - but I do not have a Kinect. If all else fails I could go and find one. **However** apparently Microsoft have sold 8 million + of these and I saw a figures of 14M in the first year mentioned. Microsoft not being stupid, whatever else they may be, and employing more lawyers than most of us would expect to meet in out worst nightmares, are very unlikely to sell a product which they expect to run the risk of blinding anyone at all. Strapping a Kinect on your eye as a fashion accessory probably lies within the range of normal that a Microsoft lawyer would like to protect against. Some consistent calculations and some properly described measurements still seem like a good idea.
18,492
I am looking at Kinect Laser and couple of things that are not clear, so I thought I bring up here. First the known facts: - Kinect has a laser projector that works at 840nm - Output power of the laser is 60mW - The laser projector has a diffuser. I didn't break one and look inside but my guess is laser diode->collimator->diffuser is the path. - Kinect is a Class 1 safety device. My primary interest is understanding Kinect's laser safety. For interested parties, the following links discuss some of these stuff and I will not repeat them here. - A very informative [link](https://skeptics.stackexchange.com/questions/2625/is-the-kinect-ir-laser-safe) - An independent Kinect Laser output [measurement](http://www.youtube.com/watch?v=7qLDzLYPG-w) My approach is as follows: - Assume 60mW output power is correct - Diffuser efficiency is 50% and therefore 50% of the energy is lost - Diffuser output projects a rectangle image with angles of 45 degrees on both axis (vertical and horizontal)[Probably the angle is different but good enough for us to make some calculations) - Diffuser output is 20mm away from the Projector window (this is the glass in front of the laser diode, light output leaves this window and projects the image) Now, given 45 degree angle, the size of the rectangle at the output of the window is still 30mW spread over the size of the rectangle. (the size of the rectangle is tan(45)\*20mm\*2=40mm one side, 1600mm2 area of the light rectangle at the window.) Assuming uniform energy distribution, we get 30mW/1600mm2 = 1.875mW/cm2 This looks high to me. I am trying to figure out why it is given Class 1. Now the questions: * This light is not collimated, in fact is diverging, if you think of your eye, the eye will focus only a very small portion of this light to the retina. (model for eye is just a lens with focal length of 17mm) Assuming pupil size is 7mm, the area of the pupil is 0.39cm2. So the energy enters the eye would be 18.75\*0.39=7.3mW. If this was a straight line, you would end up blind since the lens would collimate that straight line, however in this case, the light comes with 45 degree angle, therefore eye will only be focusing on a very small portion of this energy properly. I am trying to figure out is this the reason why Kinect denoted a Class 1 certification. Even if I am off by 50%, there is still tons of energy coming out of Kinect laser. I did more checking on this, using the [attached](http://spie.org/Documents/Publications/00%20STEP%20Module%2002.pdf) pdf, one can conclude the beam from Kinect will have an area of d=f*theta, d=1.7*(45 degree in radians)=1.7\*785mrad->1.335cm. This is the dia1meter of the spot on your retina. The area is a=pi\*d^2/4=1.4cm2 so the retinal irradiance becomes E=7.3mW/1.4cm2=5.2mW/cm2. This still seems exceptionally high to me, even if it is diverging beam. * My second suspicion is that, Kinect is indeed dangerous however no sane person would stick his eye to the projector and at normal working distance (say 1meter) the energy entering to the eye would be very small (tan(45)\*1000\*2=2000mm, area is 4m2. 30mW/4m2 =7.5mW/m2=7.5 10e-4 mW/cm2 which is safe for eye. However if this is how Kinect got the Class 1 certification, it is pretty scary, since I am pretty sure some idiot out there will stick his eye to see what is inside. Any insights would be appreciated.. **[Update]** I have done some measurements today.. Here they are: Using a PD (Osram BPW34FA) and a 10K resistor. I manually touch to the surface of the projector's window with the PD and 10K resistor. I measure voltage across resistor using a scope. The result is approximately 500mV. (I took out the 4mW ambient measurement, it was 504 but when Kinect isn't there it is 4mW, so the delta due to Kinect is 500mW) Now, 500mV translates to 500uA current on this diode. (500mV/10K=500uA). At 7mm2 (assuming pD is uniform energy absorption, which is a reasonable assumption) per mm2, I get 71uA. The diode's efficiency is 0.65A/W, I simply use this to calculate incoming power per mm2, it translates into 109uW/mm2. I also measured the angles of the diverging pattern. They are 50 degrees vertically and 54 degrees horizontally. (Use a sony cam in nightshot mode and a ruler. The patter is not perfect rectangle but rectangle is a reasonable assumption) So, assuming the output of the diffuser is 12 mm away from the window, you get an approximate area of 12\*tan(50)= 14.4mm and similarly 17.7mm. So the total area of the beam at the window is 254mm2. Since we established per mm2, this thing emits 109uW, total energy output becomes 27.6mW, which is inline with 60mW laser output with 50% optical efficiency. I didn't break the Kinect to measure the depth of the diffuser output but I guess it could easily be 1mm, in this case the output power translates to 18mW at the window. Anyway it is high and I am still not understanding why it is Class 1. Hope you guys can help.
2011/08/21
[ "https://electronics.stackexchange.com/questions/18492", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/4861/" ]
I see a fundamental units problem in your math. You are using the symbol m which stands for milli (10^-3). The actual energies are µ (10^-6). [You are off by a factor of 10^-3](http://en.wikipedia.org/wiki/Micro-). Since most keyboards do not have a symbol for µ (micro), people often revert to an m (milli), and end up confusing the units. Hey, they both start with the same letter, right? :) Additionally, there is the question of "wall plug efficiency". While a diode may 60mW, even military grade lasers only have a 10-15% wall plug efficiency. Thus that means an output of around 6mW. Then any optical element will reduce power by around 50% for each element. Assuming at most 2 optical elements (nu-naturally low number), that means the output can at max be 1.5mW. [In the answer you quoted](https://skeptics.stackexchange.com/questions/2625/is-the-kinect-ir-laser-safe/2626), use this paragraph as a point of comparison: > > For the sake of comparison, sunlight is one kilowatt per square meter and perhaps 5% of that is near infrared i.e. 700 to 1000 nanometers. *Just going outside will expose you to much greater power densities of SWIR than the Kinect*. > > > Also, remember that even though the *generator* is 60 mW (yes, I used the correct units), there is a series of diffusers, optics, and such so that at the very extreme of the *exit aperture*, the power density is <25 μW (again, note the symbol). The series of steps required to get at the 60 mW generator would indicate a *willful intent to cause self harm, and be beyond simple mechanical failure*. Your initial assumption is incorrect. > > My approach is as follows: - Assume 60mW output power is correct - Diffuser efficiency is 50% and therefore 50% of the energy is lost > > > The diffusers and optics reduce the power to <25 μW at the aperture. Run your math with that figure and you'll have an accurate representation.
Larian LeQuella's answer is obviously wrong and can be dismissed out of hand. He's clearly simply assuming the questioner doesn't understand the difference between micro and milli prefixes because he read on the referenced page that stated Class 1 lasers are restricted to <25 μW, and apparently to him, that's that, case closed. Well, I don't see any prefix misuse in the questioners analysis, and frankly, the idea that you're looking at less than 25 MICROwatts illuminating an entire room [in this video taken with cheap, non-image-intensifying camera](http://www.youtube.com/watch?v=brnIty7mh2Q) is completely LAUGHABLE. This device is easily emitting tens of MILLIwatts of IR light. The questioner's concerns are justified and I found this page as a result of sharing them. However, I believe we have the answer to why the Kinect is eye-safe already right here in front of us as a result of the questioner's treatment (which is the most thorough I can find anywhere on this subject so far). If the questioner's considerations of beam divergence and optical path losses are correct, and the beam intensity at the retina really is 5.2mW/cm2, that is actually a pretty safe, low level. [Note that other sources cite](http://www.repairfaq.org/sam/lasersaf.htm) the focused intensity of sunlight on the retina as 10 WATTS/cm^2 and a 1 mW collimated laser beam at ~1.7 KW/cm^2. We know that even though you definitely shouldn't do it, looking at the sun and looking at even a 5 mW laser pointer do not immediately damage the retina. So if we're right about divergence being the key to Class 1 classification here, a mere 5 mW/cm^2 is really quite safe...unless someone puts a lens of some kind in front of the output....
57,958,213
We have a button that we want to have enabled or disabled depending on some condition. Furthermore, we want the hover effect of the button when disabled to display a tooltip explaining why it is disabled. Currently, we have something like this: ``` export class NextButton extends React.Component { makePopover () { return ( this.props.someCondition && <Popover>Please enter a title.</Popover> ) } render () { return ( <div> <OverlayTrigger placement='top' overlay={this.makePopover()}> {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </OverlayTrigger> </div> ); } } ``` Now, if we look closely at the `makePopover` function, if `someCondition` is false, `Popover` will not be rendered and `OverlayTrigger` throws an error if anything without an id is returned. Therefore, to fix this we tried: ``` this.props.someCondition ? <Popover>...</Popover> : <span>...</span> ``` This helped but displayed other warnings: > > Warning: Unknown props `placement`, `arrowOffsetLeft`, > `arrowOffsetTop`, `positionLeft`, `positionTop` on tag. Remove > these props from the element. > > > Now, instead of conditionally displaying the Popover, we could wrap the conditional around the entire `OverlayTrigger` itself, doing something like: ``` this.props.someCondition ? <OverlayTrigger> <Button>Next</Button> </OverlayTrigger> : <Button>Next</Button> ``` What is the best practice for how to deal with conditional tooltips? Any help would be greatly appreciated.
2019/09/16
[ "https://Stackoverflow.com/questions/57958213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487135/" ]
I was facing the same problem I thought the cleanest way to solve it is to use a conditional wrapper. ```js const ConditionalWrapper = ({ condition, wrapper, children, }) => (condition ? wrapper(children) : children); export class NextButton extends React.Component { render () { return ( <div> <ConditionalWrapper condition={this.props.someCondition} wrapper={children => ( <OverlayTrigger overlay={<Popover>Please enter a title.</Popover>} placement='top' > {children} </OverlayTrigger> )} > {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </ConditionalWrapper> </div> ); } } ```
Here is Alexus answer in Typescript (mostly): ``` interface IConditionalWrapperProps { condition: boolean; wrapper: (children: React.ReactNode) => JSX.Element; children: JSX.Element; } const ConditionalWrapper = ({ condition, wrapper, children, }: React.PropsWithChildren<IConditionalWrapperProps>) => (condition ? wrapper(children) : children); export class NextButton extends React.Component { render () { return ( <div> <ConditionalWrapper condition={this.props.someCondition} wrapper={children => ( <OverlayTrigger overlay={<Popover>Please enter a title.</Popover>} placement='top' > {children} </OverlayTrigger> )} > {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </ConditionalWrapper> </div> ); } ```
57,958,213
We have a button that we want to have enabled or disabled depending on some condition. Furthermore, we want the hover effect of the button when disabled to display a tooltip explaining why it is disabled. Currently, we have something like this: ``` export class NextButton extends React.Component { makePopover () { return ( this.props.someCondition && <Popover>Please enter a title.</Popover> ) } render () { return ( <div> <OverlayTrigger placement='top' overlay={this.makePopover()}> {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </OverlayTrigger> </div> ); } } ``` Now, if we look closely at the `makePopover` function, if `someCondition` is false, `Popover` will not be rendered and `OverlayTrigger` throws an error if anything without an id is returned. Therefore, to fix this we tried: ``` this.props.someCondition ? <Popover>...</Popover> : <span>...</span> ``` This helped but displayed other warnings: > > Warning: Unknown props `placement`, `arrowOffsetLeft`, > `arrowOffsetTop`, `positionLeft`, `positionTop` on tag. Remove > these props from the element. > > > Now, instead of conditionally displaying the Popover, we could wrap the conditional around the entire `OverlayTrigger` itself, doing something like: ``` this.props.someCondition ? <OverlayTrigger> <Button>Next</Button> </OverlayTrigger> : <Button>Next</Button> ``` What is the best practice for how to deal with conditional tooltips? Any help would be greatly appreciated.
2019/09/16
[ "https://Stackoverflow.com/questions/57958213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487135/" ]
I was facing the same problem I thought the cleanest way to solve it is to use a conditional wrapper. ```js const ConditionalWrapper = ({ condition, wrapper, children, }) => (condition ? wrapper(children) : children); export class NextButton extends React.Component { render () { return ( <div> <ConditionalWrapper condition={this.props.someCondition} wrapper={children => ( <OverlayTrigger overlay={<Popover>Please enter a title.</Popover>} placement='top' > {children} </OverlayTrigger> )} > {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </ConditionalWrapper> </div> ); } } ```
Just in case anyone else wants to do something like this, this was my approach using TypeScript. I know it's a bit more verbose, but I think it's a little easier to understand and a little easier to use. ``` ConditionalTooltip.tsx export interface IConditionalTooltipProps { // Boolean to determine if tooltip will show condition?: boolean; children: React.ReactNode; // Necessary for keeping track of tooltips overlayPopoverId: string; overlayTriggerPlacement?: Placement, tooltipText?: string; // Default is hover. Other standard would be likely be 'click' triggerAction?: OverlayTriggerType | OverlayTriggerType[]; } const ConditionalTooltip = ({ condition, children, overlayPopoverId, overlayTriggerPlacement, tooltipText, triggerAction, }: IConditionalTooltipProps) => { if ( (condition === undefined || condition === true) && tooltipText && tooltipText?.length > 0) { return( <OverlayTrigger trigger={triggerAction} placement={overlayTriggerPlacement} overlay={ <Popover id={overlayPopoverId}> <Popover.Content> { tooltipText } </Popover.Content> </Popover> } > {/* Wrapping this in a div allows the overlay functionality to behave even if the children component/s are disabled due to other functionality */} <div className="ConditionalOverlayTrigger"> { children } </div> </OverlayTrigger> ) } return ( // eslint-disable-next-line react/jsx-no-useless-fragment <> { children } </> ) } ``` and then ``` ButtonWithConditionalTooltip.tsx const ButtonWithConditionalTooltip = () => ( <ConditionalTooltip overlayPopoverId='Button-tooltip' overlayTriggerPlacement='auto-start' // If the tooltip is automatically generated or // empty for another reason, the tooltip won't show. tooltipText='A valid tooltip here' triggerAction='click' // If no condition passed, the component will determine // that there's no need to check and will display the tooltip. // It will only not show the tooltip if a condition equals false. condition={true} > <Button disabled={false}> My button that might need a tooltip </Button> </ConditionalTooltip> ) ```
57,958,213
We have a button that we want to have enabled or disabled depending on some condition. Furthermore, we want the hover effect of the button when disabled to display a tooltip explaining why it is disabled. Currently, we have something like this: ``` export class NextButton extends React.Component { makePopover () { return ( this.props.someCondition && <Popover>Please enter a title.</Popover> ) } render () { return ( <div> <OverlayTrigger placement='top' overlay={this.makePopover()}> {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </OverlayTrigger> </div> ); } } ``` Now, if we look closely at the `makePopover` function, if `someCondition` is false, `Popover` will not be rendered and `OverlayTrigger` throws an error if anything without an id is returned. Therefore, to fix this we tried: ``` this.props.someCondition ? <Popover>...</Popover> : <span>...</span> ``` This helped but displayed other warnings: > > Warning: Unknown props `placement`, `arrowOffsetLeft`, > `arrowOffsetTop`, `positionLeft`, `positionTop` on tag. Remove > these props from the element. > > > Now, instead of conditionally displaying the Popover, we could wrap the conditional around the entire `OverlayTrigger` itself, doing something like: ``` this.props.someCondition ? <OverlayTrigger> <Button>Next</Button> </OverlayTrigger> : <Button>Next</Button> ``` What is the best practice for how to deal with conditional tooltips? Any help would be greatly appreciated.
2019/09/16
[ "https://Stackoverflow.com/questions/57958213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1487135/" ]
Here is Alexus answer in Typescript (mostly): ``` interface IConditionalWrapperProps { condition: boolean; wrapper: (children: React.ReactNode) => JSX.Element; children: JSX.Element; } const ConditionalWrapper = ({ condition, wrapper, children, }: React.PropsWithChildren<IConditionalWrapperProps>) => (condition ? wrapper(children) : children); export class NextButton extends React.Component { render () { return ( <div> <ConditionalWrapper condition={this.props.someCondition} wrapper={children => ( <OverlayTrigger overlay={<Popover>Please enter a title.</Popover>} placement='top' > {children} </OverlayTrigger> )} > {/* wrap this in a div so when the button is disabled, the popover still works */} <div> <Button onClick={() => this.props.goToNextPage()} disabled={this.props.someCondition} > Next </Button> </div> </ConditionalWrapper> </div> ); } ```
Just in case anyone else wants to do something like this, this was my approach using TypeScript. I know it's a bit more verbose, but I think it's a little easier to understand and a little easier to use. ``` ConditionalTooltip.tsx export interface IConditionalTooltipProps { // Boolean to determine if tooltip will show condition?: boolean; children: React.ReactNode; // Necessary for keeping track of tooltips overlayPopoverId: string; overlayTriggerPlacement?: Placement, tooltipText?: string; // Default is hover. Other standard would be likely be 'click' triggerAction?: OverlayTriggerType | OverlayTriggerType[]; } const ConditionalTooltip = ({ condition, children, overlayPopoverId, overlayTriggerPlacement, tooltipText, triggerAction, }: IConditionalTooltipProps) => { if ( (condition === undefined || condition === true) && tooltipText && tooltipText?.length > 0) { return( <OverlayTrigger trigger={triggerAction} placement={overlayTriggerPlacement} overlay={ <Popover id={overlayPopoverId}> <Popover.Content> { tooltipText } </Popover.Content> </Popover> } > {/* Wrapping this in a div allows the overlay functionality to behave even if the children component/s are disabled due to other functionality */} <div className="ConditionalOverlayTrigger"> { children } </div> </OverlayTrigger> ) } return ( // eslint-disable-next-line react/jsx-no-useless-fragment <> { children } </> ) } ``` and then ``` ButtonWithConditionalTooltip.tsx const ButtonWithConditionalTooltip = () => ( <ConditionalTooltip overlayPopoverId='Button-tooltip' overlayTriggerPlacement='auto-start' // If the tooltip is automatically generated or // empty for another reason, the tooltip won't show. tooltipText='A valid tooltip here' triggerAction='click' // If no condition passed, the component will determine // that there's no need to check and will display the tooltip. // It will only not show the tooltip if a condition equals false. condition={true} > <Button disabled={false}> My button that might need a tooltip </Button> </ConditionalTooltip> ) ```
317,491
How can I rewrite the following command with `ProxyCommand`? ``` ssh -l username1 -t jumphost1 \ ssh -l username2 -t jumphost2 \ ssh -l username3 -t jumphost3 \ ssh -l username4 server ``` This doesn't work ``` ssh -o ProxyCommand="\ ssh -l username1 -t jumphost1 \ ssh -l username2 -t jumphost2 \ ssh -l username3 -t jumphost3" \ -l username4 server username1@jumphost1's password: Pseudo-terminal will not be allocated because stdin is not a terminal. Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). ssh_exchange_identification: Connection closed by remote host ``` I'm aware of its use with `nc`, but I'm searching for way to use it with 3+ hops, and also use this option with `scp`. I checked `ssh_config` man page, but the information is quite scarce, for me at least. **EDIT** I tried using `ProxyCommand` nested in another `ProxyCommand` as suggested below but I always get something along the following lines ``` debug3: ssh_init_stdio_forwarding: 192.17.2.2:2222 debug1: channel_connect_stdio_fwd 192.17.2.2:2222 debug1: channel 0: new [stdio-forward] debug2: fd 4 setting O_NONBLOCK debug2: fd 5 setting O_NONBLOCK debug1: getpeername failed: Bad file descriptor debug3: send packet: type 90 debug2: fd 3 setting TCP_NODELAY debug3: ssh_packet_set_tos: set IP_TOS 0x10 debug1: Requesting no-more-sessions@openssh.com debug3: send packet: type 80 debug1: Entering interactive session. ``` Fortunately, since `7.3` `-J` or `ProxyJump` serves my purpose — although I still to have to work around my keys setup. ``` ssh -q -J user1@jumphost1,user2@jumphost2,user3@jumphost3 user@server ```
2016/10/19
[ "https://unix.stackexchange.com/questions/317491", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/36191/" ]
The `nc` version is not recommended anymore. Use the `-W` switch, which is provided in recent versions of OpenSSH. Also, you don't need to copy the config to other hosts! All of the config needs to be done on your host and it does not interfere with the `scp` in any way. Just create a file `~/.ssh/config` with: ``` Host jumphost1 User username1 Host jumphost2 User username2 ProxyCommand ssh -W %h:%p jumphost1 Host jumphost3 User username3 ProxyCommand ssh -W %h:%p jumphost2 Host server User username4 ProxyCommand ssh -W %h:%p jumphost3 ``` And then connect using `ssh server` or use `scp file server:path/`. If you insist on oneliner (or not sure what you mean about `ProxyCommand` nesting), then as already pointed out, it is hell of escapes: ``` ssh -oProxyCommand= \ 'ssh -W %h:%p -oProxyCommand= \ \'ssh -W %h:%p -oProxyCommand= \ \\\'ssh -W %h:%p username1@jumphost1\\\' \ username2@jumphost2\' \ username3@jumphost3' \ username4@server ``` You basically need to go from inside.
I have done this with *two* hops, but it should work for three. The simplest way is to have the `~/.ssh/config` file set on each host. So, if you want to be on `hosta` and get to `hostd` via `hostb` and hostc`, you could set your configurations thusly: In `hosta:~/.ssh/config`: ``` Host hostd User username ProxyCommand ssh hostb nc %h %p 2> /dev/null ``` In `hostb:~/.ssh/config`: ``` Host hostd User username ProxyCommand ssh hostc nc %h %p 2> /dev/null ``` In `hostc:~/.ssh/config`: ``` Host hostd User username ProxyCommand ssh hostd nc %h %p 2> /dev/null ``` You can then `ssh hostd` on any of the hosts in the chain and you'll make your way to `hostd`. Using netcat for the proxy does not interfere with `scp`. If for some reason you really don't want to use local `~/.ssh/config` files, you can do this on `hosta`: ``` ssh -oProxyCommand='ssh -oProxyCommand=\'ssh -o ProxyCommand=\\\'ssh username@hostd nc %h %p 2>/dev/null\\\' username@hostc nc %h %p 2> /dev/null' username@hostb nc %h %p 2> /dev/null' username@hostd ```
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
Peeling chickpeas will give you a creamier texture, but won't have much of an effect on taste. The most efficient way I know of peeling them is to rub small handfuls in the palm of your hands. It will still take some time to work through them, but it's far more efficient than using your fingertips. One other possibility is to use a product similar to Oxo's silicon garlic peeler. It's a tube in which you can place garlic and roll around until the cloves are peeled. I have one and it works amazingly well. I suspect it would be great for chickpeas too.
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
If you have a [hand mill](https://www.google.com/search?safe=off&client=firefox-a&hs=ilW&rls=org.mozilla%3aen-US%3aofficial&q=hand%20mill&oq=hand%20mill&gs_l=serp.1.1.0i7l2j0j0i7l3j0l2j0i7l2.12258.13087.0.18407.4.4.0.0.0.0.319.713.0j3j0j1.4.0....0...1c.1.19.serp.lS3UAqSMRiM), you can run chickpeas through it on a very course setting. That'll crack the peas and dislodge the skin. Skins can then be quickly removed by sieving or shaking. Be cautious when milling though. Chickpeas can be very hard, too hard for a mill that's set for too fine a product.
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
You could pass the chickpeas through a food mill. Pureeing something while holding tough parts back is what these things are designed for.
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
I bought a Vintage Foley Food Mill set with the red handles on eBay... It's great for mashed potatoes, crushing crackers, baby food, and separating the skins off of garbanzo beans for hummus. [![Food mill set](https://i.stack.imgur.com/xljpw.png)](https://i.stack.imgur.com/xljpw.png)
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
I rolled the chickpea between two tea towels and used a rolling pin. Rolled the chickpeas wich loosen the skin then place the chickpeas into a bowl with water and let gravity lifed the skins up to the top. I washed the peas. There you are chickpeas without water easy.
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
the ABSOLUTE BEST WAY, is to cook them only half the time (the dried ones and drained 24 hours), half the time would be 20-25 minutes... take them out after 25 minutes, put a tablespoon of baking soda on an ounce (420 grams), stir the soda in well. Than put them on a very hot flat pan over the fire for 2-3 minutes. The skin will just stick to the pan. Than put the chickpeas back to boil for 20 more minutes. It'll take about 90-95% of the skins without peeling them one by one.
If you have a [hand mill](https://www.google.com/search?safe=off&client=firefox-a&hs=ilW&rls=org.mozilla%3aen-US%3aofficial&q=hand%20mill&oq=hand%20mill&gs_l=serp.1.1.0i7l2j0j0i7l3j0l2j0i7l2.12258.13087.0.18407.4.4.0.0.0.0.319.713.0j3j0j1.4.0....0...1c.1.19.serp.lS3UAqSMRiM), you can run chickpeas through it on a very course setting. That'll crack the peas and dislodge the skin. Skins can then be quickly removed by sieving or shaking. Be cautious when milling though. Chickpeas can be very hard, too hard for a mill that's set for too fine a product.
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
I shell on a regular basis. Dead simple: * Boil dried peas for twenty minutes. * Cool under cold water. * Rub the peas between the hands and float off the skins. * Five rinses and the peas are completely skinned. It takes less than five minutes for a liter. Then cook the chickpeas for about one hours at a gently boil to soften for tempeh making. Pictures: [Removing husks from Chickpeas](http://durgan.org/April%202019/9%20April%202019%20Removing%20husks%20from%20Chickpeas./HTML/)
It has never even occurred to me to try skinning chickpeas. What's the benefit? I pressure-cook them (without soaking) for ~55 minutes—4 parts water per part of beans, with a little salt—let them cool somewhat, and put them in the food processor. The hummus comes out delightfully smooth and creamy. What's not to like?
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
Peeling chickpeas will give you a creamier texture, but won't have much of an effect on taste. The most efficient way I know of peeling them is to rub small handfuls in the palm of your hands. It will still take some time to work through them, but it's far more efficient than using your fingertips. One other possibility is to use a product similar to Oxo's silicon garlic peeler. It's a tube in which you can place garlic and roll around until the cloves are peeled. I have one and it works amazingly well. I suspect it would be great for chickpeas too.
If you have a [hand mill](https://www.google.com/search?safe=off&client=firefox-a&hs=ilW&rls=org.mozilla%3aen-US%3aofficial&q=hand%20mill&oq=hand%20mill&gs_l=serp.1.1.0i7l2j0j0i7l3j0l2j0i7l2.12258.13087.0.18407.4.4.0.0.0.0.319.713.0j3j0j1.4.0....0...1c.1.19.serp.lS3UAqSMRiM), you can run chickpeas through it on a very course setting. That'll crack the peas and dislodge the skin. Skins can then be quickly removed by sieving or shaking. Be cautious when milling though. Chickpeas can be very hard, too hard for a mill that's set for too fine a product.
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
You can also try doing it in a bowlful of water; the skins will float to the surface when they come loose.
I shell on a regular basis. Dead simple: * Boil dried peas for twenty minutes. * Cool under cold water. * Rub the peas between the hands and float off the skins. * Five rinses and the peas are completely skinned. It takes less than five minutes for a liter. Then cook the chickpeas for about one hours at a gently boil to soften for tempeh making. Pictures: [Removing husks from Chickpeas](http://durgan.org/April%202019/9%20April%202019%20Removing%20husks%20from%20Chickpeas./HTML/)
6,106
When making a hummus one of the key factors seems to be removal of chickpea white skins. Are there any tips on how can I effectively peel the skins off in an efficient way?
2010/08/27
[ "https://cooking.stackexchange.com/questions/6106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/138/" ]
the ABSOLUTE BEST WAY, is to cook them only half the time (the dried ones and drained 24 hours), half the time would be 20-25 minutes... take them out after 25 minutes, put a tablespoon of baking soda on an ounce (420 grams), stir the soda in well. Than put them on a very hot flat pan over the fire for 2-3 minutes. The skin will just stick to the pan. Than put the chickpeas back to boil for 20 more minutes. It'll take about 90-95% of the skins without peeling them one by one.
I shell on a regular basis. Dead simple: * Boil dried peas for twenty minutes. * Cool under cold water. * Rub the peas between the hands and float off the skins. * Five rinses and the peas are completely skinned. It takes less than five minutes for a liter. Then cook the chickpeas for about one hours at a gently boil to soften for tempeh making. Pictures: [Removing husks from Chickpeas](http://durgan.org/April%202019/9%20April%202019%20Removing%20husks%20from%20Chickpeas./HTML/)
39,264,031
Trying to update the fields using Form Model Binding, but I am stuck as the following error got displayed: > > ErrorException in HtmlBuilder.php line 431: Array to string conversion > (View: C:\xampp\htdocs\cms\resources\views\posts\edit.blade.php) > > > **Edit.blade.php** ``` {!! Form::model($post, ['method'=>'PUT', ['action'=>'PostsController@update', $post->id]]) !!} {{ csrf_field() }} {!! Form::label('title', 'Title: ') !!} {!! Form::text('title', null) !!} {!! Form::submit('Update Post') !!} {!! Form::close() !!} ``` **Htmlbuilder.php [Line 430-432]** ``` if (! is_null($value)) { return $key . '="' . e($value) . '"'; } ``` I have tried numerous solutions but got no success. I don't know where the problem is.
2016/09/01
[ "https://Stackoverflow.com/questions/39264031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5878788/" ]
Try this code where you send options as associative array: `['method' => value, 'action' => value]` but not a mix `['method' => value, ['action' => value]]` ``` {!! Form::model($post, ['method'=>'POST', 'action'=>['PostsController@update', $post->id]]) !!} ```
You are missing some brackets. The value of `action` should be an array. Try the following **(write in a single line)**: ``` {!! Form::model($post, ['method'=>'PUT', 'action'=> [ 'PostsController@update', $post->id] ]) !!} ```
1,219,610
$$\int(2x+3)\ln (x)dx$$ My attempts, $$=\int(2x\ln (x)+3\ln (x))dx$$ $$=2\int x\ln (x)dx+3\int \ln(x)dx$$ For $x\ln (x)$, integrate by parts,then I got $$=x^2\ln (x)-\int (x) dx+3\int \ln(x)dx$$ $$=x^2\ln (x)-\frac{x^2}{2}+3\int \ln(x)dx$$ For $\ln(x)$, integrate by parts, then I got $$=x^2\ln (x)-\frac{x^2}{2}+3x\ln (x)-3\int 1dx$$ $$=x^2\ln (x)-\frac{x^2}{2}+3x\ln (x)-3x+c$$ $$=\frac{1}{2}x(-x+2(x+3)\ln (x)-6)+c$$ But the given answer in book is $x^2\ln (x)-\frac{x^2}{2}+\frac{3}{x}+c$. What did I do wrong?
2015/04/04
[ "https://math.stackexchange.com/questions/1219610", "https://math.stackexchange.com", "https://math.stackexchange.com/users/221836/" ]
**Bookish answer is wrong:** $$\left(x^2\ln (x)-\frac{x^2}{2}+\frac{3}{x}+c\right)'=2x\log x-\frac3{x^2}$$ **And yours:** $$\left(\frac{1}{2}x(-x+2(x+3)\ln (x)-6)+c\right)'=2x\log x+3\log x=(2x+3)\log x$$
Try this way: $$\int(2x+3)\ln x\ dx=\ln x\int(2x+3)\ dx-\int\left[\frac{d(\ln x)}{dx}\int(2x+3)\ dx\right]dx$$
1,578,227
When i want to use delegate class to make call while windows form working, i always have to use InvokeRequired. It is ok. But who changed the InvokeReuqired property while it is working. Please check this image: ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/813e6d67-2b86-4a15-841d-526d9bcb389e/2009-10-16_1652.png)
2009/10/16
[ "https://Stackoverflow.com/questions/1578227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104085/" ]
[`InvokeRequired`](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invokerequired.aspx) is `true` when the control is accessed from a thread other than the thread it was created on, and `false` otherwise. To more directly answer your question, it's not that the `InvokeRequired` property "changes" at a specific point in time; it's more accurate to say that it may return different values based on the thread you access it from.
What do you mean "change the InvokeRequired property" ? Do you mean that the true/false value is changing ? If it returns true, and you make the delegate call to BeginInvoke, then after that, in the delegate, the value better **have** changed. The whole point is to "switch" to the thread that the control was *created on*. When a line of code with InvokeRequired is executed on any thread other than the thread the control was created on, InvokeRequired will return true. Only when executed on the same thread the control was created on will it return false. The property could have been named `NotOnThreadIWasCreatedIn`, cause thats really all it's doing. It's named `InvokeRequired` to coomunicate what it needs to be used for...
1,578,227
When i want to use delegate class to make call while windows form working, i always have to use InvokeRequired. It is ok. But who changed the InvokeReuqired property while it is working. Please check this image: ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/813e6d67-2b86-4a15-841d-526d9bcb389e/2009-10-16_1652.png)
2009/10/16
[ "https://Stackoverflow.com/questions/1578227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104085/" ]
You're calling `Delegate.BeginInvoke` in `button1_Click`, which means `SayListeyeEkle` will be called in a thread-pool thread - which means it's entirely correct for `InvokeRequired` to be true. It *wouldn't* be true if you called `ListeyeEkle` directly from `button1_Click`, in the UI thread.
What do you mean "change the InvokeRequired property" ? Do you mean that the true/false value is changing ? If it returns true, and you make the delegate call to BeginInvoke, then after that, in the delegate, the value better **have** changed. The whole point is to "switch" to the thread that the control was *created on*. When a line of code with InvokeRequired is executed on any thread other than the thread the control was created on, InvokeRequired will return true. Only when executed on the same thread the control was created on will it return false. The property could have been named `NotOnThreadIWasCreatedIn`, cause thats really all it's doing. It's named `InvokeRequired` to coomunicate what it needs to be used for...
1,082,701
Assuming that we know $$\lim\_{x\rightarrow 0}\frac{e^x-1}{x}=1$$ is it possible to derive that $$\lim\_{x\rightarrow 0}\frac{e^{-ax}-e^{-bx}}{x}=b-a$$ $$\lim\_{x\rightarrow 0}\frac{\tanh{ax}}{x}=\lim\_{x\rightarrow 0}\frac{\frac{e^{ax}-e^{-ax}}{e^{ax}+e^{-ax}}}{x}=a$$ without using L'Hôpital's rule? For the first one I tried separating it into $$\lim\_{x\rightarrow 0}\left(\frac{e^{-ax}-1}{x}-\frac{e^{-bx}-1}{x}\right)$$ But I don't know how to continue.
2014/12/27
[ "https://math.stackexchange.com/questions/1082701", "https://math.stackexchange.com", "https://math.stackexchange.com/users/135291/" ]
$$\lim\_{x\rightarrow 0}\frac{e^{-ax}-e^{-bx}}{x}= \lim\_{x\rightarrow 0}\left(-a\frac{e^{-ax}-1}{-ax}-(-b)\frac{e^{-bx}-1}{-bx}\right) = b-a$$ $$ \lim\_{x\rightarrow 0}\frac{\tanh{ax}}{x}=\lim\_{x\rightarrow 0}\frac{\frac{e^{ax}-e^{-ax}}{e^{ax}+e^{-ax}}}{x}= \lim\_{x\rightarrow 0}\frac{e^{ax}-e^{-ax}}{x} \cdot \frac{1}{e^{ax}+e^{-ax}}= 2a \cdot \frac{1}{2} = a$$
As we are given that $\lim\_{x\rightarrow 0}\dfrac{e^x-1}{x} = 1, \tag{1}$ setting $x = \alpha y, \tag{2}$ $\alpha$ constant, we have $\dfrac{1}{\alpha} \lim\_{y \rightarrow 0}\dfrac{e^{\alpha y}-1}{y} = \lim\_{y \rightarrow 0}\dfrac{e^{\alpha y}-1}{\alpha y} = \lim\_{\alpha y \rightarrow 0}\dfrac{e^{\alpha y}-1}{\alpha y} = 1, \tag{3}$ so that $\lim\_{y \rightarrow 0}\dfrac{e^{\alpha y}-1}{y} = \alpha. \tag{4}$ Applying (3) to $\lim\_{x\rightarrow 0}\dfrac{e^{-ax}-e^{-bx}}{x}, \tag{5}$ we have $\lim\_{x\rightarrow 0}\dfrac{e^{-ax}-e^{-bx}}{x} = \lim\_{x\rightarrow 0} e^{-bx} \dfrac{e^{(b - a)x}-1}{x} = (\lim\_{x\rightarrow 0} e^{-bx})(\lim\_{x\rightarrow 0}\dfrac{e^{(b - a)x}-1}{x})$ $= 1(b - a) = b - a, \tag{6}$ establishing the first requisite limit. The second follows easily from the first: $\lim\_{x\rightarrow 0}\dfrac{\tanh{ax}}{x}=\lim\_{x\rightarrow 0}\dfrac{\dfrac{e^{ax}-e^{-ax}}{e^{ax}+e^{-ax}}}{x} = (\lim\_{x\rightarrow 0} \dfrac{e^{ax}-e^{-ax}}{x})(\lim\_{x\rightarrow 0} \dfrac{1}{e^{ax}+e^{-ax}})$ $= (a - (-a))\dfrac{1}{2} = a. \tag{7}$ Hope this helps! Solstice-Time Greetings, and as ever, ***Fiat Lux!!!***
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
That'll be the *actual spaces in your HTML*. Whitespace between inline-block elements is actually rendered. If you remove the whitespace, then it'll work. e.g. ``` <div class="bottom"><div class="author isred"></div><div class="date ispurple"> </div><div class="tags isgrey"></div> ``` <http://jsfiddle.net/Yq5kA/>
Change the CSS: ``` .author, .date, .tags { display: block; float: left; height: 40px; position: relative; ``` }
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
There are the whitespaces in your source code. You can either delete the whitespaces, or set the font-size of the container to 0 (0r 0.1px to avoid certain browser problems). Just add a wrapper div around all elements, for example named "container", and give it: ``` font-size: 0.1px; ``` See updated fiddle: <http://jsfiddle.net/6sBgx/3/> Keep in mind that for this solution, if the containing divs should have text in them, you have to reset the font-size.
Change the CSS: ``` .author, .date, .tags { display: block; float: left; height: 40px; position: relative; ``` }
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
That'll be the *actual spaces in your HTML*. Whitespace between inline-block elements is actually rendered. If you remove the whitespace, then it'll work. e.g. ``` <div class="bottom"><div class="author isred"></div><div class="date ispurple"> </div><div class="tags isgrey"></div> ``` <http://jsfiddle.net/Yq5kA/>
I know this isn’t the desired solution, but it works: ``` .isred{ background-color:red; margin-right: -5px; } .ispurple{ background-color:purple; margin-right: -5px; } .isgrey{ background-color:grey; } ```
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
That'll be the *actual spaces in your HTML*. Whitespace between inline-block elements is actually rendered. If you remove the whitespace, then it'll work. e.g. ``` <div class="bottom"><div class="author isred"></div><div class="date ispurple"> </div><div class="tags isgrey"></div> ``` <http://jsfiddle.net/Yq5kA/>
There are the whitespaces in your source code. You can either delete the whitespaces, or set the font-size of the container to 0 (0r 0.1px to avoid certain browser problems). Just add a wrapper div around all elements, for example named "container", and give it: ``` font-size: 0.1px; ``` See updated fiddle: <http://jsfiddle.net/6sBgx/3/> Keep in mind that for this solution, if the containing divs should have text in them, you have to reset the font-size.
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
That'll be the *actual spaces in your HTML*. Whitespace between inline-block elements is actually rendered. If you remove the whitespace, then it'll work. e.g. ``` <div class="bottom"><div class="author isred"></div><div class="date ispurple"> </div><div class="tags isgrey"></div> ``` <http://jsfiddle.net/Yq5kA/>
Here's my updated css will resolve the problem ``` .author, .date, .tags { height: 40px; display: inline-block; position: relative; margin-right: -4px; } ```
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
That'll be the *actual spaces in your HTML*. Whitespace between inline-block elements is actually rendered. If you remove the whitespace, then it'll work. e.g. ``` <div class="bottom"><div class="author isred"></div><div class="date ispurple"> </div><div class="tags isgrey"></div> ``` <http://jsfiddle.net/Yq5kA/>
There are actual spaces between HTML elements. So For removing this you can try to do following solutions: [Read This document](http://css-tricks.com/fighting-the-space-between-inline-block-elements/) Try in Jsfiddle - ``` Remove the spaces - http://jsfiddle.net/6sBgx/7/ Negative margin - http://jsfiddle.net/6sBgx/8/ Set the font size to zero to parent element - http://jsfiddle.net/6sBgx/6/ Just float them left - http://jsfiddle.net/6sBgx/9/ ```
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
There are the whitespaces in your source code. You can either delete the whitespaces, or set the font-size of the container to 0 (0r 0.1px to avoid certain browser problems). Just add a wrapper div around all elements, for example named "container", and give it: ``` font-size: 0.1px; ``` See updated fiddle: <http://jsfiddle.net/6sBgx/3/> Keep in mind that for this solution, if the containing divs should have text in them, you have to reset the font-size.
I know this isn’t the desired solution, but it works: ``` .isred{ background-color:red; margin-right: -5px; } .ispurple{ background-color:purple; margin-right: -5px; } .isgrey{ background-color:grey; } ```
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
There are the whitespaces in your source code. You can either delete the whitespaces, or set the font-size of the container to 0 (0r 0.1px to avoid certain browser problems). Just add a wrapper div around all elements, for example named "container", and give it: ``` font-size: 0.1px; ``` See updated fiddle: <http://jsfiddle.net/6sBgx/3/> Keep in mind that for this solution, if the containing divs should have text in them, you have to reset the font-size.
Here's my updated css will resolve the problem ``` .author, .date, .tags { height: 40px; display: inline-block; position: relative; margin-right: -4px; } ```
20,049,394
I am making a blog page and i have designed this <http://jsfiddle.net/thiswolf/6sBgx/> however,i would like to remove white space between the `grey,purple and red boxes` at the bottom of the big red box. This is the css ``` .top_div{ border:1px solid red; position:relative; } .pink{ width:40px; height:40px; display:block; background-color:pink; } .green{ width:40px; height:40px; display:block; background-color:green; } .orange{ width:40px; height:40px; display:block; margin-top:120px; background-color:orange; } .red{ width:600px; height:240px; display:block; background-color:red; margin-left:40px; position:absolute; top:0; } .bottom{ position:relative; } .author,.date,.tags{ height:40px; display:inline-block; position:relative; } .author{ width:120px; border:1px solid green; margin-right:0; } .date{ width:120px; border:1px solid green; } .tags{ width:120px; border:1px solid green; } .isred{ background-color:red; } .ispurple{ background-color:purple; } .isgrey{ background-color:grey; } ``` this is the html ``` <div class="top_div"> <div class="pink"> </div> <div class="green"> </div> <div class="orange"> </div> <div class="red"> </div> </div> <div class="bottom"> <div class="author isred"> </div> <div class="date ispurple"> </div> <div class="tags isgrey"> </div> </div> ```
2013/11/18
[ "https://Stackoverflow.com/questions/20049394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420583/" ]
There are the whitespaces in your source code. You can either delete the whitespaces, or set the font-size of the container to 0 (0r 0.1px to avoid certain browser problems). Just add a wrapper div around all elements, for example named "container", and give it: ``` font-size: 0.1px; ``` See updated fiddle: <http://jsfiddle.net/6sBgx/3/> Keep in mind that for this solution, if the containing divs should have text in them, you have to reset the font-size.
There are actual spaces between HTML elements. So For removing this you can try to do following solutions: [Read This document](http://css-tricks.com/fighting-the-space-between-inline-block-elements/) Try in Jsfiddle - ``` Remove the spaces - http://jsfiddle.net/6sBgx/7/ Negative margin - http://jsfiddle.net/6sBgx/8/ Set the font size to zero to parent element - http://jsfiddle.net/6sBgx/6/ Just float them left - http://jsfiddle.net/6sBgx/9/ ```
31,912,459
I am using below 2 lib's in project 1. spring-core-3.1.0.RELEASE.jar 2. spring-web-3.1.0.RELEASE.jar But android studio is considering duplicate entry for above lib's and giving error while packaging. --- ``` Error:duplicate files during packaging of APK E:\Code\iDoc\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: META-INF/license.txt Origin 1: E:\Code\iDoc\app\libs\spring-core-3.1.0.RELEASE.jar Origin 2: E:\Code\iDoc\app\libs\spring-web-3.1.0.RELEASE.jar You can ignore those files in your build.gradle: android { packagingOptions { exclude 'META-INF/license.txt' } } ------------------------------------------------------------ ``` Anybody faced similar problem ? Please suggest some-work around for this error.
2015/08/10
[ "https://Stackoverflow.com/questions/31912459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3374603/" ]
Go to your `build.gradle` file and add the following line: ``` packagingOptions { exclude 'META-INF/license.txt' } ``` In my case I had to add like this one: ``` apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:+' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.mcxiaoke.volley:library:1.0.15' compile 'com.google.code.gson:gson:2.2.4' compile "org.apache.httpcomponents:httpcore:4.4.1" compile "org.apache.httpcomponents:httpmime:4.3.6" } ``` **Note:** 1. *Meta-files doesn't affect any programmatic functions of application. Meta files basically contains Textual information like legal-notice, Licences etc of open sources libraries. Excluding it will not affect any thing.* 2. *When we use multiple 3rd party open source libraries, sometimes 2 or more projects has same named text files (Example: License.txt or Notice.txt or dependencies.txt). That causes the conflict during build time. In that moment our mighty android studio suggest us to exclude those conflicting meta files.*
I have most simple solution for txt files. If you remove all txt files in the dependency. Only add this block. ``` packagingOptions { exclude '**/*.txt' } ```
31,912,459
I am using below 2 lib's in project 1. spring-core-3.1.0.RELEASE.jar 2. spring-web-3.1.0.RELEASE.jar But android studio is considering duplicate entry for above lib's and giving error while packaging. --- ``` Error:duplicate files during packaging of APK E:\Code\iDoc\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: META-INF/license.txt Origin 1: E:\Code\iDoc\app\libs\spring-core-3.1.0.RELEASE.jar Origin 2: E:\Code\iDoc\app\libs\spring-web-3.1.0.RELEASE.jar You can ignore those files in your build.gradle: android { packagingOptions { exclude 'META-INF/license.txt' } } ------------------------------------------------------------ ``` Anybody faced similar problem ? Please suggest some-work around for this error.
2015/08/10
[ "https://Stackoverflow.com/questions/31912459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3374603/" ]
Go to your `build.gradle` file and add the following line: ``` packagingOptions { exclude 'META-INF/license.txt' } ``` In my case I had to add like this one: ``` apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:+' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.mcxiaoke.volley:library:1.0.15' compile 'com.google.code.gson:gson:2.2.4' compile "org.apache.httpcomponents:httpcore:4.4.1" compile "org.apache.httpcomponents:httpmime:4.3.6" } ``` **Note:** 1. *Meta-files doesn't affect any programmatic functions of application. Meta files basically contains Textual information like legal-notice, Licences etc of open sources libraries. Excluding it will not affect any thing.* 2. *When we use multiple 3rd party open source libraries, sometimes 2 or more projects has same named text files (Example: License.txt or Notice.txt or dependencies.txt). That causes the conflict during build time. In that moment our mighty android studio suggest us to exclude those conflicting meta files.*
Important: When excluding the files note that it is case sensitive ------------------------------------------------------------------ I added this to my gradle and it was not working: ``` packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } ``` I was gettting error: ``` Duplicate files copied in APK META-INF/notice.txt ``` So the fix is to `add META-INF/notice.txt` : ``` packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' } ```
31,912,459
I am using below 2 lib's in project 1. spring-core-3.1.0.RELEASE.jar 2. spring-web-3.1.0.RELEASE.jar But android studio is considering duplicate entry for above lib's and giving error while packaging. --- ``` Error:duplicate files during packaging of APK E:\Code\iDoc\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: META-INF/license.txt Origin 1: E:\Code\iDoc\app\libs\spring-core-3.1.0.RELEASE.jar Origin 2: E:\Code\iDoc\app\libs\spring-web-3.1.0.RELEASE.jar You can ignore those files in your build.gradle: android { packagingOptions { exclude 'META-INF/license.txt' } } ------------------------------------------------------------ ``` Anybody faced similar problem ? Please suggest some-work around for this error.
2015/08/10
[ "https://Stackoverflow.com/questions/31912459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3374603/" ]
Important: When excluding the files note that it is case sensitive ------------------------------------------------------------------ I added this to my gradle and it was not working: ``` packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } ``` I was gettting error: ``` Duplicate files copied in APK META-INF/notice.txt ``` So the fix is to `add META-INF/notice.txt` : ``` packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/notice.txt' } ```
I have most simple solution for txt files. If you remove all txt files in the dependency. Only add this block. ``` packagingOptions { exclude '**/*.txt' } ```
57,933,922
I am using SQL Server 2014. There are two tables `T1` and `T2` with relational data. These tables have more than 100000 rows. `T1` has a primary key `ID` (`varchar`) and `T2` is mapped with this `ID` (`varchar`). I want to add another auto increment column `AutoId` (`int`) to the table `T1`, and I want to add column `AutoId` to table `T2` as well. Then I want to update `AutoId` in `T2` from `T1` based on the existing `ID`. What is the easiest way to solve this?
2019/09/14
[ "https://Stackoverflow.com/questions/57933922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4373282/" ]
your click element is in an iFrame (iFrame id="galaxyIframe" ...). Therefore, you need to tell the driver to switch from the "main" page to said iFrame. If you add this line of code after your `#login` it should work: `driver.switch_to.frame(galaxyIframe)` (If the frame did not have a name, you would use: `iframe = driver.find_element_by_xpath("xpath-to-frame")` and then `driver.switch_to.frame(iframe)` To get back to your default frame, use: `driver.switch_to.default_content()` Crawling GA is generally a pain. Not just because you have these iFrames everywhere. Apart from that, I would recommend looking into [puppeteer](https://developers.google.com/web/tools/puppeteer/), the new kid on the crawler block. Even though the prospect of switching to javascript from python may be daunting, it is worth it! Once you get into it, selenium will have felt super clunky.
You can try with the text: If you want to click on `'Export'-` ``` //button[contains(text(),'Export')] ```
2,655
I made a coffee table out of pallet wood. If I had to guess there is at least 3 different kinds of wood here and I don't know for sure which they are. The white you see is home made chalk paint made from drywall mud and white acrylic paint. It had about 2 coats of paint. To protect and finish I choose polycrylic. Somehow one of the blocks stained the paint yellow. I saw one other block like this but it was not as defined. It reminds me of painting the walls of a former smokers house where the tar seeps through the paint. [![Foot of my coffee table](https://i.stack.imgur.com/gbO5W.jpg)](https://i.stack.imgur.com/gbO5W.jpg) I am still new at finishing and I should have realized that I was applying too much polycrylic as you can see the dripping. While that was bad it did show me something. If you see on the right hand side of the block the yellow colour does not go all the way up the block. There is a drip there that goes from white to yellow. That tells me the finish was not the source of the issue? Perhaps just exacerbated it? Most of the wood pictured has a coat of polycrylic on it and that is not a test coat. I started looking more for the colour and I found one more block that would have been from the same pallet that had a little yellowing. Everyone of those blocks you see had pith so it should be a fair amount of heartwood. Also the spots where you see a little bare wood was done on purpose prior to polycrylicing (If that is a verb). Why did the finish turn yellow in those few places? I think it has something to do with the wood itself. --- As an aside I just sanded down the finish and most of the paint in that area. The table was meant to look distressed anyway. Still curious what happened so I can try to prevent it or at least be aware of it.
2015/10/28
[ "https://woodworking.stackexchange.com/questions/2655", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/128/" ]
> > Why did the finish turn yellow in those few places? I think it has something to do with the wood itself. > > > I actually just had a similar conversation with my dad on this topic. He's a polymer chemist and works for a paint company. What you might be experiencing is *[tannin staining](http://www.sherwin-williams.com/homeowners/ask-sherwin-williams/problem-solver/dirt-stain-discoloration/tannin-staining/)* from the wood underneath the paint. All wood has some level of tannin. With your pallet wood, you have a real crap-shoot with what wood you actually have, so its tannin content could be quite high. What you need is a paint with a tannin blocker in it. [Kilz Premium](http://www.kilz.com/products/primer/kilz-premium)1 is currently the best primer on the market for this purpose, and it has a special shellac-based polymer in it that inhibits tannin staining. Shellac is the best tannin-blocking material known to man2 (thus far). If you're set on using your homemade chalk paint, you might consider applying a seal coat of shellac beneath the paint to help mitigate the tannin staining. Then lightly scuff the shellac coat with fine sandpaper or steel wool so the paint adheres better. --- 1 Full disclosure, my dad does **not** work for Kilz. 2 See page 5 of [this study](http://digitalcommons.calpoly.edu/cgi/viewcontent.cgi?article=1508&context=theses).
All woods have what are called in the trade *extractives* and these tend to be soluble compounds which can be liberated from the wood if it gets wet. You can see this as a "coffee stain effect" when you accidentally drip water or another solvent onto the surface of bare wood and it is allowed to dry on its own. It's usually not a factor when finishing because the wood gets wet fairly uniformly and not sopping wet as when a pool of liquid sits on the wood's surface for some time. Another possible cause in this case (or additional cause) is that pallet wood is very much an unknown quantity, we only guess what it's been through when we snag a pallet and break it down for the wood; so this could be something in the wood that wasn't there originally, or a consequence of the weathering the surface endured while it was in use.
397,103
I went to <http://www.elm-chan.org/docs/lcd/hd44780_e.html> in an attempt to find out how to make an LCD module work with the shortest timings. While the site does help with the initialization of the LCD, I feel as if it is not helping me enough. Various sources state that for each LCD command or data processed, there is roughly a 40uS to 1.7mS delay before the command is complete. The website mentions that I could poll the busy flag on the LCD but that would be too long of a delay (Its mentioned under the CPU load heading on the site). So what I want to do is create a fixed delay in software so that the software continues to function even if the LCD gets disconnected from the circuit during operation. The question is, where exactly do I implement the long microsecond delay in the code? Do I insert the delay after I set enable to high (where green question mark is) or do I insert the delay after I set enable to low (where blue question mark is)? I think its the latter, but I want to make sure. [![LCD timing](https://i.stack.imgur.com/B9zsn.png)](https://i.stack.imgur.com/B9zsn.png)
2018/09/20
[ "https://electronics.stackexchange.com/questions/397103", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/180003/" ]
Short answer: **Yes**, a voltage-controlled voltage source. The most-expected load is a low-impedance dynamic speaker in the 2-ohm to 16-ohm ballpark. An amplifier having a very low Thevenin equivalent output resistance is helpful to provide good damping. An ideal voltage source fits that profile. A voltage-controlled voltage source might be specified as having a voltage gain, but you do not often see a spec like this for an audio amplifier. Of more interest is how many watts can be delivered to a load resistance before distortion sets in. The typical distortion type will be clipping of top peak and bottom peak of a sine wave. The input side of an amplifier might have 10k - 100k input resistance: a voltage across this resistance is amplified and reproduced at the output. So a little current does flow from the driving source. Many audio amplifiers are AC-coupled, so that voltage gain does not extend to DC. Some audio amplifiers have DC-coupled output stages.
No, it is not that simple. For example, a VCVS, like any ideal voltage source, provides the same voltage regardless of the load current. A real audio amplifier doesn't do that. Likewise, an ideal VCVS doesn't draw any current from the controlling voltage but a real amplifier does draw current from the input. The input to an amplifier is generally modeled as an impedance to ground. The output is best modeled using a Thevenin equivalent circuit.
397,103
I went to <http://www.elm-chan.org/docs/lcd/hd44780_e.html> in an attempt to find out how to make an LCD module work with the shortest timings. While the site does help with the initialization of the LCD, I feel as if it is not helping me enough. Various sources state that for each LCD command or data processed, there is roughly a 40uS to 1.7mS delay before the command is complete. The website mentions that I could poll the busy flag on the LCD but that would be too long of a delay (Its mentioned under the CPU load heading on the site). So what I want to do is create a fixed delay in software so that the software continues to function even if the LCD gets disconnected from the circuit during operation. The question is, where exactly do I implement the long microsecond delay in the code? Do I insert the delay after I set enable to high (where green question mark is) or do I insert the delay after I set enable to low (where blue question mark is)? I think its the latter, but I want to make sure. [![LCD timing](https://i.stack.imgur.com/B9zsn.png)](https://i.stack.imgur.com/B9zsn.png)
2018/09/20
[ "https://electronics.stackexchange.com/questions/397103", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/180003/" ]
Yes, it is a voltage controlled voltage source, but not ideal. An input voltage of a few volts and a few micro-amps is amplified by about 20 to 30 times to drive a speaker of 2 to 8 ohms typical. This requires the amplifier to source **much** more current with a rise in voltage, until the sound level the user wanted is reached, or the amplifier or speaker is overloaded. A quality amplifier will sense this and shut down. A close-to-ideal amplifier has a very small output impedance much less than 1 ohm, so it has a firm grip on the motion of the speakers, especially the woofers which draw the most current. The power supply may have capacitors well above 20,000uF to support high current surges. There is a reason why high-performance amplifiers may be wired to the speakers with short runs of twisted 8 gauge Monster Cable. Also large diodes may be used to protect the outputs from back-emf from the woofers trying to return to a center position. The frequency range of a high-performance amplifier is often way below and above the human range of hearing, so capacitors may be used for input and outputs to block DC offset voltages, but some of the best amplifiers use a servo-loop IC to cancel out any DC at the amplifier outputs. This avoids using capacitors which tend to cause phase shifting at very low frequencies, hence the term "muddy" bass. However this could be the fault of the woofer enclosure as well. Undersized speaker wire such as zip cord can also cause muddy and weak bass due to the resistance of the wire.
No, it is not that simple. For example, a VCVS, like any ideal voltage source, provides the same voltage regardless of the load current. A real audio amplifier doesn't do that. Likewise, an ideal VCVS doesn't draw any current from the controlling voltage but a real amplifier does draw current from the input. The input to an amplifier is generally modeled as an impedance to ground. The output is best modeled using a Thevenin equivalent circuit.
53,840,703
I am using ASP.NET MVC and EF to create a vehicle reservation app in which a user will be able to reserve multiple vehicles for one datetime, if they want. I created a stored procedure to prevent double booking of vehicles, but am having trouble figuring out how to add the results to a list. Example: I want to reserve Vehicle#1 and Vehicle#2 for 12/18/2018 from 12:00 to 13:00....stored procedure goes to db to find out that Vehicle#1 is already reserved from 12:00 to 13:00, but Vehicle#2 is not reserved. Due to the `foreach` that runs, `alreadyReservedVehicle` comes back with the result of `.Count() = 0` because it sees the last result, which is that Vehicle#2 is not reserved. It should be showing an error message to say double booking is not allowed, since Vehicle#1 is already reserved, but it isn't counting that reservation. Is there a way to collect both results and tell the application that because one of those 2 vehicles are reserved, that neither vehicle can be reserved? ``` public ActionResult Create([Bind(Include = "ID,StartDate,EndDate,RequestorID,Destination,PurposeOfTrip,TransportStudentsFG,LastChangedBy,LastChangedDate,VehicleList,ThemeColor")] Reservations reservation) { if (ModelState.IsValid) { var selectedVehicles = reservation.VehicleList.Where(x => x.IsChecked == true).ToList(); List<usp_PreventDoubleBooking_Result> alreadyReservedVehicle = null; // get each vehicle that was selected to be reserved then check db to make sure it is available foreach (var selectedVehicle in selectedVehicles) { using (VehicleReservationEntities db = new VehicleReservationEntities()) { alreadyReservedVehicle = db.usp_PreventDoubleBooking(selectedVehicle.ID, reservation.StartDate, reservation.EndDate).ToList(); } } if (alreadyReservedVehicle.Count() == 0) // create a new reservation if the vehicle is available at the selected date and time { db.Reservations.Add(reservation); reservation.LastChangedDate = DateTime.Now; db.SaveChanges(); } else { //return error message on page if vehicle is already reserved TempData["Error"] = "Double booking of vehicles is not allowed. Please choose another vehicle/time. Check the availability timeline before reserving to ensure there are no errors. Thank you."; return RedirectToAction("Create"); } } } ``` Above is what I have so far and I know I am close, because what I have will work assuming a user is only trying to reserve one vehicle that is already booked. It's when they are trying to create a reservation for multiple vehicles where the code only counts the last vehicle in the list and uses that as the result that determines whether or not the reservation will be saved. I thought about moving the conditional statement into the foreach, but I don't want the reservation to be saved for each vehicle that was selected...that wouldn't make any sense because there is only 1 reservation to be saved, it just has multiple vehicles that can be associated to it. Here is the stored procedure that finds the reserved vehicles: ``` SELECT v.ID, r.StartDate, r.EndDate FROM dbo.Reservations r JOIN dbo.ReservationToVehicle rtv ON r.id = rtv.ReservationID JOIN dbo.Vehicles v ON v.ID = rtv.VehicleID WHERE (v.ID = @VehicleID) AND (r.StartDate <= @NewEndDate) AND (r.EndDate >= @NewStartDate) ``` So how can I get the `alreadyReservedVehicle` `List` to add each result to the list so I can determine if the `List` actually has a `Count` of 0? UPDATE: Here is the model for the stored procedure ``` public partial class usp_PreventDoubleBooking_Result { public int ID { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } } ```
2018/12/18
[ "https://Stackoverflow.com/questions/53840703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/880688/" ]
``` public ActionResult Create(/*Bind attribute omitted*/ Reservations reservation) { if (ModelState.IsValid) { // Is 'IsChecked' nullable? If not, "== true" is redundant. var selectedVehicles = reservation.VehicleList.Where(x => x.IsChecked == true).ToList(); // get each vehicle that was selected to be reserved then check db to make sure it is available using (VehicleReservationEntities db = new VehicleReservationEntities()) { foreach (var selectedVehicle in selectedVehicles) { // 'alreadyReservedVehicle' can be declared here because you don't need to let it // out of its cage, I mean the loop. List<usp_PreventDoubleBooking_Result> alreadyReservedVehicle = db.usp_PreventDoubleBooking(selectedVehicle.ID, reservation.StartDate, reservation.EndDate).ToList(); if (alreadyReservedVehicle.Count() > 0) { //return error message on page if vehicle is already reserved TempData["Error"] = "Double booking of vehicles is not allowed. Please choose another vehicle/time. Check the availability timeline before reserving to ensure there are no errors. Thank you."; return RedirectToAction("Create"); } } } // create a new reservation if the vehicle is available at the selected date and time db.Reservations.Add(reservation); reservation.LastChangedDate = DateTime.Now; db.SaveChanges(); } } ```
You could do something like: ``` var preventDoubleBookingList= await context.Database.SqlQuery<usp_PreventDoubleBooking>("sproc_name", prams_here).ToListAsync(); ``` You will have to create a model that matches the sproc.
25,881,438
I'm trying to redirect 404 pages to my main site with the following config in nginx : ``` server { listen 80; server_name localhost; root /var/www/mysite; include /etc/nginx/rewrite/*.conf; fastcgi_intercept_errors on; location / { try_files $uri $uri/ /index.php?$args ; index index.php; } location ~ ^/(news|items)/? { error_page 404 =301 @redirect; } location @redirect { rewrite .* / permanent; } location ~ \.php$ { fastcgi_pass unix:/tmp/php5-fpm.socket; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } ``` As with this config, all 404 pages are redirected to / site. How can I further tweak this config so that I will just redirect ONLY 404 that occurs on a sub-url and their down line with a 301 (eg. /news/***/*** and /items/*\**) while keep the other 404 intact? To illustrate further : To redirect 404 for the following with 301 : ``` /news/ /items/ ``` To keep 404 for the rest, for example : ``` / /posts /images /videos ``` UPDATE : I've modified the config based on recommendation by Melvin. It now redirects everything requests that starts with /news and /items regardless of whether is 404 or not. I'm using Yii PHP Framework. There are no physical location for the folders mentioned above, they are just a route for Yii. UPDATE 2 : Found a solution. Check out my answer below.
2014/09/17
[ "https://Stackoverflow.com/questions/25881438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3440733/" ]
**[Live demo](http://ideone.com/FMzFhA)** ``` $email1 = "info@mytestdomain.com"; echo preg_replace("/(.*@)([^\.]+)(\..*)/","$1***$3",$email1); ``` **Output:** ``` info@***.com ```
You can use this assertion based regex. ``` $eml = preg_replace('/@\K[^.]+/', '***', $eml); ``` [Live Demo](http://regex101.com/r/xS0iT4/1)
25,881,438
I'm trying to redirect 404 pages to my main site with the following config in nginx : ``` server { listen 80; server_name localhost; root /var/www/mysite; include /etc/nginx/rewrite/*.conf; fastcgi_intercept_errors on; location / { try_files $uri $uri/ /index.php?$args ; index index.php; } location ~ ^/(news|items)/? { error_page 404 =301 @redirect; } location @redirect { rewrite .* / permanent; } location ~ \.php$ { fastcgi_pass unix:/tmp/php5-fpm.socket; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } ``` As with this config, all 404 pages are redirected to / site. How can I further tweak this config so that I will just redirect ONLY 404 that occurs on a sub-url and their down line with a 301 (eg. /news/***/*** and /items/*\**) while keep the other 404 intact? To illustrate further : To redirect 404 for the following with 301 : ``` /news/ /items/ ``` To keep 404 for the rest, for example : ``` / /posts /images /videos ``` UPDATE : I've modified the config based on recommendation by Melvin. It now redirects everything requests that starts with /news and /items regardless of whether is 404 or not. I'm using Yii PHP Framework. There are no physical location for the folders mentioned above, they are just a route for Yii. UPDATE 2 : Found a solution. Check out my answer below.
2014/09/17
[ "https://Stackoverflow.com/questions/25881438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3440733/" ]
You can use this assertion based regex. ``` $eml = preg_replace('/@\K[^.]+/', '***', $eml); ``` [Live Demo](http://regex101.com/r/xS0iT4/1)
You could use a [positive lookahead](http://www.regular-expressions.info/lookaround.html) also. ``` $email1 = "info@mytestdomain.com"; echo preg_replace("/[^@]+(?=\.)/","***",$email1); ``` **Pattern Explanation:** `[^@]+(?=\.)` Matches any character but not of `@` one or more times only if the characters are followed by a literal dot.
25,881,438
I'm trying to redirect 404 pages to my main site with the following config in nginx : ``` server { listen 80; server_name localhost; root /var/www/mysite; include /etc/nginx/rewrite/*.conf; fastcgi_intercept_errors on; location / { try_files $uri $uri/ /index.php?$args ; index index.php; } location ~ ^/(news|items)/? { error_page 404 =301 @redirect; } location @redirect { rewrite .* / permanent; } location ~ \.php$ { fastcgi_pass unix:/tmp/php5-fpm.socket; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } ``` As with this config, all 404 pages are redirected to / site. How can I further tweak this config so that I will just redirect ONLY 404 that occurs on a sub-url and their down line with a 301 (eg. /news/***/*** and /items/*\**) while keep the other 404 intact? To illustrate further : To redirect 404 for the following with 301 : ``` /news/ /items/ ``` To keep 404 for the rest, for example : ``` / /posts /images /videos ``` UPDATE : I've modified the config based on recommendation by Melvin. It now redirects everything requests that starts with /news and /items regardless of whether is 404 or not. I'm using Yii PHP Framework. There are no physical location for the folders mentioned above, they are just a route for Yii. UPDATE 2 : Found a solution. Check out my answer below.
2014/09/17
[ "https://Stackoverflow.com/questions/25881438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3440733/" ]
**[Live demo](http://ideone.com/FMzFhA)** ``` $email1 = "info@mytestdomain.com"; echo preg_replace("/(.*@)([^\.]+)(\..*)/","$1***$3",$email1); ``` **Output:** ``` info@***.com ```
You could use a [positive lookahead](http://www.regular-expressions.info/lookaround.html) also. ``` $email1 = "info@mytestdomain.com"; echo preg_replace("/[^@]+(?=\.)/","***",$email1); ``` **Pattern Explanation:** `[^@]+(?=\.)` Matches any character but not of `@` one or more times only if the characters are followed by a literal dot.
163,437
> > Let $G$ be a finite group with two subgroups $A$ and $B$. Show that if $A$ is Abelian and is normal in $G$, then $A\cap B$ is normal in $AB.$ > > > It's been awhile since I did Abstract Algebra, (this is a prelim question) the above seems easy but still I want to check my proof: We will first show that $A\cap B\leq AB.$ Observe that $A\cap B$ is a subset of $AB$ since if $x\in A\cap B$ then $x\in A$ and $x\in B$ and thus( for $x\in A $ and $e\in B$) $x\in AB=\{ab: a\in A \text{ and } b\in B\}.$ Clearly, $e \in A\cap B.$ Suppose that $x,y\in A\cap B.$ Then $x,y\in A$ and $x,y\in B.$ Since $A,B\leq G$, we have that $xy\in A$ and $xy\in B$, and thus $xy\in A\cap B.$ Finally, if $x\in A\cap B$ then $x^{-1}\in A\cap B$ since $x,x^{-1}\in A$ and $x,x^{-1}\in B.$ Now we will show that $A\cap B \triangleleft AB.$ Observe that if $k\in A\cap B$ and $g\in AB$ then it suffices to show that $gkg^{-1}\in A\cap B.$ Now consider, $\forall k\in A\cap B$ and $g\in AB$: $$\begin{align\*} gkg^{-1}&=(ab)k(ab)^{-1} &&\text{ (where }a\in A \text{ and } b\in B)\\ &=a(bkb^{-1})a^{-1}\\ &=ak'a^{-1}&&\text{ (Since } A\triangleleft G \, , k'=bkb^{-1}\in A)\\ &=k'aa^{-1}&&\text{ (Since } A \text{ is Abelian )}\\ &=k'e\\ &=k'\in A\\ &\implies gkg^{-1}=k'\in A\cap B\\ \end{align\*}$$
2012/06/26
[ "https://math.stackexchange.com/questions/163437", "https://math.stackexchange.com", "https://math.stackexchange.com/users/25683/" ]
The first part is too complicated: $A\subseteq AB$ (whether or not $AB$ is a group), and $A\cap B\subseteq A$; so you are done as far as inclusion; and intersection of subgroups is always a subgroup, so $A\cap B$ is a subgroup and is contained in $AB$. Of course, you should note that $AB$ actually *is* a subgroup, because $AB=BA$ by the normality of $A$. Your final assertion does not follow. You have justified correctly that $k'\in A$; but you have not said a single word as to why it is in $B$. So how do you justify your assertion that $k'\in A\cap B$? The reason it is in $B$ is that $k\in A\cap B$, so $k\in B$. Therefore, $bkb^{-1}$, being a product of elements in $B$, must be in $B$. Since it is also in $A$ (by the reasons given), you h ave that $k'=bkb^{-1}\in A\cap B$.
Here is another solution: I don't mean that it's better, but I think you might pick up some tricks from it. When you want to prove normality of a subgroup, it's sometimes useful (and certainly logical) to look at $N\_G(H):=\{g\in G\mid gHg^{-1}\subseteq H \}$. (This is called the *normalizer* of $H$ in $G$. 1. Lemma: $N\_G(H)$ is a subgroup of $G$, and in fact it is the largest subgroup of $G$ in which $H$ is normal. 2. Lemma: The product of a subgroup of $G$ and a normal subgroup of $G$ is a subgroup of $G$. Thus, $AB$ is a subgroup of $G$. 3. Since $A\lhd G$, then certainly $A\lhd AB$. By an isomorphism theorem$^\dagger$, $A\cap B\lhd B$. 4. $A\cap B$ is certainly normal in $A$ (and so is every other subgroup of $A$: Why?) 5. Observe $A$ and $B$ are in $N\_G(A\cap B)$, hence the subgroup $AB\subseteq N\_G(A\cap B)$. Done! (by the first lemma!) $\dagger$ The one I am thinking of says if $A\lhd G$ and $B<G$, then $A\cap B\lhd B$ and $AB/A\cong B/(A\cap B)$.
12,081,370
Excuse me for the title, it was a bit hard to explain my problem. So here it is. On <http://appsolute.vacau.com/cms> I have a variable in the textarea. You see the output of the variable from start. Updating the text en submitting the form IS updating the variable. Thus far everything is right, right? On submitting the form, the page is reloaded, but all the content is from the previous content of the variable. But when checking, the variable WAS updated. Even if you refresh the page. So why don't I get to see the actual value of the variable after submitting the form? Hope it makes sense... ``` <html> <head> <title>Milan CMS</title><?php $host = "x"; $dbname = "x"; $username = "x"; $password = "x"; $dbh = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); $sth = $dbh->prepare("SELECT * FROM milan "); $sth->execute(); $result = $sth->fetchAll(); ?> </head> <body> <?php var_dump($result); $myFile = "trainingen.json"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, json_encode($result)); fclose($fh); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="trainingen"> <h3>Trainingen:</h3><p><textarea name="nametrainingen" rows="10" cols="60"><?php echo $result[0]['value']; ?></textarea></p> <input name="submit" type="submit" value="Verzenden"><input type="reset" value="Veld leeg maken"> </form> <?php $invoer = $_POST['nametrainingen']; if (isset($_POST['submit'])) { //test if submit button is clicked $sql = "DELETE FROM milan WHERE tag = 'trainingen'"; $sth = $dbh->prepare($sql); $sth->execute(); $sql = "INSERT INTO milan (tag, value) VALUES ('trainingen', '$invoer')"; $sth = $dbh->prepare($sql); $sth->execute(); } ?> </body> </html> ```
2012/08/22
[ "https://Stackoverflow.com/questions/12081370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611396/" ]
I don't think you'll be able to do it all in 1G. Note that your 200 Mvalue dataset would take ~763 MiB, leaving only ~261 MiB available for auxiliary data. This rules out any approach that requires you to store the indices at the same time as the values, since an index into 200 Mvalues would take at least 28 bits. Practically, you'd really want 32 bits, which would take the same space as the original (presumably 32-bit) floating point values. One approach to consider would be to perform a sort on the original data while logging the decision information to a bitmap, then replacing the original data with rank indices and reversing the permutation using the log. However, the resulting permutation would require at least `log2(N!) > N log2(N) - N log2(e)` bits of storage in the worst case (so there's no way to get around it by using a radix sort or something). For the specified problem, note that `log2(200M)>27` so the log could require more than `(200M * 25.5) / (8bits/byte) ~ 608 MiB` -- almost as large as the original dataset, and far larger than the specified auxiliary space. You could write the decision log to disk, and reread it to generate your answer. But if you're allowing disk I/O, you might as well do an external sort instead, which would allow you to solve problems much larger than your memory could hold.
You don't want to sort the array, but you want to get an array of indices where the positions would be after sorting. It'd take more than your 1 GB of memory, and you'd probably have to do some post-processing to make equal elements have the same rank, but you should be able to use this solution as a beginning point: [Get the indices of an array after sorting?](https://stackoverflow.com/questions/4859261/get-the-indices-of-an-array-after-sorting)
12,081,370
Excuse me for the title, it was a bit hard to explain my problem. So here it is. On <http://appsolute.vacau.com/cms> I have a variable in the textarea. You see the output of the variable from start. Updating the text en submitting the form IS updating the variable. Thus far everything is right, right? On submitting the form, the page is reloaded, but all the content is from the previous content of the variable. But when checking, the variable WAS updated. Even if you refresh the page. So why don't I get to see the actual value of the variable after submitting the form? Hope it makes sense... ``` <html> <head> <title>Milan CMS</title><?php $host = "x"; $dbname = "x"; $username = "x"; $password = "x"; $dbh = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); $sth = $dbh->prepare("SELECT * FROM milan "); $sth->execute(); $result = $sth->fetchAll(); ?> </head> <body> <?php var_dump($result); $myFile = "trainingen.json"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, json_encode($result)); fclose($fh); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="trainingen"> <h3>Trainingen:</h3><p><textarea name="nametrainingen" rows="10" cols="60"><?php echo $result[0]['value']; ?></textarea></p> <input name="submit" type="submit" value="Verzenden"><input type="reset" value="Veld leeg maken"> </form> <?php $invoer = $_POST['nametrainingen']; if (isset($_POST['submit'])) { //test if submit button is clicked $sql = "DELETE FROM milan WHERE tag = 'trainingen'"; $sth = $dbh->prepare($sql); $sth->execute(); $sql = "INSERT INTO milan (tag, value) VALUES ('trainingen', '$invoer')"; $sth = $dbh->prepare($sql); $sth->execute(); } ?> </body> </html> ```
2012/08/22
[ "https://Stackoverflow.com/questions/12081370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611396/" ]
I don't think you'll be able to do it all in 1G. Note that your 200 Mvalue dataset would take ~763 MiB, leaving only ~261 MiB available for auxiliary data. This rules out any approach that requires you to store the indices at the same time as the values, since an index into 200 Mvalues would take at least 28 bits. Practically, you'd really want 32 bits, which would take the same space as the original (presumably 32-bit) floating point values. One approach to consider would be to perform a sort on the original data while logging the decision information to a bitmap, then replacing the original data with rank indices and reversing the permutation using the log. However, the resulting permutation would require at least `log2(N!) > N log2(N) - N log2(e)` bits of storage in the worst case (so there's no way to get around it by using a radix sort or something). For the specified problem, note that `log2(200M)>27` so the log could require more than `(200M * 25.5) / (8bits/byte) ~ 608 MiB` -- almost as large as the original dataset, and far larger than the specified auxiliary space. You could write the decision log to disk, and reread it to generate your answer. But if you're allowing disk I/O, you might as well do an external sort instead, which would allow you to solve problems much larger than your memory could hold.
You can sort ranges of floats based on their `int` values e.g. `Float.floatToRawInt(float)`. If you have 1 GB and you store 8 bytes per value you can sort groups of up to 128 million or 2^27 values. This means you will be able to rank them all with 2^5 or 32 passes.
12,081,370
Excuse me for the title, it was a bit hard to explain my problem. So here it is. On <http://appsolute.vacau.com/cms> I have a variable in the textarea. You see the output of the variable from start. Updating the text en submitting the form IS updating the variable. Thus far everything is right, right? On submitting the form, the page is reloaded, but all the content is from the previous content of the variable. But when checking, the variable WAS updated. Even if you refresh the page. So why don't I get to see the actual value of the variable after submitting the form? Hope it makes sense... ``` <html> <head> <title>Milan CMS</title><?php $host = "x"; $dbname = "x"; $username = "x"; $password = "x"; $dbh = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); $sth = $dbh->prepare("SELECT * FROM milan "); $sth->execute(); $result = $sth->fetchAll(); ?> </head> <body> <?php var_dump($result); $myFile = "trainingen.json"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, json_encode($result)); fclose($fh); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="trainingen"> <h3>Trainingen:</h3><p><textarea name="nametrainingen" rows="10" cols="60"><?php echo $result[0]['value']; ?></textarea></p> <input name="submit" type="submit" value="Verzenden"><input type="reset" value="Veld leeg maken"> </form> <?php $invoer = $_POST['nametrainingen']; if (isset($_POST['submit'])) { //test if submit button is clicked $sql = "DELETE FROM milan WHERE tag = 'trainingen'"; $sth = $dbh->prepare($sql); $sth->execute(); $sql = "INSERT INTO milan (tag, value) VALUES ('trainingen', '$invoer')"; $sth = $dbh->prepare($sql); $sth->execute(); } ?> </body> </html> ```
2012/08/22
[ "https://Stackoverflow.com/questions/12081370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611396/" ]
I don't think you'll be able to do it all in 1G. Note that your 200 Mvalue dataset would take ~763 MiB, leaving only ~261 MiB available for auxiliary data. This rules out any approach that requires you to store the indices at the same time as the values, since an index into 200 Mvalues would take at least 28 bits. Practically, you'd really want 32 bits, which would take the same space as the original (presumably 32-bit) floating point values. One approach to consider would be to perform a sort on the original data while logging the decision information to a bitmap, then replacing the original data with rank indices and reversing the permutation using the log. However, the resulting permutation would require at least `log2(N!) > N log2(N) - N log2(e)` bits of storage in the worst case (so there's no way to get around it by using a radix sort or something). For the specified problem, note that `log2(200M)>27` so the log could require more than `(200M * 25.5) / (8bits/byte) ~ 608 MiB` -- almost as large as the original dataset, and far larger than the specified auxiliary space. You could write the decision log to disk, and reread it to generate your answer. But if you're allowing disk I/O, you might as well do an external sort instead, which would allow you to solve problems much larger than your memory could hold.
You could try to do [External sorting](http://en.wikipedia.org/wiki/External_sorting) as described on wikipedia. Try to use a memory mapped file when dealing with the float data. ``` public static void main(String[] args) throws IOException { RandomAccessFile raf = new RandomAccessFile("floats.dat", "rw"); FileChannel fc = raf.getChannel(); MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, 1024 * 1024 * 1024); FloatBuffer fb = mbb.asFloatBuffer(); Random random = new Random(); for (int i = 0; i < 200000000; i++) { float rand = random.nextFloat(); fb.put(rand); } fb.flip(); // Read data in chunks, tune the size float[] f = new float[100000]; fb.get(f, 0, f.length); // Process the data using some merge strategy } ``` As I understand the float array itself should not be sorted. Store the int array using memory mapped file as well.
12,081,370
Excuse me for the title, it was a bit hard to explain my problem. So here it is. On <http://appsolute.vacau.com/cms> I have a variable in the textarea. You see the output of the variable from start. Updating the text en submitting the form IS updating the variable. Thus far everything is right, right? On submitting the form, the page is reloaded, but all the content is from the previous content of the variable. But when checking, the variable WAS updated. Even if you refresh the page. So why don't I get to see the actual value of the variable after submitting the form? Hope it makes sense... ``` <html> <head> <title>Milan CMS</title><?php $host = "x"; $dbname = "x"; $username = "x"; $password = "x"; $dbh = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); $sth = $dbh->prepare("SELECT * FROM milan "); $sth->execute(); $result = $sth->fetchAll(); ?> </head> <body> <?php var_dump($result); $myFile = "trainingen.json"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, json_encode($result)); fclose($fh); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="trainingen"> <h3>Trainingen:</h3><p><textarea name="nametrainingen" rows="10" cols="60"><?php echo $result[0]['value']; ?></textarea></p> <input name="submit" type="submit" value="Verzenden"><input type="reset" value="Veld leeg maken"> </form> <?php $invoer = $_POST['nametrainingen']; if (isset($_POST['submit'])) { //test if submit button is clicked $sql = "DELETE FROM milan WHERE tag = 'trainingen'"; $sth = $dbh->prepare($sql); $sth->execute(); $sql = "INSERT INTO milan (tag, value) VALUES ('trainingen', '$invoer')"; $sth = $dbh->prepare($sql); $sth->execute(); } ?> </body> </html> ```
2012/08/22
[ "https://Stackoverflow.com/questions/12081370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611396/" ]
I don't think you'll be able to do it all in 1G. Note that your 200 Mvalue dataset would take ~763 MiB, leaving only ~261 MiB available for auxiliary data. This rules out any approach that requires you to store the indices at the same time as the values, since an index into 200 Mvalues would take at least 28 bits. Practically, you'd really want 32 bits, which would take the same space as the original (presumably 32-bit) floating point values. One approach to consider would be to perform a sort on the original data while logging the decision information to a bitmap, then replacing the original data with rank indices and reversing the permutation using the log. However, the resulting permutation would require at least `log2(N!) > N log2(N) - N log2(e)` bits of storage in the worst case (so there's no way to get around it by using a radix sort or something). For the specified problem, note that `log2(200M)>27` so the log could require more than `(200M * 25.5) / (8bits/byte) ~ 608 MiB` -- almost as large as the original dataset, and far larger than the specified auxiliary space. You could write the decision log to disk, and reread it to generate your answer. But if you're allowing disk I/O, you might as well do an external sort instead, which would allow you to solve problems much larger than your memory could hold.
If you are using the standard Java sorting method and an array of floats you are fine with ~1.2GB IMO as it already uses a very space efficient and fast (n lg(n)) sorting method ([TimSort](http://en.wikipedia.org/wiki/Timsort), [MergeSort](http://en.wikipedia.org/wiki/Merge_sort)) - see Arrays.sort. To make it even faster you could convert the floats to integers (but you'll need to know precision up front) and then apply [integer sort](http://karussell.wordpress.com/2010/03/01/fast-integer-sorting-algorithm-on/) or the already mentioned radix sort.
54,917,457
this is my first time posting. I'm in a beginner Javascript class with the following assignment: "Students are required to enter into a text box their course information in the following format: AAA.111#2222\_aa-1234 Your Web page will ask the user to type their information in a text box. The user will then click a form button named validate. If the format is correct a message will be generated below the button that reads "Correct Format". If the format is incorrect a message will be generated that reads "Incorrect Format". " After my first attempt, I got the following feedback: "You do not need a form for this assignment .You only need a text box and a button. Place your function on your button (onClick event). You only need one function for this assignment.  Your function should include getting the users input from the text box. You can use getElementById() and .value it should also include the regular expression, and what to so if it is correct or wrong." So far I have the following: ```js function isValid(text) { var myRegExp = /([A-Z]{3})\.\d{3}#\d{4}_(sp|su|fa)-\d{4}/; return (myRegExp.test(text); if (isValid(document.getElementById("course".value) { document.getElementById("output").innerHTML = "Correct Format"; } else { document.getElementById("output").innerHTML = "Incorrect Format" } } ``` ```html <!DOCTYPE html> <html lang="en"> <head> <title>Chapter 6 Assignment</title> </head> <body> <p>Please enter your course information in the following format AAA.111#2222_aa-1234:</p> <input type ="text" name ="course" id="course" /> <button onclick="isValid()">Validate</button> <p id="output"></p> <script src = "registerFourth.js"></script> </body> </html> ``` So sorry if I am not posting this correctly. My code is telling me I have a "Parsing Error: Unexpected Token" and when I fill in the text box and click Validate nothing happens. Thank you!
2019/02/28
[ "https://Stackoverflow.com/questions/54917457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11128281/" ]
You can create batch of may be 1 million records and can use insertMany function to insert bulk into database.
Use [InsertMany](https://mongoosejs.com/docs/api.html#model_Model.insertMany) Insert/update always takes time in all kinda database. try to reduce number of insertion. Insert something for every 1000 or loops once ``` Model.insertMany(arr, function(error, docs) {}); ```
176,513
I am aware that there is serverfault and stackoverflow, each to their own specific role on the stack exchange servers. On the chance I have a question which is server specific but includes some programming environment; where would a question like this belong? Question is about using IIS to have a mapped module for two versions of PHP, which also consists of the ups and downsides of each of the server specific roles which IIS 7.0+ has to offer, like possible vulunerabilities and such. Chances are if I post something relivent to a server configuration, I would be re-directed to serverfault; But if I ask on Serverfault, chances are that my question will be redirected or even closed due to it's programming nature? So which one would a question like so belong on? (by this, I mean a question specific to a server configuration for a programming environment?)
2013/04/14
[ "https://meta.stackexchange.com/questions/176513", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/203947/" ]
This would be very helpful. The system already varies another tooltip based on context, so it should be possible here too. Here is the tooltip on one of my questions on the "accept" checkmark if I haven't accepted the answer: [![click to accept this answer etc](https://i.stack.imgur.com/4sYBn.png)](https://i.stack.imgur.com/4sYBn.png) And here is one on an answer I accepted: [![click to undo, plus acceptance timestamp](https://i.stack.imgur.com/ynS3y.png)](https://i.stack.imgur.com/ynS3y.png) The acceptance tooltip tells me when I accepted the answer. That's actually true for anybody who hovers, but for *me* it also gives me instructions about undoing it. So the tooltip code knows that it's my vote and modifies the message accordingly. Appending the "you voted on $date/time" part when mousing over your own vote would be consistent with this.
In [the duplicate question](https://meta.stackexchange.com/questions/361514/show-when-i-voted-for-the-post) I proposed an alternative solution (that was not available when this question was created). One of the possible implementations would be to show when clicking history button on `/timeline?filter=WithVoteSummaries` some extra note, e.g. ``` Jul 29 '19 votes daily summary N/A Up: 4 Down: 1 Bookmark: 2 you voted, you bookmarked ``` I also proposed to show time of my bookmark in the same way. Please also note that suggested in the change request tooltips do not work well on touch devices (tablets and mobiles)
72,183,927
I have a dataframe with unique values (df\_values) that I want to subtract from all rows in a column of another dataframe (df) ``` >>> df_values Id value 0 1 2 1 2 3 2 3 2 ``` ``` >>> df Id T_air 0 1 2 1 1 4 2 1 2 3 2 3 4 2 4 5 2 3 6 3 4 ``` I can do it by defining a function like this: ``` def conv(x, y, p): if y == 1: return x-p[0] elif y == 2: return x-p[1] elif y == 3: return x-p[2] df['norm']=df.apply(lambda x : conv(x['T_air'], x['Id'],df_value['value']), axis=1) ``` So the result would be: ``` >>> df Id T_air norm 0 1 2 0 1 1 4 2 2 1 2 0 3 2 3 0 4 2 4 1 5 2 3 0 6 3 4 2 ``` But since I have so many groupby items I would like to find a simpler way to achieve this. Any Ideas would help :)
2022/05/10
[ "https://Stackoverflow.com/questions/72183927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15792263/" ]
Argument passing to the parameter of a function happens using **copy initialization** which is different than using copy assignment `operator=`. Note that initialization and assignment are two different things in C++. In particular, passing argument happens using "copy initialization" and not "copy assignment". From [decl.init.general#14](https://eel.is/c++draft/dcl.init.general#14): > > The initialization that occurs in the = form of a brace-or-equal-initializer or condition ([stmt.select]), as well as in **argument passing**, function return, throwing an exception ([except.throw]), handling an exception ([except.handle]), and aggregate member initialization ([dcl.init.aggr]), is called **copy-initialization**. > > > (end quote) Similarly, from [copy initialization](https://en.cppreference.com/w/cpp/language/copy_initialization): > > Copy initialization is performed in the following situations: > > > * 3. when passing an argument to a function **by value** > > > (end quote) Also, note that the order of the copy initialization of the parameter from the arguments is unspecified. --- > > Does initialization of parameters take place as T1 x = a ; and T2 y = b ; ? > > > In your example, when you passed arguments `a` and `b` to parameters `x` and `y`, the observed behavior would be as if we wrote `T1 x = a;` and `T2 y = b;`. You can verify this using this [demo](https://onlinegdb.com/2SfyNwp5u). Note again that the order of copy is unspecified.
In initializing the function parameters, `T1::operator=` is not called. Instead `T1::T1( const T1 &)` is called. The `operator=` could only be called if the argument were first constructed, using `T1::T1()`, which might not even exist. You could create all these functions and put log-output in them to see this behavior in action.
206,759
Given a 2-coloring of $\ E(K\_n)$ such that a red edge belongs to no more than one unique Red triangle, show that $\exists \ K\_k \subset K\_n$ which contains no Red triangle, with $\ k>\lfloor\sqrt{2n}\rfloor$. Working through the first few example complete graphs, I've not been able to figure out where this bound comes from. If possible, I'd prefer not to be provided with the proof outright, but rather to be informed relevant results or what might give me some intuition concerning the origin of the bound (What exactly equals the square of double the number of vertices in a complete graph with edge disjoint monochromatic triangles? As far as I can tell, not the number of monochromatic triangles (that depends on the coloring), though that's my first intuition (There are at most $n-\lfloor\sqrt{2n}\rfloor$ edge-disjoint monochromatic triangles for any coloring of the edges, and therefore we can remove one vertex from each triangle, the result will follow.) Thanks for any hints, I will accept.
2012/10/03
[ "https://math.stackexchange.com/questions/206759", "https://math.stackexchange.com", "https://math.stackexchange.com/users/42693/" ]
In this case, this seems to be a bound that just arises when one does the algebra, instead of something having a specific meaning. Here's a hint: Try a greedy algorithm; add elements to the complete subgraph until you can't add anymore, and then bound the number of elements in the complete subgraph. When you solve the inequalities that arise, you should get the desired bound. In general, for greedy/probabilistic arguments, the end bound won't mean something; it'll just be something you get from the algebra. Since you seem interested in related results, I'll mention that it is possible to prove that you will have $o(n^2)$ red triangles in such a graph, but, if I recall correctly, you can get $n^{2-\epsilon}$ for all $\epsilon.$ My first statement follows from the Triangle Removal Lemma; I do not remember the proof of the second.
I didn't play it through, but maybe treating this as an eigenvector problem can help: We may recolour any red edge blue that is not part of any red triangle. Then the matrix $A$ with $a\_{i,j}=1$ iff there is a red edge from $i$ to $j$ has the folowing properties: * $A$ is symmetric hence admits an orthogonal basis of eigenvectors with real eigenvalues $\lambda\_i$. * The sum of all eigenvalues is $\sum \lambda\_i=\operatorname{tr} A=0$. * The diagonal entires of $A^2$ are the number of length-2 paths of a point to itself, that is the (red) degree of that vertex. * The diagonal entires of $A^3$ are the number of length-3 paths of a point to itself, that is again the (red) degree of that vertex (one path for each triangle in two different directions). * From the last two remarks, $\sum\lambda\_i^2 = \sum\lambda\_i^3$ * Everey *isolated* red triangle gives rise to two eigenvalues $-1$ and one eigenvalue $+2$. But I admit, I don't know yet how to make use of this exactly to find "nice" vertices to remove, so maybe this should rather have been a lengthy comment than an answer.
22,039,458
I am trying the following JSP code on server ``` <%@ page language="java" contentType="text/html; charset=UTF-16" pageEncoding="UTF-16"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-16"> <title>Insert title here</title> </head> <body> <% String s = "繁體中文"; String s1 = "繁體中文"; out.println(s + "<br/>"); out.println(s1 + "<br/>"); out.println(s.equalsIgnoreCase(s1 + "<br/>")); %> </body> </html> ``` and when I see the output, it gives me false for comparison. Could anyone please look into this and guide me whats wrong. Note: I have tried UTF-8 encoding as well. Thanks.
2014/02/26
[ "https://Stackoverflow.com/questions/22039458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/488581/" ]
cause you comparing "繁體中文" with "繁體中文[br]" ``` s.equalsIgnoreCase(s1) ``` will give you true
You may need to change condition as follows. ``` out.println(s.equalsIgnoreCase(s1)); ```
22,039,458
I am trying the following JSP code on server ``` <%@ page language="java" contentType="text/html; charset=UTF-16" pageEncoding="UTF-16"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-16"> <title>Insert title here</title> </head> <body> <% String s = "繁體中文"; String s1 = "繁體中文"; out.println(s + "<br/>"); out.println(s1 + "<br/>"); out.println(s.equalsIgnoreCase(s1 + "<br/>")); %> </body> </html> ``` and when I see the output, it gives me false for comparison. Could anyone please look into this and guide me whats wrong. Note: I have tried UTF-8 encoding as well. Thanks.
2014/02/26
[ "https://Stackoverflow.com/questions/22039458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/488581/" ]
You may need to change condition as follows. ``` out.println(s.equalsIgnoreCase(s1)); ```
@Ritesh: You are comparing s with s1+"[br]" while you should compare s with s1 only. So use the following code: ``` out.println(s.equalsIgnoreCase(s1)); ```
22,039,458
I am trying the following JSP code on server ``` <%@ page language="java" contentType="text/html; charset=UTF-16" pageEncoding="UTF-16"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-16"> <title>Insert title here</title> </head> <body> <% String s = "繁體中文"; String s1 = "繁體中文"; out.println(s + "<br/>"); out.println(s1 + "<br/>"); out.println(s.equalsIgnoreCase(s1 + "<br/>")); %> </body> </html> ``` and when I see the output, it gives me false for comparison. Could anyone please look into this and guide me whats wrong. Note: I have tried UTF-8 encoding as well. Thanks.
2014/02/26
[ "https://Stackoverflow.com/questions/22039458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/488581/" ]
cause you comparing "繁體中文" with "繁體中文[br]" ``` s.equalsIgnoreCase(s1) ``` will give you true
@Ritesh: You are comparing s with s1+"[br]" while you should compare s with s1 only. So use the following code: ``` out.println(s.equalsIgnoreCase(s1)); ```
1,697,769
Let $R$ be a ring and let $A$ and $B$ be sets. How can I see the following isomorphism of $R$-modules $$(R^{\oplus A})^{\oplus B} \approx R^{\oplus (A\times B)}$$ as a consequence of the universal properties of Cartesian product of sets and coproduct of $R$-modules? The free functor from sets to $R$-modules is not right adjoint so it doesn't commute with the Cartesian product of sets, but something is happening here ...
2016/03/14
[ "https://math.stackexchange.com/questions/1697769", "https://math.stackexchange.com", "https://math.stackexchange.com/users/131717/" ]
$R^{\oplus A}$ for a set $A$ is a copower, i.e. $\text{Hom}(R^{\oplus A},S) \cong \text{Hom}(A,\text{Hom}(R,S))$ (natural in $S$ and $A$, and $R$ is viewed as a 1-dimensional $R$-module on the right). If needed, show that this is equivalent to $R^{\oplus A}$ is a colimit of a discrete diagram, i.e. a coproduct. Establishing this adjunction is where you'd used the universal property of coproducts. From there, the rest is pretty straight forward: $$\begin{align} \text{Hom}((R^{\oplus A})^{\oplus B},S) & \cong \text{Hom}(B,\text{Hom}(R^{\oplus A}, S)) \\ & \cong \text{Hom}(B,\text{Hom}(A,\text{Hom}(R,S))) \\ & \cong \text{Hom}(A\times B,\text{Hom}(R,S)) \\ & \cong \text{Hom}(R^{\oplus (A\times B)},S) \end{align}$$ Then, "by Yoneda". The introduction of the cartesian product is via the adjunction giving cartesian closure. Note this proof works for any category that has copowers, which includes any category with arbitrary coproducts.
While Derek's answer is the formal way to prove it, here's an intuitive reason that can be made formal by induction: $$(R^{\oplus A})^{\oplus B} = \underbrace{\left ( \underbrace{R \oplus \dots \oplus R}\_{A \text{ times}} \right ) \oplus \left ( \underbrace{R \oplus \dots \oplus R}\_{A \text{ times}} \right ) \oplus \dots \oplus \left ( \underbrace{R \oplus \dots \oplus R}\_{A \text{ times}} \right )}\_{B \text{ times}} $$ Now, you only need to see that $(A \oplus B) \oplus C \cong A \oplus (B \oplus C)$, which you should be able to prove using the universal property.
19,543,472
In matlab, how to generate a vector like this: ``` [1,1,1,...,1,1, 2,2,2,...,2,2, 3,3,3,...,3,3, 4,4,4,...,4,4] ```
2013/10/23
[ "https://Stackoverflow.com/questions/19543472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694518/" ]
Given the simple structure of your vector, a very simple solution is available: ``` ceil((1:24)/6) ``` Very fast for small vectors, and competitive for large ones. When the vector gets really large the `reshape` alternative has better speed. Of course it can easily be generalized: ``` N = 4; M = 6; ceil((1:M*N)/M) ```
You can use: ``` N = 4; M = 6; result = reshape(repmat(1:N,M,1),1,[]) ``` This works by generating `[1,2,3,...,N]`, then copying into `M` rows (`repmat`), and then reading by columns (`reshape`). A usually faster alternative is to replace `repmat` by matrix product and `reshape` by linear indexing (thanks to @Dan and @Floris): ``` result = ones(M,1)*(1:N); result = result(:).' ``` Also see @Dan's answer, which may be faster depending on the version/machine, or @Dennis's, which is probably the fastest.
19,543,472
In matlab, how to generate a vector like this: ``` [1,1,1,...,1,1, 2,2,2,...,2,2, 3,3,3,...,3,3, 4,4,4,...,4,4] ```
2013/10/23
[ "https://Stackoverflow.com/questions/19543472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1694518/" ]
Given the simple structure of your vector, a very simple solution is available: ``` ceil((1:24)/6) ``` Very fast for small vectors, and competitive for large ones. When the vector gets really large the `reshape` alternative has better speed. Of course it can easily be generalized: ``` N = 4; M = 6; ceil((1:M*N)/M) ```
``` kron(1:4, ones(1,6)) ``` I think using a kronecker product might be quicker, but it also might not. See [A similar function to R's rep in Matlab](https://stackoverflow.com/questions/14615305/a-similar-function-to-rs-rep-in-matlab/14620028#14620028)