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
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
Like this? <http://jsfiddle.net/rYFEY/33/> This is the new event handler. I added just one line: ``` $('.ui-resizable-s').dblclick(function(){ alert('clicked bottom handle'); $("#divTest").height(0); }) ```
This seems to work in FF: ``` $(document).ready( function() { $( "#divTest" ).resizable({ maxHeight: 200, maxWidth: 100, minHeight: 0, minWidth: 100, handles:'s', resize: function(event, ui) { $( "#divHeight" ).empty().append("height: " + $(this).he...
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
Like this? <http://jsfiddle.net/rYFEY/33/> This is the new event handler. I added just one line: ``` $('.ui-resizable-s').dblclick(function(){ alert('clicked bottom handle'); $("#divTest").height(0); }) ```
``` $('.ui-resizable-s').dblclick(function(){ $( "#divTest" ).css({height: 0}); }) ``` Hope it helps.
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
Like this? <http://jsfiddle.net/rYFEY/33/> This is the new event handler. I added just one line: ``` $('.ui-resizable-s').dblclick(function(){ alert('clicked bottom handle'); $("#divTest").height(0); }) ```
Try this <http://jsfiddle.net/rYFEY/38/>
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
Like this? <http://jsfiddle.net/rYFEY/33/> This is the new event handler. I added just one line: ``` $('.ui-resizable-s').dblclick(function(){ alert('clicked bottom handle'); $("#divTest").height(0); }) ```
mm i can't seem to find the default function to reset the size thus [i just manually set the div height back to zero.](http://jsfiddle.net/dfVDv/) ``` $("#divTest").height('0'); ``` so if this is the way you're going with and you want to keep more complicated behavior, then i would think you would to manually keep t...
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
``` $('.ui-resizable-s').dblclick(function(){ $( "#divTest" ).css({height: 0}); }) ``` Hope it helps.
This seems to work in FF: ``` $(document).ready( function() { $( "#divTest" ).resizable({ maxHeight: 200, maxWidth: 100, minHeight: 0, minWidth: 100, handles:'s', resize: function(event, ui) { $( "#divHeight" ).empty().append("height: " + $(this).he...
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
``` $('.ui-resizable-s').dblclick(function(){ $( "#divTest" ).css({height: 0}); }) ``` Hope it helps.
Try this <http://jsfiddle.net/rYFEY/38/>
6,451,589
I have the following script which has a double click, on which I would like to change the height. I drag the div down until it is 200px heigh, but when I double click the handle, it will not go back to 0px. Not sure what I am doing wrong? <http://jsfiddle.net/rYFEY/30/>
2011/06/23
[ "https://Stackoverflow.com/questions/6451589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364312/" ]
``` $('.ui-resizable-s').dblclick(function(){ $( "#divTest" ).css({height: 0}); }) ``` Hope it helps.
mm i can't seem to find the default function to reset the size thus [i just manually set the div height back to zero.](http://jsfiddle.net/dfVDv/) ``` $("#divTest").height('0'); ``` so if this is the way you're going with and you want to keep more complicated behavior, then i would think you would to manually keep t...
5,953,941
I am trying to add track information to newly added tracks in iTunes using the COM interface and JavaScript. I am able to successfully add files, but am unable to grab them using OperationStatus.Tracks(). I know that OperationStatus.Tracks() is unavailable until after OperationStatus.InProgress() returns false. However...
2011/05/10
[ "https://Stackoverflow.com/questions/5953941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/653936/" ]
I have since been able to answer my own question. I was simply adding empty parens when no parameters were necessary. As such, the methods and properties were not being recognized. The last line mentioned above will work in the following form: `WScript.Echo(status.InProgress);` To access the tracks that have been ...
Don't forget the result from the AddFile is asynchronous, so you will need to loop and wait before you can access the data. ``` var results = iTunesApp.AddFile( filepath ); // wait for the result to be available while( results.InProgress ) Thread.Yield(); foreach( var it in results.Tracks ) { tune = it as I...
36,833,790
If I inspect on the little bird icon on twitter.com I see that its css has `content: "/f179"`. Is this for twitter's icon? Is this for a special font with lots of special characters including twitter's icon?
2016/04/25
[ "https://Stackoverflow.com/questions/36833790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2430571/" ]
Serialization and the `new` operator are completely different things, though they both result in a reference to a newly allocated object. You can find detailed information about the `new` operator in chapter *15.9.4 Run-Time Evaluation of Class Instance Creation Expressions* of the [Java Language Specification](https:...
New operator is use to create object in memory whereas serialization is the concept belongs to data persistence and it could also be used for creating a new object in memory. If an object implements java.io.Serializable it will be marked as Serializable Object and data in object could be converted to byte stream (ser...
36,833,790
If I inspect on the little bird icon on twitter.com I see that its css has `content: "/f179"`. Is this for twitter's icon? Is this for a special font with lots of special characters including twitter's icon?
2016/04/25
[ "https://Stackoverflow.com/questions/36833790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2430571/" ]
Serialization and the `new` operator are completely different things, though they both result in a reference to a newly allocated object. You can find detailed information about the `new` operator in chapter *15.9.4 Run-Time Evaluation of Class Instance Creation Expressions* of the [Java Language Specification](https:...
Disagree with `deserializiation does not invoke constructors`: In fact, *Deserializiation* just does not invoke the constructors defined in the class body. As depends on `java.reflect`, it of course need to invoke constructors to produce a `Object` from a `Class`. It just invoke the custom constructors created by **`s...
157,249
I'm having this strange issue where my gps pipe is returning the correct location and time but the wrong date (including year). For reference, at the time of writing it is 06 aug 2015, 09:27 UTC). I don't think it's a hardware issue, as on another device the GPS **always** returns the correct date/time. However, on ...
2015/08/06
[ "https://gis.stackexchange.com/questions/157249", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/56311/" ]
In the moment there is no way to colour lines with a gradient style. First buffer your linestrings. Then you can set a gradient colour for the buffer polygons. Here is a HowTo: [How to visualize measure values along linestrings in QGIS?](https://gis.stackexchange.com/questions/128133/how-to-visualize-measure-values-a...
If your polylines is dense enough and of single type, you could use this approach: 1. Set a "Single symbol" as symbolizer 2. Change symbol layer type of a line to "Geometry generator" with type "LineString/MultiLineString" [![geometry_generator](https://i.stack.imgur.com/7NXfa.png)](https://i.stack.imgur.com/7NXfa.png...
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
If you want a method in one class to know about an instance of another class (an instance is created when you call "new", and assigned to a variable, like subject), the variable either needs to a) be global, as glenn mcdonald indicated by suggesting you use $subject. The $ indicates a global variable b) be a member ...
I'm not sure if this is what you mean, but you can create a class method: ``` class Test def self.doSomething puts "I'm working" end end ``` That should let you call that method without instantiating an object. But then your `subject.doSomething` line should be `Test.doSomething` . Sorry if I misunderstood ...
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
You need to make a decision between calling a method on an instance of Test or just making it a class method and calling that. If it's the former, then you need to hold a reference somewhere so the calling method can see it. There are several ways to do this. * provide the reference to NumberTwo#initialize or some ot...
I'm not sure if this is what you mean, but you can create a class method: ``` class Test def self.doSomething puts "I'm working" end end ``` That should let you call that method without instantiating an object. But then your `subject.doSomething` line should be `Test.doSomething` . Sorry if I misunderstood ...
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
If you want a method in one class to know about an instance of another class (an instance is created when you call "new", and assigned to a variable, like subject), the variable either needs to a) be global, as glenn mcdonald indicated by suggesting you use $subject. The $ indicates a global variable b) be a member ...
Change "subject" to "$subject" and you're all set.
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
You need to make a decision between calling a method on an instance of Test or just making it a class method and calling that. If it's the former, then you need to hold a reference somewhere so the calling method can see it. There are several ways to do this. * provide the reference to NumberTwo#initialize or some ot...
Change "subject" to "$subject" and you're all set.
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
If you want a method in one class to know about an instance of another class (an instance is created when you call "new", and assigned to a variable, like subject), the variable either needs to a) be global, as glenn mcdonald indicated by suggesting you use $subject. The $ indicates a global variable b) be a member ...
If you want a class to call a member of another class, you have to make the class a member of the first class, or derive from that class. Here your `numberTwo` class tries to call a method on an object that it has no reference to (subject).
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
You need to make a decision between calling a method on an instance of Test or just making it a class method and calling that. If it's the former, then you need to hold a reference somewhere so the calling method can see it. There are several ways to do this. * provide the reference to NumberTwo#initialize or some ot...
If you want a class to call a member of another class, you have to make the class a member of the first class, or derive from that class. Here your `numberTwo` class tries to call a method on an object that it has no reference to (subject).
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
If you want a method in one class to know about an instance of another class (an instance is created when you call "new", and assigned to a variable, like subject), the variable either needs to a) be global, as glenn mcdonald indicated by suggesting you use $subject. The $ indicates a global variable b) be a member ...
You need to make a decision between calling a method on an instance of Test or just making it a class method and calling that. If it's the former, then you need to hold a reference somewhere so the calling method can see it. There are several ways to do this. * provide the reference to NumberTwo#initialize or some ot...
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
If you want a method in one class to know about an instance of another class (an instance is created when you call "new", and assigned to a variable, like subject), the variable either needs to a) be global, as glenn mcdonald indicated by suggesting you use $subject. The $ indicates a global variable b) be a member ...
The `otherObject` object needs some way to know about the `something` object. The scope of the method declaration as you have it prevents the class from knowing about `something` when the method is created. Here's one possible solution: ``` class Foo def doSomething puts "I'm working" end end class Bar attr_...
1,695,009
Sorry about the wording of the question, I don't really know how to put it. What I mean is, how could I do this: ``` class Test def doSomething puts "I'm working" end end class numberTwo def doSomethingElse subject.doSomething puts "Doing other things" end end subject = Test.new otherObject = numb...
2009/11/08
[ "https://Stackoverflow.com/questions/1695009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178810/" ]
You need to make a decision between calling a method on an instance of Test or just making it a class method and calling that. If it's the former, then you need to hold a reference somewhere so the calling method can see it. There are several ways to do this. * provide the reference to NumberTwo#initialize or some ot...
The `otherObject` object needs some way to know about the `something` object. The scope of the method declaration as you have it prevents the class from knowing about `something` when the method is created. Here's one possible solution: ``` class Foo def doSomething puts "I'm working" end end class Bar attr_...
1,918,401
Below is a rough and simplified code example of what I am trying to do and it is not working as expected. I am using Linq to Entity in case that matters. Basically in the first loop with the DateClause's ends up returning nothing if I have two date clauses, works great with one date clause. In the TextClause's loop it...
2009/12/16
[ "https://Stackoverflow.com/questions/1918401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196020/" ]
``` var query = context.Table .Where(t => t.Enabled && textClauses.Where(c => c.Contains).All(c => t.title.Contains(c.Text) ) && textClauses.Where(c => c.DoesNotContain).All(c => !t.title.Contains(c.Text) ) && dateClauses.Where(c => c.GreaterThan).All(c => t.date > c.Da...
I've done this before with no issues- perhaps you should try moving the .Select to the end (after the Wheres are done). Also, I use [PredicateBuilder](http://www.albahari.com/nutshell/predicatebuilder.aspx) heavily for added flexibility with dynamic query stuff- right now you're getting "and" semantics for your appende...
1,918,401
Below is a rough and simplified code example of what I am trying to do and it is not working as expected. I am using Linq to Entity in case that matters. Basically in the first loop with the DateClause's ends up returning nothing if I have two date clauses, works great with one date clause. In the TextClause's loop it...
2009/12/16
[ "https://Stackoverflow.com/questions/1918401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196020/" ]
Just a wild guess, but could it be that changing your loops to the following has different results? ``` foreach (DateClause clause in dateClauses) { var capturedClause = clause; switch (clause.Operator) { case Operator.GreaterThan: query = query.Where(l => l.date > capturedC...
I've done this before with no issues- perhaps you should try moving the .Select to the end (after the Wheres are done). Also, I use [PredicateBuilder](http://www.albahari.com/nutshell/predicatebuilder.aspx) heavily for added flexibility with dynamic query stuff- right now you're getting "and" semantics for your appende...
1,918,401
Below is a rough and simplified code example of what I am trying to do and it is not working as expected. I am using Linq to Entity in case that matters. Basically in the first loop with the DateClause's ends up returning nothing if I have two date clauses, works great with one date clause. In the TextClause's loop it...
2009/12/16
[ "https://Stackoverflow.com/questions/1918401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196020/" ]
Just a wild guess, but could it be that changing your loops to the following has different results? ``` foreach (DateClause clause in dateClauses) { var capturedClause = clause; switch (clause.Operator) { case Operator.GreaterThan: query = query.Where(l => l.date > capturedC...
``` var query = context.Table .Where(t => t.Enabled && textClauses.Where(c => c.Contains).All(c => t.title.Contains(c.Text) ) && textClauses.Where(c => c.DoesNotContain).All(c => !t.title.Contains(c.Text) ) && dateClauses.Where(c => c.GreaterThan).All(c => t.date > c.Da...
10,410,833
I've got an old script here, which's based on the functionality that it creates variables from the POST Array. I know it's old and shouldn't be used, but which parameter do I need to activate it? `$_POST['output']` should automatically become `$output`. I've been searching on php.net and google, but I can't seem to fi...
2012/05/02
[ "https://Stackoverflow.com/questions/10410833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1340599/" ]
Easy ``` extract($_POST); ``` Now ``` echo $output; ``` EDITS : The above method has been deprected now. It can be achieved like this ``` extract(array_intersect_key($_POST, $array_of_expected_keys)) ```
There was in previous versions of PHP. From [PHP Post variables](https://stackoverflow.com/questions/7247572/php-post-variables) `register_globals` was an old way of getting the submitted values with their name as variable rather than as post ,get, and request variables. But this is deprecated in newer version. You ne...
5,620,658
> > **Possible Duplicate:** > > [How does an underscore in front of a variable in a cocoa objective-c class work?](https://stackoverflow.com/questions/822487/how-does-an-underscore-in-front-of-a-variable-in-a-cocoa-objective-c-class-work) > > > I found that in Apple's frameworks' header files , Apple name inst...
2011/04/11
[ "https://Stackoverflow.com/questions/5620658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702033/" ]
There is no side-effect. But using an underscore makes reading code a lot easier when accessing private ivars and function parameter names. For example let say you have `NSString *_name;` in your header file. Then in your code would read like so: ``` - (void)doSomethingWithName:(NSString *)name { // the underscor...
To be honest, I named all my local private variable all with an underscore in a really big project and things start looking like this. \_thisVar \_thatVar \_thisSavesSomething In my 10 years of coding and working on big and small projects (where I have done this and not done this). DONT DO IT. It is a total WASTE OF T...
5,620,658
> > **Possible Duplicate:** > > [How does an underscore in front of a variable in a cocoa objective-c class work?](https://stackoverflow.com/questions/822487/how-does-an-underscore-in-front-of-a-variable-in-a-cocoa-objective-c-class-work) > > > I found that in Apple's frameworks' header files , Apple name inst...
2011/04/11
[ "https://Stackoverflow.com/questions/5620658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702033/" ]
There is no side-effect. But using an underscore makes reading code a lot easier when accessing private ivars and function parameter names. For example let say you have `NSString *_name;` in your header file. Then in your code would read like so: ``` - (void)doSomethingWithName:(NSString *)name { // the underscor...
In counter to John, I always prefix my local variables with an underscore, for one major reason - it prevents you from accidentally using the private variable instead of a public variable. The only time a private variable should be accessed is in init, dealloc, and assessor methods. Using a private variable accidentall...
5,620,658
> > **Possible Duplicate:** > > [How does an underscore in front of a variable in a cocoa objective-c class work?](https://stackoverflow.com/questions/822487/how-does-an-underscore-in-front-of-a-variable-in-a-cocoa-objective-c-class-work) > > > I found that in Apple's frameworks' header files , Apple name inst...
2011/04/11
[ "https://Stackoverflow.com/questions/5620658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702033/" ]
To be honest, I named all my local private variable all with an underscore in a really big project and things start looking like this. \_thisVar \_thatVar \_thisSavesSomething In my 10 years of coding and working on big and small projects (where I have done this and not done this). DONT DO IT. It is a total WASTE OF T...
In counter to John, I always prefix my local variables with an underscore, for one major reason - it prevents you from accidentally using the private variable instead of a public variable. The only time a private variable should be accessed is in init, dealloc, and assessor methods. Using a private variable accidentall...
222,262
I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0.5 with \arro...
2015/01/08
[ "https://tex.stackexchange.com/questions/222262", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5566/" ]
Something to start with... I am not able to measure the width of the arrow head. If you can, you might add that to my little macro: ``` % arara: pdflatex \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \newcommand*{\halfway}{0.5*\pgfdecoratedpathlength+.5*3pt} \begin{document} \ti...
**(See update at the end for a general solution)** You can alter the definition of `\pgf@lib@dec@arrowhead`, which is the macro which computes and draws the arrow head when you use `\arrow` as decoration. This is the original version of this macro (which appears in the file `.../generic/pgf/libraries/decorations/pgfl...
222,262
I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0.5 with \arro...
2015/01/08
[ "https://tex.stackexchange.com/questions/222262", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5566/" ]
Something to start with... I am not able to measure the width of the arrow head. If you can, you might add that to my little macro: ``` % arara: pdflatex \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \newcommand*{\halfway}{0.5*\pgfdecoratedpathlength+.5*3pt} \begin{document} \ti...
I was hoping that putting the arrow in a node will allow me to center it, but unfortunately the arrow is "overlayed" as we can see here. ``` \documentclass[varwidth,border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0...
222,262
I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0.5 with \arro...
2015/01/08
[ "https://tex.stackexchange.com/questions/222262", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5566/" ]
Something to start with... I am not able to measure the width of the arrow head. If you can, you might add that to my little macro: ``` % arara: pdflatex \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \newcommand*{\halfway}{0.5*\pgfdecoratedpathlength+.5*3pt} \begin{document} \ti...
The older solutions here have the problem that they either don't work on curves (the tip has to be adjusted tangentially, not along the curve) or that they don't work anymore because the code of the underlying library has changed. Fortunately, the library has become more flexible now by processing the option `xshift` o...
222,262
I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0.5 with \arro...
2015/01/08
[ "https://tex.stackexchange.com/questions/222262", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5566/" ]
**(See update at the end for a general solution)** You can alter the definition of `\pgf@lib@dec@arrowhead`, which is the macro which computes and draws the arrow head when you use `\arrow` as decoration. This is the original version of this macro (which appears in the file `.../generic/pgf/libraries/decorations/pgfl...
I was hoping that putting the arrow in a node will allow me to center it, but unfortunately the arrow is "overlayed" as we can see here. ``` \documentclass[varwidth,border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0...
222,262
I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ: ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \tikz{\draw [decoration={markings, mark=at position 0.5 with \arro...
2015/01/08
[ "https://tex.stackexchange.com/questions/222262", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5566/" ]
**(See update at the end for a general solution)** You can alter the definition of `\pgf@lib@dec@arrowhead`, which is the macro which computes and draws the arrow head when you use `\arrow` as decoration. This is the original version of this macro (which appears in the file `.../generic/pgf/libraries/decorations/pgfl...
The older solutions here have the problem that they either don't work on curves (the tip has to be adjusted tangentially, not along the curve) or that they don't work anymore because the code of the underlying library has changed. Fortunately, the library has become more flexible now by processing the option `xshift` o...
16,662
I'd like to know which file(CSS?), and within the file which element/variable etc. I can edit to adjust the properties of the New Individual Container/Form. I'd like to do 2 things: 1 -Make the Container wider. By default it is 500px, I want to increase it to 60opx. 2 - Adjust the width of the columns to make the 1st...
2017/01/13
[ "https://civicrm.stackexchange.com/questions/16662", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/3575/" ]
As I understand you correctly, you were exploiting a bug, and now its is fixed you search for another solution. One option is to undo the bugfix. You can do this with the following actions: * Lookup the issue (CRM-19550). * Find the pull that contains the patch (<https://github.com/civicrm/civicrm-core/pull/9303>). *...
Perhaps you could do this via a non-Civi webform accessible only to your data entry volunteers (use webform if you are using Drupal as your CMS, or one of the forms plugins that are available for Wordpress) and not collect it in CiviCRM at all. Given that CiviCRM is all about linking data to named contacts and you expr...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
Database Connectivity: These are following step are required to connect java application with database. • Import the sql package ``` Import.java.sql.*; ``` • Load driver ``` Every database has diffirent driver,we are using sql database so driver for sql database is ``` Class.forName(“com.mysql.jdbc.Driver”); ...
Use the below code. This will work ``` import java.sql.*; class MysqlCon{ public static void main(String args[]){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root"); //here is database name, root is username and pass...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is a code (Java 7 style, try-with-resources, more laconic style) to connect and retrieve data from your DB. ``` public static final String SELECT_QUERY = "SELECT * FROM your_table_name"; public static void main(String[] args) { String host = "jdbc:derby://localhost:1527/Employees"; String uName = "root...
Import the packages: Requires that you include the packages containing the JDBC classes needed for database programming. Most often, using import java.sql.\* will suffice. Register the JDBC driver: Requires that you initialize a driver so you can open a communication channel with the database. Open a connection: Requ...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is a code (Java 7 style, try-with-resources, more laconic style) to connect and retrieve data from your DB. ``` public static final String SELECT_QUERY = "SELECT * FROM your_table_name"; public static void main(String[] args) { String host = "jdbc:derby://localhost:1527/Employees"; String uName = "root...
Use the below code. This will work ``` import java.sql.*; class MysqlCon{ public static void main(String args[]){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root"); //here is database name, root is username and pass...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
Maybe you should define your strings before use them. The host URL seems good. You have to install the driver in your server, or to put it in the `/lib` folder of your project. You fill find it in `%DERBY_HOME%/lib` folder, named `derby.jar`, assuming `%DERBY_HOME%` is the directory installation of Derby.
Use the below code. This will work ``` import java.sql.*; class MysqlCon{ public static void main(String args[]){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root"); //here is database name, root is username and pass...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is the project structure ![Project Structure](https://i.stack.imgur.com/VjjiD.png) Try with this **Update** ``` public static void main(String[] args) { // TODO Auto-generated method stub try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.o...
Database Connectivity: These are following step are required to connect java application with database. • Import the sql package ``` Import.java.sql.*; ``` • Load driver ``` Every database has diffirent driver,we are using sql database so driver for sql database is ``` Class.forName(“com.mysql.jdbc.Driver”); ...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is the project structure ![Project Structure](https://i.stack.imgur.com/VjjiD.png) Try with this **Update** ``` public static void main(String[] args) { // TODO Auto-generated method stub try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.o...
Import the packages: Requires that you include the packages containing the JDBC classes needed for database programming. Most often, using import java.sql.\* will suffice. Register the JDBC driver: Requires that you initialize a driver so you can open a communication channel with the database. Open a connection: Requ...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
``` package com.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class DatabaseUtil1 { public static final String DRIVER="oracle.jdbc.driver.OracleDriver"; public static final String URL="jdbc:oracle:thin:@DIPAK-PC:1521:x...
Use the below code. This will work ``` import java.sql.*; class MysqlCon{ public static void main(String args[]){ try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mysql://localhost:3306/sonoo","root","root"); //here is database name, root is username and pass...
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is a code (Java 7 style, try-with-resources, more laconic style) to connect and retrieve data from your DB. ``` public static final String SELECT_QUERY = "SELECT * FROM your_table_name"; public static void main(String[] args) { String host = "jdbc:derby://localhost:1527/Employees"; String uName = "root...
Maybe you should define your strings before use them. The host URL seems good. You have to install the driver in your server, or to put it in the `/lib` folder of your project. You fill find it in `%DERBY_HOME%/lib` folder, named `derby.jar`, assuming `%DERBY_HOME%` is the directory installation of Derby.
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is the project structure ![Project Structure](https://i.stack.imgur.com/VjjiD.png) Try with this **Update** ``` public static void main(String[] args) { // TODO Auto-generated method stub try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.o...
Maybe you should define your strings before use them. The host URL seems good. You have to install the driver in your server, or to put it in the `/lib` folder of your project. You fill find it in `%DERBY_HOME%/lib` folder, named `derby.jar`, assuming `%DERBY_HOME%` is the directory installation of Derby.
21,361,781
I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. ``` public static void main(String[] args) { try { Connection con = DriverManager.getConnection( host, username, password ); Stri...
2014/01/26
[ "https://Stackoverflow.com/questions/21361781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113616/" ]
This is the project structure ![Project Structure](https://i.stack.imgur.com/VjjiD.png) Try with this **Update** ``` public static void main(String[] args) { // TODO Auto-generated method stub try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { System.o...
This is a code (Java 7 style, try-with-resources, more laconic style) to connect and retrieve data from your DB. ``` public static final String SELECT_QUERY = "SELECT * FROM your_table_name"; public static void main(String[] args) { String host = "jdbc:derby://localhost:1527/Employees"; String uName = "root...
6,490,760
We are trying to use early bound types in a CRM2011 plugin. To enable this it appears we need to either add a `ProxyTypesBeavior()`, or call `EnableProxyTypes()`. However, both of these properties apply to an `OrganizationServiceProxy` class, and do not exist on the `IOrganizationService` interface. So if we are using...
2011/06/27
[ "https://Stackoverflow.com/questions/6490760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983/" ]
Guil on this thread offered an option to use reflection to bind the code gen proxy types to the service factory. And it worked for me. Won't be able to register it in sandbox, as reflection needs full trust. ``` factory.GetType().GetProperty("ProxyTypesAssembly").SetValue(factory, typeof(YourCrmContext).Assembly, nul...
Write like this, ``` IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); ```
6,490,760
We are trying to use early bound types in a CRM2011 plugin. To enable this it appears we need to either add a `ProxyTypesBeavior()`, or call `EnableProxyTypes()`. However, both of these properties apply to an `OrganizationServiceProxy` class, and do not exist on the `IOrganizationService` interface. So if we are using...
2011/06/27
[ "https://Stackoverflow.com/questions/6490760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983/" ]
For those of you using CRM Online, the reflection solution won't work since you're stuck in sandbox mode. The following solution using the IProxyTypesAssemblyProvider interface (suggested by Pavel Korsukov) worked for me ([source](http://social.microsoft.com/Forums/en-US/bc7e93d4-1b36-4e21-9449-f51b67a2e52c/crm-2011-o...
Write like this, ``` IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); ```
2,849,745
I am reading a paper about making a phasor model of an inductor. For this they use phasor transformations. The voltage over an inductor is calculated by $$v = L \frac{di}{dt}$$ The current and voltage are in the paper defined as $$i(t) = \Re\left[\bar i(t) e^{j\int \omega\_s dt}\right] $$ $$v(t) = \Re\left[\bar v(t) ...
2018/07/13
[ "https://math.stackexchange.com/questions/2849745", "https://math.stackexchange.com", "https://math.stackexchange.com/users/575978/" ]
We can write $z=2(\cos\theta+i\sin\theta)$, as $|z|=2$. Hence, $z+{1 \over z}=(2\cos\theta+{1 \over 2}\cos\theta)+i(2\sin\theta-{1 \over 2}\sin\theta)$. If we look at the complex plane, then this represents the point $((2+{1 \over 2})\cos\theta,(2-{1 \over 2})\sin\theta)\equiv({5 \over 2}\cos\theta,{3 \over 2}\sin\th...
$z=x+yi$ then $$ \left|z+\frac{1}{z}\right|^2 = \left| z+\frac{z^\*}{zz^\*}\right|^2 = \left| z+\frac{z^\*}{4}\right|^2 = \left| (5/4)x+(3/4)yi\right|^2 = (5/4)^2x^2+(3/4)^2y^2 $$ $$ e=\sqrt{1-\left(\frac{3/4}{5/4}\right)^2} = \frac{4}{5} $$
2,849,745
I am reading a paper about making a phasor model of an inductor. For this they use phasor transformations. The voltage over an inductor is calculated by $$v = L \frac{di}{dt}$$ The current and voltage are in the paper defined as $$i(t) = \Re\left[\bar i(t) e^{j\int \omega\_s dt}\right] $$ $$v(t) = \Re\left[\bar v(t) ...
2018/07/13
[ "https://math.stackexchange.com/questions/2849745", "https://math.stackexchange.com", "https://math.stackexchange.com/users/575978/" ]
We can write $z=2(\cos\theta+i\sin\theta)$, as $|z|=2$. Hence, $z+{1 \over z}=(2\cos\theta+{1 \over 2}\cos\theta)+i(2\sin\theta-{1 \over 2}\sin\theta)$. If we look at the complex plane, then this represents the point $((2+{1 \over 2})\cos\theta,(2-{1 \over 2})\sin\theta)\equiv({5 \over 2}\cos\theta,{3 \over 2}\sin\th...
Making $z=\rho e^{i\phi}$ we have $$ |z|=2 \Rightarrow \rho = 2\to w = z+\frac 1z = 2e^{i\phi}+\frac 12 e^{-i\phi} $$ or $$ w = \frac 12\left(4\cos\phi+4i8\sin\phi+\cos\phi-i\sin\phi\right) = \frac 12\left(5\cos\phi + 3i\sin\phi\right) $$ now calling $2w = X + i Y\; $ we have $$ X = 5\cos\phi\\ Y = 3\sin\phi $$ o...
5,395,113
I convert python dicts with simplejson, but I'd like to customise the output for some defined keys. for example, I'd like the keys `callback` and `scope` to be always rendered with **no surrounding quotes** so the javascript can interpret the data and not read it as a string. example desired output : ``` "data":{ ...
2011/03/22
[ "https://Stackoverflow.com/questions/5395113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/174027/" ]
What do you think `add $s0,$s0,$s0` does? It doubles the number. If the iteration count were 6, then it would double the first value six times. Is this homework? If so, please add that tag to the question.
You are doubling the value every time, not adding the initial value to it as you want. That means it becomes $s0 = 6, $s0 = 12, $s0 = 24, $s0 = 48, $s0 = 96 etc. Use a temporary register to hold the initial value of $s0 ($t0) and when you do your add do it like add $s0 $s0 $t0 (or something to this effect) and it wil...
132,457
How can I create a diffuse texture for my rendered models or game assets ? If possible with a single node setup and no compositing needed.
2019/02/21
[ "https://blender.stackexchange.com/questions/132457", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23134/" ]
* [**Download the node setup**](https://www.youtube.com/redirect?redir_token=xXDjnLE3V0dgt0TA3dAogzDwI4V8MTU1ODE2ODUzOEAxNTU4MDgyMTM4&q=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F19ScjM4mWkClVhYuTHFQVPc3RHpotW2Ln%2Fview%3Fusp%3Dsharing&v=TH5CZMdrASw&event=video_description) * [**Generate an Asset automatically**](http...
**Single Node way with Cycles!** Assume you have a model with some texture and properly UV unwrapped [![model with some texture and UV unwrapped](https://i.stack.imgur.com/WqAoA.png)](https://i.stack.imgur.com/WqAoA.png) Just create New Image with desired dimensions and select it in node editor [![New Image](https://...
132,457
How can I create a diffuse texture for my rendered models or game assets ? If possible with a single node setup and no compositing needed.
2019/02/21
[ "https://blender.stackexchange.com/questions/132457", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/23134/" ]
* [**Download the node setup**](https://www.youtube.com/redirect?redir_token=xXDjnLE3V0dgt0TA3dAogzDwI4V8MTU1ODE2ODUzOEAxNTU4MDgyMTM4&q=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F19ScjM4mWkClVhYuTHFQVPc3RHpotW2Ln%2Fview%3Fusp%3Dsharing&v=TH5CZMdrASw&event=video_description) * [**Generate an Asset automatically**](http...
You can use a diffuse shader to give you a single node setup of a simple diffuse. You also can use a principled shader which is default in 2.8 to give you a diffuse appearance. You just have to turn all the values to zero except diffuse to give you a pure diffuse shader.
72,167,673
I'm creating a website using wordpress and I'm trying to add a MP3 music into it. But the music don't autoplay on mobile. And when I click on pause, the music stop, but if I scroll (on PC or mobile) the music start again and again and again. Here the html code : ``` <figure> <audio controls src="https://www....
2022/05/09
[ "https://Stackoverflow.com/questions/72167673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17026389/" ]
I think it's important to know the 3 following methods when working with lambdas. The three firsts do essentially the same thing: storing the lambda for future use. The other seems to be what you expect from your code: you directly call the lambda and get the result, so the return type is the type returned by the lambd...
Normally, a lambda expression is an anonymous function object and it doesn't have a named type. However, sometimes we can use type erasure. If a lambda expression doesn't capture any arguments like your example, it can convert to function pointer implicitly. If a lambda expression captures some arguments, it can conver...
72,167,673
I'm creating a website using wordpress and I'm trying to add a MP3 music into it. But the music don't autoplay on mobile. And when I click on pause, the music stop, but if I scroll (on PC or mobile) the music start again and again and again. Here the html code : ``` <figure> <audio controls src="https://www....
2022/05/09
[ "https://Stackoverflow.com/questions/72167673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17026389/" ]
I think it's important to know the 3 following methods when working with lambdas. The three firsts do essentially the same thing: storing the lambda for future use. The other seems to be what you expect from your code: you directly call the lambda and get the result, so the return type is the type returned by the lambd...
According to [cppreference](https://en.cppreference.com/w/cpp/language/lambda), (emphasize mine) > > The lambda expression is a prvalue expression of unique **unnamed** non-union non-aggregate class type, known as closure type > > > As the type of a lambda expression is an unnamed type you cannot use it in a decl...
72,167,673
I'm creating a website using wordpress and I'm trying to add a MP3 music into it. But the music don't autoplay on mobile. And when I click on pause, the music stop, but if I scroll (on PC or mobile) the music start again and again and again. Here the html code : ``` <figure> <audio controls src="https://www....
2022/05/09
[ "https://Stackoverflow.com/questions/72167673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17026389/" ]
I think it's important to know the 3 following methods when working with lambdas. The three firsts do essentially the same thing: storing the lambda for future use. The other seems to be what you expect from your code: you directly call the lambda and get the result, so the return type is the type returned by the lambd...
From C++ standard > > [C++11: 5.1.2/3]: **The type of the lambda-expression (which is also the > type of the closure object) is a unique, unnamed non-union class type > — called the closure type —** whose properties are described below. This > class type is not an aggregate (8.5.1). The closure type is declared > in ...
8,197,690
As I am new to all this Java EE ocean, there is so much I want to know, and as I read more and more info on the internet I get more confused than anything gets clear. Are my presumptions right: 1. Firstly we need `Entity` class (POJO) with `@Entity`, `@Table`, `@Column` and etc. annotations. 2. Secondly we make `Servi...
2011/11/19
[ "https://Stackoverflow.com/questions/8197690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/958899/" ]
There are several questions buried in here, so I will try and give you high level answers. **@Entity** This will define your objects, and more importantly (with other annotations you mention) it will allow Hibernate/JPA to successfully map and persist that data to the RDBMS of choice. The other information you need t...
You are on the right track. Here's a good [walkthrough](http://krams915.blogspot.com/2011/01/spring-mvc-3-hibernate-annotations.html) of Spring and Hibernate. You could annotate your Service with `@Service` instead of `@Autowired`, but both work. You'll need to add a section to your application-context.xml to tell Sp...
52,018,718
> > cannot find symbol class intent, cannot find...Activity2.class, cannot find...Activity-main > > > ``` public class MainActivity extends AppCompatActivity { Button button; @Override public void onCreate(Bundle savedInstanceState) { onCreate(savedInstanceState); setContentView(R.layout.activity...
2018/08/25
[ "https://Stackoverflow.com/questions/52018718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10194335/" ]
Finally found a way to mock the FTP client... we need to stub on the main class like this. To Triger Ready: sinon.stub(Client.prototype, 'connect').withArgs(connect).callsFake(function (options) { this.emit('ready'); }); To Trigger Error: sinon.stub(Client.prototype, 'connect').withArgs(connect).callsFake(function ...
You can use something like [proxyquire](https://www.npmjs.com/package/proxyquire) to mock the `ftp` module.
49,920,402
I have an `ArrayList` that contains some elements and I am using String Buffer to get in a string. But When I am print the String I am getting in unorganized line. I want to get in single or double line. ``` ArrayList<String> mCombinedList; // it contains some value I have already instantiate it StringBuilder...
2018/04/19
[ "https://Stackoverflow.com/questions/49920402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9233586/" ]
During the final phase of your String build using StringBuilder, when you have collected all the strings, just call this regex to remove all the white spaces that are more than 2 which will clean up all the additional white spaces that got introduced due to empty strings in your source arraylist ``` String string = bu...
You are adding lot of spaces by `builder.append(" ");`. Use of `ArrayList.toString()` will solve your problem. ``` package com.test; import java.util.ArrayList; public class ListToString { public static void main(String[] args) { ArrayList<String> mCombinedList = new ArrayList<>(); mCombinedList...
32,034,400
I want to create an abstraction layer between Entity Framework and the rest of my application. But I am having a few problems with Entity Framework. Basically (I don't show you all the interface layers that I've created too), I've split my application into several projects like this : 1. Domain * Contains my domain ...
2015/08/16
[ "https://Stackoverflow.com/questions/32034400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2183236/" ]
You have two options: 1. initialize new `dbcontext` for each operation and dispose it when operation is ended: ``` public abstract class GenericDao<TEntity, TDomain, TDbContext> : IGenericDao<TDomain> where TDbContext : DbContext, new() where TEntity : class where TDomain : class { protected Func<TDbContext> _con...
You seem to be getting stuck coding to an implementation within your abstraction. If you injected an interface to your generic rather than a concrete type (like EF) then your GenericDao becomes much more flexible. You can inject whatever implementation you choose providing it implements the required interface. In your ...
54,244,233
I am trying to change the format of the date in a pandas dataframe. If I check the date in the beginning, I have: ``` df['Date'][0] Out[158]: '01/02/2008' ``` Then, I use: ``` df['Date'] = pd.to_datetime(df['Date']).dt.date ``` To change the format to ``` df['Date'][0] Out[157]: datetime.date(2008, 1, 2) ``...
2019/01/17
[ "https://Stackoverflow.com/questions/54244233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7747528/" ]
You should first collapse by `Date` using the `groupby` method to reduce the dimensionality of the problem. Then you parse the dates into the new format and merge the results back into the original DataFrame. This requires some time because of the merging, but it takes advantage from the fact that many dates are repe...
I'm not sure if this will help with the performance issue, as I haven't tested with a dataset of your size, but at least in theory, this should help. Pandas has a built in parameter you can use to specify that it should load a column as a date or datetime field. See the [parse\_dates](https://pandas.pydata.org/pandas-d...
54,244,233
I am trying to change the format of the date in a pandas dataframe. If I check the date in the beginning, I have: ``` df['Date'][0] Out[158]: '01/02/2008' ``` Then, I use: ``` df['Date'] = pd.to_datetime(df['Date']).dt.date ``` To change the format to ``` df['Date'][0] Out[157]: datetime.date(2008, 1, 2) ``...
2019/01/17
[ "https://Stackoverflow.com/questions/54244233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7747528/" ]
You should first collapse by `Date` using the `groupby` method to reduce the dimensionality of the problem. Then you parse the dates into the new format and merge the results back into the original DataFrame. This requires some time because of the merging, but it takes advantage from the fact that many dates are repe...
Following a lead at @pygo's comment, I found that my mistake was to try to read the data as ``` df['Date'] = pd.to_datetime(df['Date']).dt.date ``` This would be, as [this answer](https://stackoverflow.com/questions/32034689/why-is-pandas-to-datetime-slow-for-non-standard-time-format-such-as-2014-12-31) explains: ...
50,251,043
I tried to get incremental changes to events in Office 365 Calendar service, and I follow this document to send the Graph CalendarView api. <https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_events> The server responded a lot of occurrences of a recurring events which is repeated everyday without ...
2018/05/09
[ "https://Stackoverflow.com/questions/50251043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9454310/" ]
Using mapped types and conditional types we can create a type that contains all the fields of a class and use it as a constructor argument. Also we can use `Object.assign` to copy the properties instead of assigning each field: ``` type NotMethods<T> = { [P in keyof T]: T[P] extends (...args: any[]) => any ? never: P ...
This might not work for all scenarios, but this compiles: ``` class MyClass { foo: number; bar: string; baz: boolean; constructor (props: MyClass) { this.foo = props.foo; this.bar = props.bar; this.baz = props.baz; } } const props = { foo: 1, bar: "s", baz: true }; const x = new My...
50,251,043
I tried to get incremental changes to events in Office 365 Calendar service, and I follow this document to send the Graph CalendarView api. <https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_events> The server responded a lot of occurrences of a recurring events which is repeated everyday without ...
2018/05/09
[ "https://Stackoverflow.com/questions/50251043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9454310/" ]
Using mapped types and conditional types we can create a type that contains all the fields of a class and use it as a constructor argument. Also we can use `Object.assign` to copy the properties instead of assigning each field: ``` type NotMethods<T> = { [P in keyof T]: T[P] extends (...args: any[]) => any ? never: P ...
You can also consider the builder pattern : ### 1. Create the builder type and createBuilder util function : ``` type Builder<T> = { [k in keyof T]: (arg: T[k]) => Builder<T> } & { build(): T } function createBuilder<T>(type: { new(...args: any[]) : T}): Builder<T> { var built: any = {}; var builder = new ...
61,049,120
I was going through the difference between inheritance and composition. Everyone has praised composition over inheritance, so questions is how do we make choice ? Also if we didn't use inheritance at all then what are we going to miss as per OOP principal ?
2020/04/05
[ "https://Stackoverflow.com/questions/61049120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7807754/" ]
It really comes down to how your data is structured. Inheritance is used for "is a" relationships while composition is used for "has a" relationships. For example, if you were look at cars. Inheritance: you would have 'Toyota', 'Honda', 'BMW' under 'Car' because they are types of cars. Composition: you would have...
You can google thousands articles about it. So if you want to understand more deeply, google and learn, we dont have to reinvent wheel here. If you want short explanation what `composition over inheritance` means, it basically says - do not overengineer your solution with some super complex inheritance. If you develop...
61,049,120
I was going through the difference between inheritance and composition. Everyone has praised composition over inheritance, so questions is how do we make choice ? Also if we didn't use inheritance at all then what are we going to miss as per OOP principal ?
2020/04/05
[ "https://Stackoverflow.com/questions/61049120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7807754/" ]
This is a big complicated topic, perhaps too much to be described in a few SO posts. Inheritance can be tricky, People have done Ph.D dissertations on this. Most of the time when I write new code I keep inheritance to a minimum. When your Dog class inherits Mammal all the state/behavior of Mammal must still apply. (th...
You can google thousands articles about it. So if you want to understand more deeply, google and learn, we dont have to reinvent wheel here. If you want short explanation what `composition over inheritance` means, it basically says - do not overengineer your solution with some super complex inheritance. If you develop...
61,049,120
I was going through the difference between inheritance and composition. Everyone has praised composition over inheritance, so questions is how do we make choice ? Also if we didn't use inheritance at all then what are we going to miss as per OOP principal ?
2020/04/05
[ "https://Stackoverflow.com/questions/61049120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7807754/" ]
You cannot say that one should be preferred over another. It depends how the data is structured and what representation is required for a particular data model. There is a simple way to remember what to use: Inheritance = **is** * The fact an object inherits from another means the object actually **is** what it inher...
You can google thousands articles about it. So if you want to understand more deeply, google and learn, we dont have to reinvent wheel here. If you want short explanation what `composition over inheritance` means, it basically says - do not overengineer your solution with some super complex inheritance. If you develop...
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
After following the above steps, it's worth popping over to <http://panopticlick.eff.org/> . This page will tell you how unique your browser fingerprint is. (i.e. how easily it can be proved to be the browser you're using) Yo give you an idea how scary this is, even in incognito mode, my browser fingerprint is totally...
How about Chrome's Incognito mode? Might not be quite paranoid enough for you though ;-)
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
Try [The Paranoid Kit](https://addons.mozilla.org/en-US/firefox/collection/paranoia) extension collection for Firefox. Also [Privoxy](http://privoxy.org) is a proxy server that strips any personal information from requests no matter what browser do you use. It is used in Tor by default, too.
It is possible to disable/mask the the user agent in pretty much any browser (if that's your main concern). Use a web proxy where applicable (e.g. Tor/Privoxy). Other than that, run your web browser inside a sandbox (e.g. **[Sandboxie](http://www.sandboxie.com/)**, preferably with a RAM disk as container) for ultimat...
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
You can try [JonDoFox](http://anonymous-proxy-servers.net/en/jondofox.html). JonDoFox is a profile for the Mozilla Firefox web browser particularly optimized for anonymous and secure web surfing. Combined with [JonDo](http://anonymous-proxy-servers.net/en/jondo.html) it is very powerful and secure.
How about Chrome's Incognito mode? Might not be quite paranoid enough for you though ;-)
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
The simple answer is that it depends what you are doing. The more reason you have to hide, the more reason other people have to find you. As a general rule, Tor and the Tor browser are probably the best for protecting your privacy, but don't assume that makes you immune from the law. If you're doing strongly objection...
How about Chrome's Incognito mode? Might not be quite paranoid enough for you though ;-)
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
It is possible to disable/mask the the user agent in pretty much any browser (if that's your main concern). Use a web proxy where applicable (e.g. Tor/Privoxy). Other than that, run your web browser inside a sandbox (e.g. **[Sandboxie](http://www.sandboxie.com/)**, preferably with a RAM disk as container) for ultimat...
How about Chrome's Incognito mode? Might not be quite paranoid enough for you though ;-)
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
After following the above steps, it's worth popping over to <http://panopticlick.eff.org/> . This page will tell you how unique your browser fingerprint is. (i.e. how easily it can be proved to be the browser you're using) Yo give you an idea how scary this is, even in incognito mode, my browser fingerprint is totally...
The simple answer is that it depends what you are doing. The more reason you have to hide, the more reason other people have to find you. As a general rule, Tor and the Tor browser are probably the best for protecting your privacy, but don't assume that makes you immune from the law. If you're doing strongly objection...
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
Try [The Paranoid Kit](https://addons.mozilla.org/en-US/firefox/collection/paranoia) extension collection for Firefox. Also [Privoxy](http://privoxy.org) is a proxy server that strips any personal information from requests no matter what browser do you use. It is used in Tor by default, too.
The simple answer is that it depends what you are doing. The more reason you have to hide, the more reason other people have to find you. As a general rule, Tor and the Tor browser are probably the best for protecting your privacy, but don't assume that makes you immune from the law. If you're doing strongly objection...
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
I know that was not exactly the question, but if you're *really* paranoid about that, go get a Live-CD like [Knoppix](http://www.knopper.net/knoppix/), [Kanotix](http://www.kanotix.com/), [DSL](http://www.damnsmalllinux.org/) or the [Ubuntu](http://www.ubuntu.com/getubuntu/download) one. This will not even leave traces...
You can try [JonDoFox](http://anonymous-proxy-servers.net/en/jondofox.html). JonDoFox is a profile for the Mozilla Firefox web browser particularly optimized for anonymous and secure web surfing. Combined with [JonDo](http://anonymous-proxy-servers.net/en/jondo.html) it is very powerful and secure.
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
After following the above steps, it's worth popping over to <http://panopticlick.eff.org/> . This page will tell you how unique your browser fingerprint is. (i.e. how easily it can be proved to be the browser you're using) Yo give you an idea how scary this is, even in incognito mode, my browser fingerprint is totally...
I know that was not exactly the question, but if you're *really* paranoid about that, go get a Live-CD like [Knoppix](http://www.knopper.net/knoppix/), [Kanotix](http://www.kanotix.com/), [DSL](http://www.damnsmalllinux.org/) or the [Ubuntu](http://www.ubuntu.com/getubuntu/download) one. This will not even leave traces...
102,400
Is there a web browser out there that is more suited for paranoid people? Why would you choose it/ What feature would your ideal paranoia browser have? For instance i would want one which Sends NO User-Agent information to the website.
2010/01/29
[ "https://superuser.com/questions/102400", "https://superuser.com", "https://superuser.com/users/17086/" ]
It is possible to disable/mask the the user agent in pretty much any browser (if that's your main concern). Use a web proxy where applicable (e.g. Tor/Privoxy). Other than that, run your web browser inside a sandbox (e.g. **[Sandboxie](http://www.sandboxie.com/)**, preferably with a RAM disk as container) for ultimat...
You can try [JonDoFox](http://anonymous-proxy-servers.net/en/jondofox.html). JonDoFox is a profile for the Mozilla Firefox web browser particularly optimized for anonymous and secure web surfing. Combined with [JonDo](http://anonymous-proxy-servers.net/en/jondo.html) it is very powerful and secure.
1,028,661
Approximate this number to the nearest whole number without a calculator: $2^{\sqrt{5}}$ I don't know how to do this problem. Can you help me? My answer key says $5$. Also, how do I approximate $2^\pi$ and $3^e$? The answers are $9$ and $20$, respectively.
2014/11/19
[ "https://math.stackexchange.com/questions/1028661", "https://math.stackexchange.com", "https://math.stackexchange.com/users/193746/" ]
First note that $$2.2 = 11/5 <\sqrt{5} < 9/4 = 2.25.$$ You can prove this by showing that $(11/5)^2$ is less than $5$, and that $(9/4)^2$ is more than $5$. Now we estimate $2^{2.25}$, by showing that it is less than $5$. To do this, we raise both sides of the inequality $2^{9/4} < 5$ to the power of $4$ to obtain a...
From an algebraic point of view, let us consider $$A=2^{\sqrt x}=e^{\sqrt x \log(2)}$$ and use the first term of the Taylor expansion built at $x=4$ (which is the closest perfect square). So $$A=4+(x-4) \log (2)+O\left((x-4)^2\right)$$ So, for $x=5$, $$2^{\sqrt 5}\approx 4+\log(2)=4.69315$$ the "correct " value being $...
1,028,661
Approximate this number to the nearest whole number without a calculator: $2^{\sqrt{5}}$ I don't know how to do this problem. Can you help me? My answer key says $5$. Also, how do I approximate $2^\pi$ and $3^e$? The answers are $9$ and $20$, respectively.
2014/11/19
[ "https://math.stackexchange.com/questions/1028661", "https://math.stackexchange.com", "https://math.stackexchange.com/users/193746/" ]
First note that $$2.2 = 11/5 <\sqrt{5} < 9/4 = 2.25.$$ You can prove this by showing that $(11/5)^2$ is less than $5$, and that $(9/4)^2$ is more than $5$. Now we estimate $2^{2.25}$, by showing that it is less than $5$. To do this, we raise both sides of the inequality $2^{9/4} < 5$ to the power of $4$ to obtain a...
i can get $4 < 2^{\sqrt 5} < 5.$ use the fact that $\sqrt x$ is concave down so the tangent approximation $\sqrt 5 = \sqrt {4 + 1)} < \sqrt 4 + {1 \over 2 \sqrt 4} = {5 \over 4}.$ so we have $2 < \sqrt 5 < {5 \over 4}$ and $2 = {512 \over 256} < {625 \over 256}$ gives us $2^{1/4} < {5 \over 4}.$ so far we have, $2 < \...
33,772,031
How can I generate a tree with an unknown number of nodes, each of which have an unknown and varying number of children, with the condition that a list of the child nodes for a given parent node is generated by some fun(parent)? Note that I'm using library(data.tree) from cran to make my tree hierarchy. The tree will ...
2015/11/18
[ "https://Stackoverflow.com/questions/33772031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5153347/" ]
The problem came from the use of `$*`, whether you quote or unquote it. The correct way to iterate through positional parameter is using `"$@"`, notice the double quote. ``` for file in "$@"; do : ... done ``` or even POSIXly: ``` for file do : ... done ``` You got the error message from `bash`, because `bash...
The '$\*' is a string not the parameter array. You can do it like this ``` fileArr=($*) for file in ${fileArr[@]} do you things ```
33,772,031
How can I generate a tree with an unknown number of nodes, each of which have an unknown and varying number of children, with the condition that a list of the child nodes for a given parent node is generated by some fun(parent)? Note that I'm using library(data.tree) from cran to make my tree hierarchy. The tree will ...
2015/11/18
[ "https://Stackoverflow.com/questions/33772031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5153347/" ]
The problem came from the use of `$*`, whether you quote or unquote it. The correct way to iterate through positional parameter is using `"$@"`, notice the double quote. ``` for file in "$@"; do : ... done ``` or even POSIXly: ``` for file do : ... done ``` You got the error message from `bash`, because `bash...
The quotes around "$\*" will prevent bash from parsing the passed parameter into individual tokens. The loop will be executed once with all of the parameters passed (i.e. if you ran `test.sh one two three` then the echo command will try to redirect to "one two three"). Just remove the quotes.
34,505,068
I get the format of this `{1}1{2}3{3}6` string in php and I want to make the numbers in curly braces to be the indexes of array and the value stored on the indexes will be the value after the curly braces. So that I can easily apply `foreach` to enter the values in database. Output Array should be like: ``` array([1]...
2015/12/29
[ "https://Stackoverflow.com/questions/34505068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217769/" ]
``` $result = []; $data = '{1}1{2}3{3}6'; preg_match_all('/\{(\d+)\}\s*(\d+)/', $data, $m); foreach ($m[1] as $i => $key) { $result[$key] = $m[2][$i]; } ```
You can try it with regex "Regular expression" as follows: ``` <?php $string="{1}1{2}3{3}6"; //Define the regex $regex = "/{([a-zA-Z0-9_]*)}\s*([a-zA-Z0-9_]*)/"; preg_match_all($regex, $string, $matches); //Temporary array to store the data $arry = array(); foreach($matches[1] as $key => $value){ $arry[$valu...
34,505,068
I get the format of this `{1}1{2}3{3}6` string in php and I want to make the numbers in curly braces to be the indexes of array and the value stored on the indexes will be the value after the curly braces. So that I can easily apply `foreach` to enter the values in database. Output Array should be like: ``` array([1]...
2015/12/29
[ "https://Stackoverflow.com/questions/34505068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217769/" ]
``` $result = []; $data = '{1}1{2}3{3}6'; preg_match_all('/\{(\d+)\}\s*(\d+)/', $data, $m); foreach ($m[1] as $i => $key) { $result[$key] = $m[2][$i]; } ```
Try: ``` $str = '{1}1{2}3{3}6'; $arr = explode("}", substr(str_replace("{", "}", $str), (strlen($str)-1)*-1)); $arr = array_map(function ($v){ global $arr; return $arr[$v+1]; }, array_flip(array_intersect_key($arr, array_flip(array_filter(array_keys($arr), function ($v){ return !($v & 1); }))))); ```
49,413,525
I need to paste all of my data on separate lines so that they arent all smashed together. This is my data: ``` data = {'sku: ***'+sku0+'*** Size: ***'+size0+'*** Stock: ***'+stock0+'***' 'sku: ***'+sku0+'*** Size: ***'+size1+'*** Stock: ***'+stock1+'***' 'sku: ***'+sku0+'*** Size: ***'+size2+'*** Stock: **...
2018/03/21
[ "https://Stackoverflow.com/questions/49413525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9329293/" ]
Try `window.Activate()` to focus the new window and/or `[any element].Focus()` to focus any element within window.
I'm guessing the above code is in the button click handler for the Login Window, which would make the Login Window the parent of the StudentInfoSystem window. Since WPF will close the parent and any child(ren) window(s) when closing the parent window, your StudentInfo window will also close when calling ``` this.C...
49,413,525
I need to paste all of my data on separate lines so that they arent all smashed together. This is my data: ``` data = {'sku: ***'+sku0+'*** Size: ***'+size0+'*** Stock: ***'+stock0+'***' 'sku: ***'+sku0+'*** Size: ***'+size1+'*** Stock: ***'+stock1+'***' 'sku: ***'+sku0+'*** Size: ***'+size2+'*** Stock: **...
2018/03/21
[ "https://Stackoverflow.com/questions/49413525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9329293/" ]
Try `window.Activate()` to focus the new window and/or `[any element].Focus()` to focus any element within window.
As I understand, this should do what you want: ``` info.ShowDialog(); ``` You could also check `ShutdownMode` property. I would rather say, login window is sth you want to close after login, but do what you want :). Usage of `ShutdownMode` property: ``` public partial class App : Application { protected overrid...
49,413,525
I need to paste all of my data on separate lines so that they arent all smashed together. This is my data: ``` data = {'sku: ***'+sku0+'*** Size: ***'+size0+'*** Stock: ***'+stock0+'***' 'sku: ***'+sku0+'*** Size: ***'+size1+'*** Stock: ***'+stock1+'***' 'sku: ***'+sku0+'*** Size: ***'+size2+'*** Stock: **...
2018/03/21
[ "https://Stackoverflow.com/questions/49413525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9329293/" ]
I'm guessing the above code is in the button click handler for the Login Window, which would make the Login Window the parent of the StudentInfoSystem window. Since WPF will close the parent and any child(ren) window(s) when closing the parent window, your StudentInfo window will also close when calling ``` this.C...
As I understand, this should do what you want: ``` info.ShowDialog(); ``` You could also check `ShutdownMode` property. I would rather say, login window is sth you want to close after login, but do what you want :). Usage of `ShutdownMode` property: ``` public partial class App : Application { protected overrid...
25,134,971
In my XAML, I have this property, which works like a charm : ``` DataContext="{Binding Chat, Source={StaticResource Locator}}" ``` It is binded correctly, showing design time data etc. However now I need to get data from textBox : ``` <TextBox Text="{Binding MessageInput, Mode=TwoWay}"/> ``` And I do not kn...
2014/08/05
[ "https://Stackoverflow.com/questions/25134971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2854908/" ]
The ugly way: ``` string res = (DataContext as [TypeOfYourViewModel]).MessageInput; ``` A little better way: ``` <TextBox Name="tbMessageInput" ...> ``` and ``` string res = tbMessageInput.Text ```
if you need to access the textproperty then you can create a reference to the viewmodel and obtain the text from there. You can replace the chatViewModel with your viewmodel in my code ``` private string GetText() { ChatViewModel vm = this.DataContext as ChatViewModel; if(vm != null) return vm.Message...
27,298,798
I have a string that contains an HTML code snippet and I want to get the value of the `id` attribute from the element `dt`. ``` var myHtml = "<dt id='119'>Email</dt><dd id='container'>my text</dd>"; ``` Expected result: ``` var myId = 119; ``` Does anyone have any ideas how I can do this?
2014/12/04
[ "https://Stackoverflow.com/questions/27298798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/782106/" ]
You can wrap the string in jQuery and simply use `attr` ``` var myId = $(myHtml) .first() // get the first element - <dt> .attr("id"); // get the id ``` Note that you could just use `attr` since jQuery only gets the first attribute if multiple elements are involved, but using `first` is more *sem...
You can test this in console: ``` $("<dt id='119'>Email</dt><dd id='container'>my text</dd>").eq(0).attr('id') ```
27,298,798
I have a string that contains an HTML code snippet and I want to get the value of the `id` attribute from the element `dt`. ``` var myHtml = "<dt id='119'>Email</dt><dd id='container'>my text</dd>"; ``` Expected result: ``` var myId = 119; ``` Does anyone have any ideas how I can do this?
2014/12/04
[ "https://Stackoverflow.com/questions/27298798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/782106/" ]
Simply can use `.attr()` ```js var myHtml = "<dt id='119'>Email</dt><dd id='container'>my text</dd>"; var myId = $(myHtml).first().attr('id'); alert(myId); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> ```
You can test this in console: ``` $("<dt id='119'>Email</dt><dd id='container'>my text</dd>").eq(0).attr('id') ```
27,298,798
I have a string that contains an HTML code snippet and I want to get the value of the `id` attribute from the element `dt`. ``` var myHtml = "<dt id='119'>Email</dt><dd id='container'>my text</dd>"; ``` Expected result: ``` var myId = 119; ``` Does anyone have any ideas how I can do this?
2014/12/04
[ "https://Stackoverflow.com/questions/27298798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/782106/" ]
If the order of elements may be changed you should find the specific `dt` then gets its `id` attribute. `attr()`, by itself, will only return the first matching id found so is not a robust solution: ``` $(myHtml).filter('dt').attr('id') ``` You have to use `filter()`, and not `find()` as they are all top level eleme...
You can test this in console: ``` $("<dt id='119'>Email</dt><dd id='container'>my text</dd>").eq(0).attr('id') ```
22,814,121
nHello, I am trying to use parameters in my router as follows : my url call in my html file: ``` <a href="#/itemlist/{{hikelist.id}}">Edit</a> ``` And my router : ``` packApp .config(['$routeProvider', '$httpProvider', '$translateProvider', '$stateParams', function ($routeProvider, $httpProvider, $tr...
2014/04/02
[ "https://Stackoverflow.com/questions/22814121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1260928/" ]
You have included or using both `ui-router` and angularjs standard $route service which are incompatible as both do the same thing. You would have to choose one of them. See documentation on [ui-router](https://github.com/angular-ui/ui-router) to understand how routes are setup if you go the `ui-router` way. Else lo...
If you use $stateParams in ItemlistController don't forget to inject it to that controller as well.
299,943
I have installed free price extension, <https://pluginarchive.com/magento/rp_display_price_free> the extension collapse my configurable product price. How to debug which part of the extension affects my Magento core function. Note: <https://snipboard.io/I2FrSH.jpg> Thanks in advance..!
2019/12/30
[ "https://magento.stackexchange.com/questions/299943", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/57334/" ]
Couple of points would like to add here that one can not easily render string (in this case its **FREE** - system config (`displayfreeprice/general/freeprice_text`) ) into the price format which may be float or decimal in most of the cases. Although, one workaround should resolve this issue showing **0.00** instead of...
I didn't work with Magento 1 for a long time. It's just my suggestion: We should have Debug tools. * PHP: Xdebug and PHPStorm are perfect choices. <https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html> * Javascript: Developer Tool <https://developers.google.com/web/tools/chrome-devtools/javascript> Price c...
299,943
I have installed free price extension, <https://pluginarchive.com/magento/rp_display_price_free> the extension collapse my configurable product price. How to debug which part of the extension affects my Magento core function. Note: <https://snipboard.io/I2FrSH.jpg> Thanks in advance..!
2019/12/30
[ "https://magento.stackexchange.com/questions/299943", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/57334/" ]
Couple of points would like to add here that one can not easily render string (in this case its **FREE** - system config (`displayfreeprice/general/freeprice_text`) ) into the price format which may be float or decimal in most of the cases. Although, one workaround should resolve this issue showing **0.00** instead of...
create file at root of magento with name **rewritelist.php** and run ``` <?php $foldersToCheck = array('app/code/local/', 'app/code/community/'); $configFiles = array(); foreach ($foldersToCheck as $folder){ $files = glob($folder.'*/*/etc/config.xml');//get all config.xml files in the specified folder $config...
36,239,445
I am using the Evernote Cloud SDK for PHP, which can be found [here](https://github.com/evernote/evernote-cloud-sdk-php). In my code, I am attempting to something akin to their sample OAuth (found [here](https://github.com/evernote/evernote-cloud-sdk-php/blob/master/sample/oauth/index.php)), I have placed the code int...
2016/03/26
[ "https://Stackoverflow.com/questions/36239445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189588/" ]
After the `header()` function is called, you should kill the request with `die;` or `exit;` and not output anything on the page. after your `->authorize()` call try adding that in. The other thing it could be is that headers have already been sent, so this isn't "actually" being sent to the browser. Usually what it is...
try laravel redirect function. redirect() you can pass in a full url
22,151,596
I'd like to build a classificator machine of items, creating rules and using weight. There could be no clear details to define an item, just the high score. An example. ``` If item A has x part then A.set(Category.A, 5) //weigth 5 If item A has y part then A.set(Category.B,3) //weigth 3 If item A has z part then A...
2014/03/03
[ "https://Stackoverflow.com/questions/22151596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3375622/" ]
As soon as you said `I want to make sure that the tasks are in the proper order, and the business rules are correct within the process itself.` you stopped talking about unit tests and began talking about integration tests. Even though you are decoupling from the datastore and services you are testing *busines rules*...
Setting aside tools etc... **Unit test** is simply testing a specific piece of code and would typically be performed by the programmer. Functional and Integration are typically performed by QA team: **Functional Testing** is testing if the code does what it was intended to do. **Integration Testing** is about testin...
22,151,596
I'd like to build a classificator machine of items, creating rules and using weight. There could be no clear details to define an item, just the high score. An example. ``` If item A has x part then A.set(Category.A, 5) //weigth 5 If item A has y part then A.set(Category.B,3) //weigth 3 If item A has z part then A...
2014/03/03
[ "https://Stackoverflow.com/questions/22151596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3375622/" ]
As soon as you said `I want to make sure that the tasks are in the proper order, and the business rules are correct within the process itself.` you stopped talking about unit tests and began talking about integration tests. Even though you are decoupling from the datastore and services you are testing *busines rules*...
I would say that a unit test is a test that tests one class only (a unit), whereas integration tests test the integration of multiple classes/assemblies and/or even external data sources. Functional tests should explicitly test the functionality exposed to the users (which may be internal users, outside of the dev team...
14,148,935
I know that this: ``` Process.Start("http://www.somewebsite.com/"); ``` launches a webpage in the users default browser. But, I am creating a useful little application, and now I need to be able to launch a URL in Chrome, Opera, Firefox, and Internet Explorer. My default browser is Chrome, but how can I launch the ...
2013/01/03
[ "https://Stackoverflow.com/questions/14148935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641463/" ]
You could always do something like this: ``` <?php $posted = false; if( isset($_POST['submit']) ) { /* Process $_POST */ /* Do your things */ /* Set a variable hinting if a post has been done */ $posted = true; } ?> <!DOCTYPE html> <html> <body> <?php if( $posted ...
Do it this way. ``` <?php $showform=true; //dispaying the form for the first time if(isset($_POST['submit'])){ //check for errors if($errors){ $msg="errors"; $showform=true; // if found errors, setting error msg and displaying the form }else{ //process the form ...
48,084
I was looking for a synonym of *spontaneous*, and *voluntary* naturally came to my mind. In an attempt to understand the difference between them, I tried to google *spontaneous vs voluntary*. To my surprise, nothing really interesting popped up from search results. Then I decided to look them up respectively. As expec...
2011/11/11
[ "https://english.stackexchange.com/questions/48084", "https://english.stackexchange.com", "https://english.stackexchange.com/users/13711/" ]
A *voluntary* action is one that the actor, employing free will, chooses to take. An *involuntary* action is one that takes place out of the control of the actor, or against the actor's will. *Spontaneous* has several related definitions. A spontaneous action can be one that the actor takes without a significant amo...
Even though voluntary is the opposite of involuntary, they do have something in common. Consider the following meanings: * Voluntary describes an action taken by an actor without being compelled to do so by someone else. * Involuntary describes an action performed without the actor's will. * Spontaneous is something t...
1,118,375
I want to set the border of a table to be "1px solid black" except on the bottom, where I want to use an image which provides a pointer into the link - as a visual aid. Is it possible to set an image as the bottom border when the other borders are regular css.
2009/07/13
[ "https://Stackoverflow.com/questions/1118375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69803/" ]
Try putting the table inside `<div class="myTableContainer"></div>` and then: ``` .myTableContainer{ padding-bottom: 1px; background: url(myBorderImage.png) bottom left; } ``` This should work well across all browsers.
Try putting a below your table then set his style like ``` .bottomborder { height:1px; background-image:url("yourImage.png"); } ``` Should work good. Edit : and of course border-top, left, right for your table a "solid 1px black"
1,118,375
I want to set the border of a table to be "1px solid black" except on the bottom, where I want to use an image which provides a pointer into the link - as a visual aid. Is it possible to set an image as the bottom border when the other borders are regular css.
2009/07/13
[ "https://Stackoverflow.com/questions/1118375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69803/" ]
I don't think so. You're probably better off adding a <DIV> below the table, give it a black border, a fixed background, and some fixed padding or whatnot (to give it some size).
No. Why don't you try another table row for that purpose?
1,118,375
I want to set the border of a table to be "1px solid black" except on the bottom, where I want to use an image which provides a pointer into the link - as a visual aid. Is it possible to set an image as the bottom border when the other borders are regular css.
2009/07/13
[ "https://Stackoverflow.com/questions/1118375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69803/" ]
CSS3 has added support for border-image. You can find more information at <http://www.w3.org/TR/css3-background/#border-images>. At this point (early 2012), it's probably not safe to use due to lack of support in all versions of IE. To track when it is safe to use you can visit <http://caniuse.com/#search=border-image>...
Try putting a below your table then set his style like ``` .bottomborder { height:1px; background-image:url("yourImage.png"); } ``` Should work good. Edit : and of course border-top, left, right for your table a "solid 1px black"
1,118,375
I want to set the border of a table to be "1px solid black" except on the bottom, where I want to use an image which provides a pointer into the link - as a visual aid. Is it possible to set an image as the bottom border when the other borders are regular css.
2009/07/13
[ "https://Stackoverflow.com/questions/1118375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69803/" ]
Try putting the table inside `<div class="myTableContainer"></div>` and then: ``` .myTableContainer{ padding-bottom: 1px; background: url(myBorderImage.png) bottom left; } ``` This should work well across all browsers.
You can set the borders like that except the bottom border : ``` border-top:1px solid black; border-right:1px solid black; border-left:1px solid black; ``` For the bottom border, you can set your image as background of a row maybe.
1,118,375
I want to set the border of a table to be "1px solid black" except on the bottom, where I want to use an image which provides a pointer into the link - as a visual aid. Is it possible to set an image as the bottom border when the other borders are regular css.
2009/07/13
[ "https://Stackoverflow.com/questions/1118375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69803/" ]
CSS3 has added support for border-image. You can find more information at <http://www.w3.org/TR/css3-background/#border-images>. At this point (early 2012), it's probably not safe to use due to lack of support in all versions of IE. To track when it is safe to use you can visit <http://caniuse.com/#search=border-image>...
No. Why don't you try another table row for that purpose?