INSTRUCTION
stringlengths
25
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
How to Pick target Texture When Rendering With F12 I want to render textures but when I press F12 to render, it always renders to the first image present in the image editor list. I’d like to pick the target texture I want to render to. UPDATE: I'm talking about `rendering` not `baking`. I’m going through all the different texture maps one by one (color, metalness, roughness ect.) and I need to be able to choose for each time I want to render with F12 to which texture it should render. How can I pick the target texture when pressing F12 to render?
You need to create an extra image / UV node. Blender treats selected image nodes as the image to be baked onto. **Note:** You will have to setup these nodes for every material you want included in the baking process. ![enter image description here](
stackexchange-blender
{ "answer_score": 2, "question_score": -2, "tags": "rendering" }
window.getSelection does not work with japanese (EUC-JP) websites I am getting a problem with greasemonkey script (jquery) where I cannot get text from japanese (EUC-JP) websites, instead getting weird symbols. Here is Script and website to test. I tried to search on google but no answers
The issue is not with `window.getSelection()`. The issue is with URL encoding. However, this can be fixed by running the string through `encodeURI`. So, in this code, you'd want to replace this line: var seltext = getSelectedText(); ... with this: var seltext = encodeURI(getSelectedText()); This will then make sure the values getting piped into the `attr()` are properly encoded before sent to Google.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -2, "tags": "javascript, jquery, greasemonkey" }
Comparing sample and population standard deviation I want to compute the standard deviation of some data points that I obtain during four series of experiments. For the first three experiments that I have conducted, the number of data points that I obtain is quite limited and I am able to compute the "classic" population standard deviation. For the fourth experiment however, I obtain a **very large** number of data points (more than 2^48) for which I can not compute the population standard deviation. I can nethertheless compute the sample standard deviation on say, the first 2^32 data points. I am then wondering, is it right to compare the population standard deviation of the first three experiments with the sample standard deviation of the fourth experiment ? Thanks
Wikipedia has a discussion of this. For a large sample, your sample standard deviation is very close to the population standard deviation. I would be more concerned about bias from taking the first samples. It would be better to take a random sample in case the first data is somehow different from the rest.
stackexchange-math
{ "answer_score": 2, "question_score": 2, "tags": "statistics, standard deviation" }
How to replace null with 0 in SSAS cube I need to replace **null** with **0** in my `SSAS cube`. what is the proper way to achieve that? This is my current query: SELECT {([Measures].[Employee Age Count])} ON COLUMNS, { ([Dim Gender].[Gender Name].[Gender Name].ALLMEMBERS * [Dim Age Ranges].[Age Range ID].[Age Range ID].ALLMEMBERS ) } ON ROWS FROM ( SELECT ( { [Dim Location].[Location].[Location Grp Name].&[BOSTON] }) ON COLUMNS FROM [People Dashboard]) WHERE ( [Dim Location].[Location].[Location Grp Name].&[BOSTON] ) Result from current query: ![enter image description here](
I think that `IIF(ISEMPTY...` is pretty standard. I have also simplified your script by deleting quite a few braces & also moving the logic out of the subselect into a basic `WHERE` clause: WITH MEMBER [Measures].[MEASURE_NONEMPTY] AS IIF( ISEMPTY([Measures].[Service Period Count]) ,0 ,[Measures].[Service Period Count] ) SELECT {[Measures].[MEASURE_NONEMPTY]} ON 0, [Dim Gender].[Gender Name].[Gender Name].ALLMEMBERS * [Dim Age Ranges].[Age Range ID].[Age Range ID].ALLMEMBERS ON 1 FROM [People Dashboard] WHERE [Dim Location].[Location].[Location Grp Name].&[BOSTON] ;
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 2, "tags": "ssas, mdx, olap cube" }
Is there a way to write with FTP using the Finder I'm aware of this question Built in FTP client (cmd + k) - can't upload files (Mavericks), but my question is specifically targetted to anyone who has used Ubuntu, and fully understands how seamless FTP can be. I'm looking to natively connect to an FTP server and be able to read and write. And open up folders in Atom or Sublime Text and just start editing files on the server. Here are the options that I am aware of and have already tried, but none of them are as elegant as Ubuntu where you can just open a remote folder and start editing. If anyone knows of something, please let me know? At the moment transit is the best option. \- Transit None of the others can edit whole folders in Sublime by importing the folder structure into the sidebar. \- FileZilla \- Cyber Duck \- Forklift
Finder only has read access to FTP so you need to use a client, but Transmit provides Finder integration so you can connect to FTP read/write using Finder with Transmit. You need to use the Finder integration. 1. Add the server to Transmit GUI as if you were connecting just using the GUI. 2. You can choose Mount as Disk to connect using Finder. ![]( 3. To connect more easily in the future, show Transmit Disk in menu bar, which allows you to connect to servers in that list without Transmit running just using Finder. ![]( With the server mounted, you can work with files and folders as you would any local disk. ![Open in Atom](
stackexchange-apple
{ "answer_score": 2, "question_score": 4, "tags": "finder, ftp" }
MySQL - Using 'AS var_name' in SELECT How can I use a variable such as 'AS uniqueName' in the select in the same select later on? I am trying to put some simple logic inside the select so I dont have to iterate through the result set just to do something easy: SELECT CASE emp_crns.ansi_class when -1 then 'N' when 150 then 0 when 300 then 1 when 600 then 2 when 900 then 3 when 1500 then 4 when 2500 then 6 when 3500 then 8 else 'X' end AS crnAnsiClassCode, CONCAT('REV. ', crnAnsiClassCode, ' ', emp_models.name) AS modelName FROM emp_models JOIN emp_revisions ON emp_revisions.id=emp_models.revision_id JOIN emp_crns ON emp_crns.id=emp_revisions.crn_id
You can use a sub-query to access the alias that you provided: SELECT empcrns.crnAnsiClassCode, CONCAT('REV. ', empcrns.crnAnsiClassCode, ' ', emp_models.name) AS modelName FROM emp_models JOIN emp_revisions ON emp_revisions.id=emp_models.revision_id JOIN ( SELECT id, CASE ansi_class when -1 then 'N' when 150 then 0 when 300 then 1 when 600 then 2 when 900 then 3 when 1500 then 4 when 2500 then 6 when 3500 then 8 else 'X' end AS crnAnsiClassCode FROM emp_crns ) empcrns ON empcrns.id=emp_revisions.crn_id
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "mysql, sql" }
Get comments that contain specific words Gerrit I want to ask about Gerrit, I'm looking into the review comments on the Nova project, I want to know if I can get all the comments that contain specific words, like 'TEXT'. I tried comments:'TEXT' but it doesn't work, it even gets a code change that contains no comments at all
Are you using single or double quotation marks? It worked pretty well for me in Gerrit 3.4.1, using double quotation marks, as the following example: comment:"shame on me"
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "comments, gerrit, review" }
Where are the bearings in thru axle hubs? So I’ve looked all over the internet to find an anatomy picture of a thru axle hub, because I don’t understand where the bearings go, and I can’t find anything helpful. Can anyone help me understand where the bearings are in a thru axle hub? Maybe show a picture. I just want to know.
You can look at diagrams of any hub. Through-axle bearings are basically in the same places as on quick release hubs. On a through axle hub the bearings, and the hollow axle, are simply of greater diameter than on a quick release hub. Googling 'through axle hub bearing' provided a number of diagrams for me. Googling 'through axle hub bearing replacement' for videos also got some interesting results. Try this one from Park Tool where they disassemble a TA hub with loose rather than cartridge bearings.
stackexchange-bicycles
{ "answer_score": 1, "question_score": 3, "tags": "mountain bike, hub, mechanical, bearings, through axle" }
How to write print statements to csv file in python? I have a dataset about some animal statistics. Where cat_teeth, dog_teeth, horse_teeth, and the numfeet variables are all integers. print(“Cat”,sum(cat_teeth), cat_numfeet) print(“Dog”,sum(dog_teeth), dog_numfeet) print(“Horse”,sum(horse_teeth), horse_numfeet) The code above gives me Cat 38 4 Dog 21 4 Horse 28 4 I want that same output exported to a csv file where there are 3 columns as shown above deliminated by a comma (,). How would I do that? import csv with open(“results.csv”, “w”) as csvfile: writer= csv.writer(csvfile) writer.writerow(“Cat”,sum(cat_teeth), cat_numfeet)) writer.writerow(“Dog”,sum(dog_teeth), dog_numfeet) writer.writerow(“Horse”,sum(horse_teeth), horse_numfeet) Does not work.
`writerow` takes exactly one argument. Convert the values to a list and then call the function. writer.writerow(["Cat",sum(cat_teeth), cat_numfeet])
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "python, numpy" }
border-spacing without outer spacing My bad, i have a div and a div-table: <div style="padding: 20px; border: 1px solid red;"> <div style="width: 100%; display: table; border-spacing: 20px;"> <div style="display: table-cell; width: 33%; border: 1px solid blue;">a</div> <div style="display: table-cell; width: 33%;">a</div> <div style="display: table-cell; width: 33%;">a</div> </div> </div> The distance be blue square and the red square is `40px` instead of `20px`. I can not set the table's border to zero-width because border is a outer-distance and spacing is (like padding) a inner-distance. I Can not drop the `border-spacing` because by principle its the correct decision to use it. Any idea how to get the distance to `20px` without changing the outer `div`'s padding?
Add a negative margin of 20px, so change your HTML to: ## Demo Fiddle <div style="padding: 20px; border: 1px solid red;"> <div style="width: 100%; margin:-20px;display: table; border-spacing: 20px;"> <div style="display: table-cell; width: 33%; border: 1px solid blue;">a</div> <div style="display: table-cell; width: 33%;">a</div> <div style="display: table-cell; width: 33%;">a</div> </div> </div> That said, I would also recommend you move your styles out of being inline, and also question what you are really trying to accomplish- as by doing this, you are implementing a style to override one already in place- suggesting you should simply remove the existing style (though I appreciate you have already noted you cant).
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "html, css" }
How can I call virtual function definition of base class that have definitions in both abstract base class and derived class in C++? We can't create an object of an abstract class, right? So how can I call a virtual function which has definition in both abstract base class and derived class? I want to execute the code in abstract base class but currently, I am using derived class's object. class T { public: virtual int f1()=0; virtual int f2() { a = 5; return a } } class DT : public T { public: int f1() { return 10; } int f2() { return 4; } } int main() { T *t; t = new DT(); ............ } Is there any way I can call the base class function using the object t? If it is not possible, what should I need to do to call the base class function?
Just like you would call any other base class implementation: use explicit qualification to bypass the dynamic dispatch mechanism. struct AbstractBase { virtual void abstract() = 0; virtual bool concrete() { return false; } }; struct Derived : AbstractBase { void abstract() override {} bool concrete() override { return true; } }; int main() { // Use through object: Derived d; bool b = d.AbstractBase::concrete(); assert(!b); // Use through pointer: AbstractBase *a = new Derived(); b = a->AbstractBase::concrete(); assert(!b); }
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "c++, polymorphism, abstract class, virtual functions" }
How can I "hide" certain accounts from Global Search? We have a number of accounts that are no longer interesting/relevant, but that we must keep in our org for a number of reasons. Is there some kind of trick that we can use so that these records no longer show up in Global Search results? The distinguishing attribute is: a number of values for a custom multi-picklist field. For instance, all values of that field are {A, B, C, D, E}, but we no longer want accounts that have values of B or D to show up in Global Search results.
You cannot restrict global search filters on account object, You might want to upvote for this feature.
stackexchange-salesforce
{ "answer_score": 2, "question_score": 1, "tags": "account, global search" }
How to Put Icones in RadStudio XE8 IDE palette for new component? I wrote a set of few components named : \- TUser \- TRESTAccess \- TServerAccess Then i create 3 PNG image 100x100 with same name than component (in the same directory than the BPL and the .PAS files) I wrote a .RC file include in my package. But can't compile : invalid format ? does someone have any ideas how can i make the icones appear in the component palette ?
No need to compile BRCC32 * I used image 128x128 BMP format. * I click on Project / Ressource and Image * I added the image and rename identifier as the name of my component * Then uninstall package (then closed Rad Studio XE8, if not i get and access violation) * Then install my package again. IT WORKS ! (except transparency : in the palette no transparency applied, but if i drop the component in my form, the transparency is applied !) !enter image description here
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -1, "tags": "delphi, components, palette, delphi xe8" }
Star dashboard for Oauth users I have asked this question on Grafana slack, community and on Reddit. Now time to try my luck here :) We have integrated Grafana access via OAuth sign in. Users would be authorized by an external OAuth entity. What I want to do is to have a custom home page for these users. All of them should be able to see the available dashboards in the home page itself. What I have found already is that, for the dashboards to appear on the home page, one needs to use the API to star it. I was able to do that using the REST API (/api/user/stars/dashboard/id) and using the admin credentials for basic auth, but that is valid only for that user i.e only the admin in this case can see the dashboards, not the OAuth users. How can I make this (starring dashboards) global for all OAuth users ? The users are not known beforehand. Thanks in advance.
API approach will be complicated. Rather create own home dashboard and then set it as home dashboard on the organization level. Own home dashboard can be fancy: logo in the Text panel, dashboard structure/classification created with Dashboard list panels (such as play.grafana.org), header, footer, ...
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "grafana, grafana api" }
What is the usual delay for a SEPA transaction? I wired some money from France to someone having an account in Germany, using a SEPA (Single Euro Payments Area) My bank acknowledged the transfer, and the person is telling me his didn't. He is telling me that these transactions usually take 2-3 days (he is also saying that there are holidays in Germany at the moment, which is true, and the transfer won't get acknowledged during that time) Have you experienced such delay in SEPA transaction with similar conditions? Should I worry about being scammed?
Right now the SEPA Credit Transfers take 3 days excluding holidays. In future this would be reduced to 2 days and then eventually to same day. Your bank would have acknowledged sending out the transaction. It would go into the clearing house and then to the recipient's bank. Once the receiver's bank receives the funds, they would notify the receiver.
stackexchange-money
{ "answer_score": 3, "question_score": 7, "tags": "money transfer, online banking, european union, sepa" }
Combine multiple fields in Data Studio into a single Field from same source Is it possible to combine fields in Data Studio into a single data field? Example: Data Source - "ExampleSheet" Available Fields - "Date", "Pet", "Food", "Movies" Formula I need would take "Pet" and "Food" and turn them into "All the things" But still be able to have the data align to add "Date" next to the new field. So, the resulting table would look like this: Date || Pet Date || Food Date || Pet Date || Food Date || Pet Date || Pet I know it's a long shot, but I want the data to be able to filter without breaking the source into another data source and concat the data into columns breaks the ability to align the data I tried blended data, but it doesn't like the values being from the same source You don't have to work it all out for me, just help point me in the right area if it is possible. Thanks for reading :)
You can create the new fields by using CONCAT. Example: `Pet Date` would be `CONTACT(Pet, " ", Date)`. View About calculated fields to learn more about Calculated Fields in Data Studio.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "google data studio" }
How can I create a regular expression that accepts at least one lowercase and one digit? This expression must adhere to specific rules: 1.- Between 2 and 8 characters total. 2.- Start with uppercase. 3.- Contain both lowercase and digits. The first and second should be easy, but I can't get the third one to work. This is the expression I came up with ([A-Z]+[A-Za-z0-9]*){2,8} But it returns incorrect responses. Regular expressions are far from my forte, and this is the first time I had to use them outside of class. This is my code, if it helps var expresion = /([A-Z]+[A-Za-z0-9]*){2,8}/; var re = new RegExp(expresion); var t = $('#code').val(); if (re.test(t)) { console.log(t+' works'); } else { console.log(t+' not working'); }
This should fit your literal requirements (however, as comments state, they don't really make sense): ^(?=.{2,8}$)(?=.*[0-9])(?=.*[a-z])[A-Z][a-zA-Z0-9]*$ First, you need to anchor your match with `^` (start of string) and `$`; otherwise you can just be picking up a matching substring, which will mess up your requirements. Second, we use lookahead to validate several individual points: the string contains between 2 and 8 characters before it ends, the string contains a digit. Third, we use the character classes to validate that it starts with an uppercase, and continues with a mix of uppercase, lowercase and digits. EDIT: Forgot the lowercase requirement, thanks nnnnnn. And you are right, your version is better.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "javascript, regex" }
get template checkbox names How to get the checkbox names when that form is loaded by html template. in Java Script?
var inputs = document.getElementsByTagName('input'); var names = []; for(var i = 0; i < inputs.length; i++){ if(inputs[i].type == 'checkbox') names.push(inputs[i].name); } Will give you all their names in an array if you're not using jQuery. You can dump that push() call and do whatever you need to there if you just want to operate on checkboxes. Just remember, if you have a ton of inputs on your page this will be a slow operation.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "javascript, html, templates, cgi" }
non clickable cell, wen animation is on I use simple animation in my project let rotationTransform = CATransform3DTranslate(CATransform3DIdentity, 0, 50, -40) cell.layer.transform = rotationTransform cell.alpha = 0.5 UIView.animate(withDuration: 0.75) { cell.layer.transform = CATransform3DIdentity cell.alpha = 1.0 } The problem is that when I quickly scroll down the page (my UiCollectionView has many cells) and try to stop scrolling somewhere in the middle, it does not work for me because the animation of the appearance of the cells still lasts. it turns out that while the animation does not end - they are not clickable Is there any trick or feature so that the cells, when playing their animation, are clickable?
You can add `allowUserInteraction` to options UIView.animate(withDuration: 0.75,delay:0.0,options:[.allowUserInteraction], animations: { cell.layer.transform = CATransform3DIdentity cell.alpha = 1.0 }) { (ok) in print("Ended \(ok)") }
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "swift, animation, uicollectionviewcell, catransform3d" }
Boost.Python converting python tuple to `std::tuple` or to `std::pair` I'm trying to wrap class `Cube` with Boost.Python which has signature of the following form: void insert( const std::pair< int, int>& x){ ... do something .. } if I just wrap this method up as follows: .def("append", &Cube::insert, with_custodian_and_ward<1,2>()) I get the following error in python: ArgumentError: Python argument types in cube.append(cube, list) did not match C++ signature: append(Cube {lvalue}, std::__1::pair<unsigned long, unsigned long>) when I type: cube.append((1,2)) I'm not sure how to conver the python type to the c++ type correctly. I can't seem to find a suitable example either.
I think the easiest way would be to explicitly convert your python object into a c++ std::pair: .def("append", FunctionPointer([] (Cube& self, const bp::object& obj) { self.insert(std::make_pair(bp::extract<int>(obj[0]),bp::extract<int>(obj[1]))); }))
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "boost python" }
About the relationship in two entities I'm thinking to create a property which store the key or the ID of the other entity as a reference to the entity. I want to know two things. 1\. Which data should the property store, the key or the ID? 2\. What should the type of the property be? maybe StringProperty?
The Datastore has a special property type for this: `ReferenceProperty`. There are two ways to use it. One: someothermodel = db.ReferenceProperty() Two: someotherspecificmodel = db.ReferenceProperty(SomeModel) In example 2, only models with the type of SomeModel can be assigned, in example one, any model can be assigned. The value type of `ReferenceProperty` is `db.Key`.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "google app engine, google cloud datastore, bigtable" }
Get every month of the current year in SQL Server I'm using the following code to get the date of every day in the current week, in SQL Server: SELECT DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) Monday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 1 Tuesday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 2 Wednsday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 3 Thursday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 4 Friday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 5 Saturday, DATEADD(wk, DATEDIFF(wk, 0, GETDATE()), 0) + 6 Sunday; I'm using this query to fill a bar chart in a asp.net application. I need the same thing but with the months of the current year. Can you help me with this, please? Edit: More like a query to retrieve data from every month of this year.
This will return the first and last day of every month for the current year. select FirstDay = dateadd(month, thisMonth - 1, dateadd(year, datediff(year, 0, getdate()), 0)) , LastDay = dateadd(day, -1, dateadd(month, thisMonth, dateadd(year, datediff(year, 0, getdate()), 0))) from ( values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12) ) x(thisMonth)
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "sql, sql server" }
Violating polymorphism by having base ViewModel class determine current type? I have a base ViewModel that has a public method. Things were pretty simple at first and its role was the same for all of its derived classes, but now we want the ViewModel to do different things depending on which derived class calls it. So for example we have: public void DoMethod() { DoThisMethod(); } we want something like public void DoMethod() { if (this.GetType().Name == "ThisName") DoThisMethod(); else DoAnotherMethod(); } Is it wrong to do this?
Yes, the solution that you propose is wrong for a design point of view. Your base class should be agnostic of the inherited type "ThisName". Using your naming you could resolve your problem by implementing it in this way: public class ViewModel { public virtual void DoMethod() { DoAnotherMethod(); } public void DoAnotherMethod() {...} } public class ThisName: ViewModel { public override void DoMethod() { DoThisMethod(); } public void DoThisMethod() {...} }
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "c#, wpf, polymorphism" }
In $\triangle ABC$, $|PA| \le |PB| + |PC|$ **Problem:** In $\triangle ABC$, $|BC|$ is longest side. $P$ is a point in the plane of $\triangle ABC$. Prove that $$ |PB|+|PC| \ge |PA|$$ and determine equality conditions. **Notes:** I aimed to present this problem, the solution of which I know, to the benefit of the users, as it has an aesthetic aspect. I also shared the question to learn about different possible solutions myself. It is not made in a spirit like challenging to users. It is a post to contribute to accumulation that may benefit the community. (For these reasons, I would appreciate if the problem is unblocked.)
According to Ptolemy's inequality, $$ PA \cdot BC \le PB \cdot AC + PC \cdot AB. $$ Taking into account $BC \ge AC$ and $BC \ge AB$, we get the desired inequality. Equality holds if and only if $A,B,C,P$ are cocyclic (that's the equality condition for Ptolemy's inequality) and $BC = AC$, $BC = AB$. In other words, if the triangle $ABC$ is equilateral and $P$ lies on its circumcircle.
stackexchange-math
{ "answer_score": 3, "question_score": -1, "tags": "euclidean geometry, triangles, geometric inequalities" }
MATLAB := Syntax? I am having trouble trying to debug some code (new to MATLAB). I have come across the following line of code: CC[theta_] := {{Cos[theta],I Sin[theta]},{I Sin[theta], Cos[theta]}} I get an error stating: > Parse error at ":": Usage may be invalid MATLAB syntax. When I remove the `:`, I get the exact same message, just that in this case it says 'Parse error at "="'. Is there any way to fix this? This is fairly old MATLAB code so I'm not sure if the syntax style has changed.
The provided code origins clearly from Mathematica. To do the same in Matlab, we can define a function handle: CC = @(theta) [cos(theta), 1i*sin(theta); 1i*sin(theta), cos(theta)] `1i` is the imaginary unit in Matlab (`I` in Mathematica). Matlab uses `[a,b;c,d]` to define a `2x2`-matrix (`{{a,b},{c,d}}` in Mathematica). The definition `:=` is not possible in Matlab. A function handle (as in the example) or a symbolic function can be used. Evaluated at `theta=pi/4` with the command `CC(pi/4)` gives this result: 0.7071 + 0.0000i 0.0000 + 0.7071i 0.0000 + 0.7071i 0.7071 + 0.0000i
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 0, "tags": "matlab, syntax, wolfram mathematica" }
How to change Widget style in SWT, of existing widget How to change `Widget` style in `SWT`, of existing widget, Means i am working on `ProgressBar` and i want to change it's style `SWT.VERTICAL` from `SWT.HORIZONTAL`
You can't, styles are fixed once the control has been created. In some cases SWT may use a completely different native control to implement the SWT control depending on the style flags. For example on macOS a `Combo` with the `SWT.READ_ONLY` style uses a different macOS control to a read/write `Combo`. This would make allowing you to change the style very complex.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "swt" }
Windows 7 on a virtual machine I know this question isn't "directly" programming related, but since I want to be able to be well-prepared on windows-programming when Windows 7 is released, I want to try it out now. But since I don't have two computers, I can't risk to install it as dual-boot in case it screws something up, my experience with dual-booting XP and Vista isn't the best, so dual-boot in a pre-beta-world is even more scary ;) Anyway, my question is this: **Does there exist any Virtualization-programs that handles Windows 7 now?** And if there is several, which one is best? I don't really need any detailed descriptions on how to install it and such, that I have google for ;) And the install-DVD is in my hands as we speak, so that isn't a problem either.
I'd imagine Microsoft VirtualPC would be your best bet.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 4, "tags": "windows, windows 7, virtualization" }
How to read the gas meter? We have a gas meter similar to the one pictured below. I've not seen one of these before and can't find anything on reading them. The reason I'm asking is because it must not be as simple as just subtracting today's value from yesterday's.. Today's value is **less** than yesterday, by almost 100. !Gas meter
Yes, it should be that simple. My first guess would be that you have a typo or a misreading, and that yesterday it showed 4814. If true, from the meter shown that would be a change of around 300 cubic feet, or about 3 therms. You can check your gas bill to see how many therms per month you are averaging. During my peak heating days, I can use that much, so it's not unreasonable. For the meter to record 10000 cubic feet change in a day (or to run backward) is unreasonable. If you can confirm such a change is really indicated on the dial, you should contact the utility. The dials for the one shown will indicate usage less than 100 cubic feet. If you're just recording long-term usage, you can ignore them. Under light usage, you might need them to see a daily difference.
stackexchange-diy
{ "answer_score": 3, "question_score": 0, "tags": "natural gas, meter" }
Who are the Far Cry 3 voice actors? A number of reviews so far have praised the voice work in Far Cry 3. Who are these deserving actors and what other stuff have the leads performed in? I guess we are talking about Jason Brody and Vaas.
IMDB.com has a list of the voice actors for the game. The main characters you mentioned are voiced by Gianpaolo Venuta(Jason Brody) and Michael Mando(Vaas).
stackexchange-gaming
{ "answer_score": 4, "question_score": 0, "tags": "far cry 3" }
Rails route for .xml file: Template is Missing error I'm trying to upload an .xml sitemap to my Rails app called `sitemap.xml`. When I define a route as such: get "sitemap", to: 'xml#sitemap' I get the following error: Template is missing Missing template xml/sitemap, application/sitemap with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "/home/user/.rvm/gems/ruby-2.0.0-p643@railstutorial_rails_4_0/gems/web-console-2.0.0/lib/action_dispatch/templates" * "/home/user/website/app/views" How can I define a proper Rails route for an .xml file?
If you want to load static `sitemap.xml` you can put the `sitemap.xml` in your public folder, then load the sitemap directly `<domain.com>/sitemap.xml` without any routing. However use a sitemap generator like sitemap_generator is recommended as content changes over time.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "ruby on rails, xml, routes, sitemap" }
In ST:TOS "Assignment: Earth", was the NASA stock footage fixed in the remastering? My memories of watching the Star Trek episode "Assignment: Earth" when it was in reruns in the 1970s include the incredibly cute Teri Garr and also a laughable use of NASA stock footage for the nuclear missile test. My memory is that the stock footage used showed several different types of rocket, from the Saturn shown on the pad, to an Atlas in flight, and maybe something else. I just rewatched this episode for the purpose of making screencaps of the different vehicles, and found that there were no different vehicles in the remastered version (OK, they used 3 different Saturns, but this is pretty minor compared to what I remember). Is it documented anywhere that this change was made in the remastering process? My google searches on this topic turned up some references to discussions of this, but not the discussion themselves, and I could not find a list of remastering changes for this episode.
Comparing the original (non-remastered) and the remastered version - the rocket is consistently a Saturn V that is used. In fact, at least one of the vehicles shown is Apollo 4: Not sure of cost, but NASA did have to grant permission to use the original footage > On December 3, Roddenberry received word from NASA that footage of rocket launchings and general Cape Kennedy stock footage would be provided to Star Trek...This footage is more historic than most watching could know, as it documents the preparation and launching of the first Saturn V multi-stage rocket. The unmanned capsule at the top is in fact, Apollo 4. The storage buildings at the rocket base were actually studio buildings on the paramount lot with NASA footage of Apollo rockets matted in above them. There was also new footage shot at the Cape specifically for this episode. * per "These Are the Voyages, Season Two"
stackexchange-scifi
{ "answer_score": 7, "question_score": 5, "tags": "star trek, star trek tos" }
Importing a HTML table into a google doc using google app script I'm importing data from JIRA into a Google Doc. One of the fields would be the description, which is basically HTML text. Is there any way to "add" this HTML text on a Google Doc? Or do I really have to parse it manually and create paragraphs, tables, etc.? The HTML could look as follows: <p>Hello There</p> <table class='confluenceTable'> <tbody> <tr> <th class='confluenceTh'> Name </th> <th class='confluenceTh'> Hours </th> <th class='confluenceTh'> Cost </th> </tr> <tr> <td class='confluenceTd'> Some Person</td> <td class='confluenceTd'> 1 </td> <td class='confluenceTd'> CHF 1</td> </tr> </tbody> </table>
I was able to create a **new** Doc with styled html content from the change mentioned in my comment in this post: var blob = Utilities.newBlob(content, {mimeType:"text/html"}); var newfile = Drive.Files.insert(resource, blob, {"convert":"true"});
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "google apps script, google docs, google docs api" }
Move, scale and draw on the same UIImageView I want to draw on an UIImageView, i use touchesMoved and touchesBegan for this, it works. I use the pinch recognizer for zooming, it works also. But how can i move it ? because if i use the pan recognizer it will be in conflict with touchesMoved. How can i do so the pan recognizer will only be called when the user use 3 fingers ? I think someone else has already face the issue. Thanks
Use touchesMoved with two touches and the users can slide the image with two fingers but just 1 finger will draw... besides it's never a good idea to use 3 fingers anywhere because anyone who has triple-tap-to-zoom enabled in their devices accessibility will not be able to use the 3-finger functions. (I and a lot of my friends have this enabled) First verify that both touches are on the UIImageView Then take the x&y values from both touches and average them to get the midpoint in-between your fingers. use this value for panning. Find the change between the current averaged midpoint and the previous averaged midpoint and apply this change to the images center. `image.center = CGPointMake(image.center.x+changeInX, image.center.y+changeInY);`
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "ios, uiimageview, uiimage, uigesturerecognizer" }
Flipping a molecule vs. mirror behind compound Why aren't these enantiomers? If you place a mirror behind the compound and look into the mirror, you get the second drawing. !enter image description here
> If you place a mirror behind the compound and look into the mirror, you get the second drawing "If you place a mirror behind compound 1 and look into the mirror" - If by that you mean, generate the mirror image of compound 1, well OK, but that does not produce compound 2. It generates the molecule labeled "mirror image" in the following diagram, and it is a non-superimposable mirror image. !enter image description here
stackexchange-chemistry
{ "answer_score": 3, "question_score": 2, "tags": "stereochemistry" }
Ember.js Handlebars.helpers.collection not working I'm new to ember and I'm trying to play with the code a bit so I downloaded the starters kit from the website as a starting template. I'm trying to use the ember handlebars helper for CollectionView, I copy paste the sample code but all I see is "Hi" 3 times without the name: < what am I doing something wrong? <script type="text/x-handlebars"> {{#collection contentBinding="App.items"}} Hi {{content.name}} {{/collection}} </script> <script> App = Ember.Application.create(); App.items = [ Ember.Object.create({name: 'Dave'}), Ember.Object.create({name: 'Mary'}), Ember.Object.create({name: 'Sara'}) ] </script> Thanks!
It's a problem about the way context is managed in the latest version of ember that is explained at: content.name returns empty for collection In summary, you need to do this in your template instead: <script type="text/x-handlebars"> {{#collection contentBinding="App.items" }} Hi {{view.content.name}} {{/collection}} </script>​ Fiddle showing it: < For the same purpose you could just use each: <script type="text/x-handlebars"> {{#each App.items }} Hi {{name}} {{/each}} </script>​ Fiddle showing it: <
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 3, "tags": "javascript, model view controller, ember.js" }
Isn't this a pointer functionality in javascript? In one of my projects, I had to copy values of one array to another. When i tried doing it this way : var Arr1 = new Array(1,2,3,4,5,6,7,8,9,10); var Arr2 = Arr1; // will this create a pointer ?? Is it creating a pointer ? Fiddle : I mean after the loop,if i try to access Arr1, it returns empty. for(var i=0;i<Counter;i++) { $('#testDiv').append(Arr2.pop() + " "); } alert("The element in other array : " + Arr1); Is there anything like pointer in javascript ?
You can try using `Arr1.slice(0)`: <
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "javascript, jquery, variables, pointers" }
Multiple \thanks that refer to same text I'd like to have three authors that use the same footnote for their \thanks identifier (they are at the same university, and don't need separate affiliation notes). I've read one of the solutions proposed in How to write a footnnote attached to the author in a LaTeX paper?, but the last solution (using recalled footnotes) only works for **two** authors. So an example: I'd like to have > Author1* and Author2* and Author3* > > * * * > > * University of Podunk, Timbuktoo. >
How about the following? \newcommand*\samethanks[1][\value{footnote}]{\footnotemark[#1]} \author{Foo\thanks{University of Podunk, Timbuktoo} \and Bar\samethanks \and Baz\thanks{Somewhere Else} \and Bof\samethanks[1] \and Hmm\samethanks} The `\samethanks` either duplicate the previous value or if you give it the optional argument, it uses that value. So Foo, Bar, and Bof have the same affiliation. Baz and Hmm have the same affiliation, different from Foo, Bar, and Bof's.
stackexchange-tex
{ "answer_score": 33, "question_score": 41, "tags": "footnotes, affiliation" }
Cast JSON object (NSCFDictionary) to string and parse it I'm working with facebook connect and trying to handle the JSON object that i'm receiving. I invoked the requstWithGraphPath method and need to get back a JSON object, tried to parse it and getting an error: SBJSON *parser = [[SBJSON new] autorelease]; NSData *data = [[NSData alloc] initWithData:result]; NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; -> in this line - "[__NSCFDictionary length]: unrecognized selector sent to instance" NSArray *events = [parser objectWithString:jsonString]; What's the problem? Can I get the string in an other way or parse the object differently? Thanks.
If you are working with the delegate callback - (void)request:(FBRequest *)request didLoad:(id)result; the parsing work has been done for you. Traverse the NSDictionary or NSArray to find the data you are looking for. If you are working with the delegate callback - (void)request:(FBRequest *)request didLoadRawResponse:(NSData *)data; you should initialize an NSString with the data, and use the category method that SBJSON adds to NSString for creating an id. That is assuming the data is data that constructs a string. NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; id result = [jsonString JSONValue];
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "iphone, objective c, json" }
“Solution to” vs. “solution of ” What is the difference between saying _solution **to** the problem_ and saying _solution **of** the problem_? Are they both equivalent, or is there some difference?
You almost always hear "solution to the problem" and sometimes "solution for the problem" — but almost never do you hear "of" in that context. > **solution** |səˈloō sh ən| _noun_ 1 a means of solving a problem or dealing with a difficult situation : _there are no easy solutions to financial and marital problems_. • the correct answer to a puzzle : _the solution to this month's crossword_. Note that both of NOAD's examples use _to_. One would use "solution of" if one is referring to a chemical solution: > 2 a liquid mixture in which the minor component (the solute) is uniformly distributed within the major component (the solvent).
stackexchange-english
{ "answer_score": 11, "question_score": 17, "tags": "differences, prepositions, to of" }
Node.js Cluster not forking anything I am trying to implement clustering in my Node.js application. When I print out how many workers are spawned inside the for-loop with the `fork()` method, it prints out nothing. The `coreCounter` variable also = 0 if I print it out. Here is my code: let cluster = require('cluster'); if (cluster.isMaster) { let coreCounter = require('os').cpus.length; for (let i = 0; i < coreCounter; i++) { cluster.fork(); } cluster.on('exit', function () { cluster.fork(); }); } else { require('server.js'); } I tried to npm install cluster and npm install os, it did not work, do I have to do npm install if I "require" something?
You just need to add `()` after the cpus. See here: let cluster = require('cluster'); if (cluster.isMaster) { let coreCounter = require('os').cpus().length; for (let i = 0; i < coreCounter; i++) { cluster.fork(); } cluster.on('exit', function () { cluster.fork(); }); } else { //require('server.js'); console.log('walla!') } You should not `npm install` NodeJS core modules. P.S. I suggest you get some practice with NodeJS before implement clustering
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "node.js, server" }
Is it possible to capture and export a running process over ssh with x? I've seen plenty of questions on the web about exporting a display from a remote host to a local. I can get this to work fine, but that's only for commands run after logging into that terminal. Is it possible to export a currently running process/it's window over ssh?
No. You can run only "new" commands from remote shell that will use your display (X server). It can't be also used for running full featured graphical session, nor to view whole "Desktop" like VNC and it was never intended to.
stackexchange-superuser
{ "answer_score": 1, "question_score": 0, "tags": "ssh, terminal, xorg, x server" }
distance between rows in UITableView if you have a UITableView filled with for example 3 rows. like this, ------ ------ ------ how can i make this? ------ ------ ------ how can i change the distance between rows in a UITableView. ---- = a full row
- (CGFloat)tableView:(UITableView *)atableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {return 20;} Implement this function in your m.-File. The value which is returned by this function consist of the height of the rows (px).
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "iphone, objective c, ios, ipad, uitableview" }
Restart SBT Shell in IntelliJ IDEA after SIGINT I have a bad habit of pressing `Ctrl+C` when I want to copy an error from the SBT shell. This will kill the shell and I can't figure out how to restart it without exiting and reopening the project. Is there a way to do this? It's quite annoying. EDIT: Just to clarify for some of you answering: I am on linux. Running the `2020.1.1` release (Community Edition). This is what my shell looks like after I kill it with `Ctrl+c` ![enter image description here]( There is no panel on the side with a Play/Stop/Etc button.
There should be `Start sbt shell` button on the left-hand side toolbar of `sbt shell` tool window as indicated by the arrow bellow ![ After pressing it the shell should start and the button turns into `Restart sbt shell` ![enter image description here]( If the play button is not visible, then the side toolbar is likely hidden, so click on the three dots on the right of `sbt shell` and select `Show Toolbar` ![enter image description here](
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 4, "tags": "scala, intellij idea, sbt" }
Angular JS Filter Group Select Filter I have a users object similar to the one below: $scope.users = [ { name : 'John Doe', attached_groups = [ {1:object}, {2:object} ] }, { name : 'Bob Doe', attached_groups = [ {3:object}, {4:object} ] } ]; In my HTML I have the following group select. <select id="group_filter"> <option value="1">Group 1</option> <option value="2">Group 2</option> <option value="3">Group 3</option> <option value="4">Group 4</option> </select> I would like to add a filter to my ng-repeat to filer on the groups. I have the following ng-repeat. <tr ng-repeat="user in users| filter:query> Any help would be appreciated.
Well I didn´t change the structure of the $scope.users but you need review because i donñt think is the best way. The important here: < ng-repeat="user in users | filter:search" and you need define the search filter: $scope.search = function(user) { if ($scope.filter === undefined ) { return true; } var match = false; angular.forEach(user.attached_groups, function(group) { if (group.hasOwnProperty($scope.filter)) { match = true; } }); return match; }; the filter could be more easy if you change the attached_groups. You can see the example here: <
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "javascript, angularjs, angularjs directive, angularjs scope, angularjs ng repeat" }
Using Codeplex templates in WPF I had created a basic application using Visual studio 2010. To modify the existing look and for improving GUI, I tried browsing for templates and found Codeplex. And then downloaded an exe & installed it. No clue regarding what should be done after that! checked out the visual studio project settings. Nothing regarding templates. I am new to WPF. Any ideas how to proceed ? There are many articles around stating that the themes can be found in codeplex but none about how 2 use it.
Do you mean the WPF Themes? Please check the link <
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "c#, .net, wpf, visual studio 2010, xaml" }
SQL Server Compact Toolbox with disabled add connections options The original problem is that I'm trying to use SQL CE 4.0 with Entity Framework 5. I have applied the service pack 1, applied different hot fix (as suggested in different forums and blogs). Now, I've read that SQL Server Compact Toolbox can manage these connections, but when I follow the steps, I get this menu : !enter image description here Where the two first items should be enabled. My project is a C# WPF project. I've also read (from some post over a year ago) that only Asp.Net projects are supported with this feature (Why??), is this why I get the disabled menu items?
For the sake of anyone stumbling across this very same issue, I had uninstalled SQL CE 3.5 trying for "force" VisualStudio into _not_ showing it. It seems to be hard-coded or something because it did not work. I re-installed it (SQL CE 3.5) and the options are no longer disabled.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "c#, entity framework, sql server ce 4" }
Will an incomplete mongoose document validate if it has missing, non-required keys? If I have a schema like var kitty = Schema( { "name": {type: String, required: true}, "age" : Number } And on a mobile app, I build a JSON document with the contents of a form, but only include required and non-null fields, like: //pseudo android app code var kitty = {}; kitty.name = field1.value; if (age.text !== undefined) kitty.age= age.text; doHTTPSend(url, kitty); Will this validate, or does a document have to match 1:1 with the schema, like: var kitty = { "name": "Sylvester", "age": null //or age:"", or age: }
Yes, that will validate. You only _need_ to pass in the fields that are required. There's an example in the Mongoose documentation of this: <
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "validation, schema, mongoose, document" }
Getting unique items from a list What is the fastest / most efficient way of getting all the distinct items from a list? I have a `List<string>` that possibly has multiple repeating items in it and only want the unique values within the list.
Use a `HashSet<T>`. For example: var items = "A B A D A C".Split(' '); var unique_items = new HashSet<string>(items); foreach (string s in unique_items) Console.WriteLine(s); prints A B D C
stackexchange-stackoverflow
{ "answer_score": 165, "question_score": 116, "tags": "c#, list, unique" }
How to get the path for openFile in Haskell? I have the following program which throws a runtime exception: import System.IO main :: IO () main = do handle <- openFile "palindrome.txt" ReadMode input <- hGetContents handle hClose handle It type checks, but whenever I try to run `main`, I'll get an error: ![Atom session on Mac OS X]( What am I doing wrong?
Your current program uses a relative path. As such, the file must be in the same directory where you started GHCi. Given that your workspace is `$HOME/Desktop/Haskell`, it probably checks only for `$HOME/Desktop/Haskell/palindrome.txt`. If you want to use the `palindrome.txt` in $HOME/Desktop/Haskell/u03/3-1/`, you need to either use the absolute path in your code, or run GHCi in that directory. Note that you can change the current directory in GHCi with `:cd`, so the following commands in GHCi should work: Prelude> :cd /path/to/your/directory Prelude> :l palindrom-a.hs *Main> :main
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "macos, haskell, path, functional programming, program entry point" }
How Memcached negotiate the protocol? I know that Memcached can negotiate protocol with the client, but I know nothing (neither can found anything on Internet) about the negotiation mechanism the server use. Any idea?
As you can see in the source code, it is all based on the first byte received by the server. If it is a magic request byte (0x80), then it considers that the client tries to use the binary protocol, otherwise it will use the ascii protocol.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "memcached, binary, protocols, ascii" }
Chromium Sandbox on Mac OSX: Is it enabled by default? I have decided to finally replace the closed source and privately owned Google Chrome with the open-source Chromium on my Mac OSX 10.9.2 (Mavericks). I have read the differences between both here: And the article suggests that in Chromium, unlike Chrome, not always the Sandbox feature is enabled (and to open "about:sandbox" in the browser to confirm". Well when I open it in Chromium I just get the default "not found" page. ## Does that mean Chromium does not have sandbox protection on Mac OSX?
Reanimating :) < According to this it is enabled by default.
stackexchange-security
{ "answer_score": 1, "question_score": 1, "tags": "web browser, macos, sandbox" }
Why Suggestion issue cannot go to Verifying or Testing status? Bug issue is done and goes from In Progress to Verifying status. Feature issue is done and goes from In Progress to Testing status. When one accepts Suggestion issue and start implementing it, one change issue's status from New to In Progress status. When a Suggestion issue is implemented, only Pending and Closed status can go next. Why? Does not Suggestion issue need to go verified or tested?
You can configure the next allowed status for an issue based on the issue's tracker, its current status and the role of the user who performs the change. This can be configured globally in _Administration_ -> _Workflows_. Make sure to check all transitions you want to allow there. See < for more information about configuring workflows in Redmine.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "redmine, issue tracking" }
Get the last row values filled in current sheet I need to fetch the last row values of the form response tab sheet to the current sheet and then Transposed and displayed columnwise excluding the first timestamp column I tried but this get unexpected results =TRANSPOSE(INDIRECT("'Form Resposes1'!" & COUNT('Form Resposes1'!A:A)+1 & ":" & COUNT('Form Resposes1'!A:A)+1)) The response tab sheet looks like: ![enter image description here]( The expected result from the formula is: ![enter image description here](
This should work if your sheet is named "Form Responses 1": > =TRANSPOSE(SORTN('Form Responses 1'!B2:H,1,0,'Form Responses 1'!A2:A,0)) **References:** * SORTN * TRANSPOSE
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "google sheets, google sheets formula" }
I get an error when trying to compare dates in Python pandas dataframe I am trying to iterate through rows in a .csv file and perform some calculations if some conditions are met. Here's my code sample: I made sure to identify the date columns by using "parse_dates" df = pd.read_csv('.csv file', parse_dates = ['Columns containing dates'] for index, row in df.iterrows(): Flag = (df['Date 1'] - df['Date 2']).dt.days while Flag > 0 and df['Balance'] > 0: do something Removing the while loop, and printing Flag yields rows of numbers with a dtype of int64. Adding the while loop, I get: > ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). Which I am not understanding... Can someone point me the in the right direction? Also, I am not trying to modify the dataframe, but merely reading the .csv, extracting information from it to perform calculations, and output to a new file.
The variable `Flag` in you code is a `pandas Series`. You cannot evaluate it with `Flag>0`. The error shows you the permitted operations on pandas Series i.e., `.empty(), .bool(), etc.`. When you print the value of `Flag` it prints the Series that it contains. You need to iterate over the elements in `Series` and then check for comparison as you want. I am not sure you you want to compare here but below document might make it easy for you : <
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "python, pandas, dataframe, date, compare" }
PHP APC Seg Fault > **Possible Duplicate:** > Is APC compatible with PHP 5.4? I am trying to get APC to work on (what will be) my production environment stably. I'm getting seg faults when it is enabled and certain libraries are used. It seems to be associated to Doctrine. Everything is running fine on other machines I use, which are using a newer version of APC that is in beta (3.1.13 and 3.1.11). Should I be OK to use 3.1.13 beta, or is there a setting I'm missing that will solve the seg faults?
For PHP 5.4, apc versions up to 3.1.12 are producing segfaults (personal experience). APC 3.1.13 is said to work better though. Personally, I opted for xcache until a stable APC is released. In any case, using a beta system in production requires some extra caution. Have a look at Is APC compatible with PHP 5.4 or PHP 5.5? which is always kept up-to-date
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "php, doctrine orm, apc" }
What is the best way to name a table column when there are multiple of similar items? I am trying to create a table but thought what would be the best way to name the columns. I read some articles about database table naming conventions and saw that: Instead of **supporterOne** or **supporterone** , a better way is **supporter_one**. My question is which is the more appropriate name between these two? supporter_one supporter_two supporter_three Or supporter_1 supporter_2 supporter_3 Or maybe it does not matter and I can use whatever I want?
You can use this format as it will be easy if you are going to dynamically read or write data in a selected column based on some scenarios supporter_1 supporter_2 supporter_3
stackexchange-stackoverflow
{ "answer_score": -1, "question_score": 0, "tags": "mysql, database, postgresql, oracle, mariadb" }
Why shoud we add different versions of the same family of font files like (light, bold ,black or italic...)? For example, I found that even without adding the bold version of the Raleway font, I can set `fontWeight: FontWeight.bold` and that works correctly. So why we add bold and black versions of fonts?
When you add fontWeight: FontWeight.bold to a regular font say, like Raleway font, you get a faux style which is not the correct style (boldness) of what the font should actually look like when you use its 'bold' or 'black' versions. It could potentially lead to double boldness and is not the true representation. You should check out google font package on pub.dev < I use the package to avoid the hassle of adding my fonts manually.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 5, "tags": "flutter, fonts" }
Difference between Kafka and ActiveMQ I have been working on `Active MQ` for quite some time and familiar with the `Active MQ` architecture. Recently I have been hearing a lot about `Kafka` as a messaging system. What advantages does it have over Active MQ and other messaging system? Is it just another Big data buzz word? Also is `kafka` suitable for zero loss messaging system?
This is too broad to discuss but in my opinion the most important factor about `Kafka` over `ActiveMQ` is the `throughput`. From the wiki page > _Kafka provides an extremely high throughput distributed publish/subscribe messaging system. Additionally, it supports relatively long term persistence of messages to support a wide variety of consumers, partitioning of the message stream across servers and consumers, and functionality for loading data into Apache Hadoop for offline, batch processing._ **Also is kafka suitable for zero loss messaging system?** In very brief kafka Guarantees these following : 1) Messages sent by a producer to a particular topic partition will be appended in the order they are sent. 2) For a topic with replication factor N, it will tolerate up to N-1 server failures without losing any messages committed to the log.
stackexchange-stackoverflow
{ "answer_score": 20, "question_score": 20, "tags": "activemq, apache kafka" }
How to add SOAP interface for Delphi Synapse HTTP Server? I've got a custom HTTP Server created using Delphi 7 and Ararat Synapse which receives HTTP GET from another application with a simple set of variables. For example: The application source is similar to this - < Now, my customer needs me provide a SOAP interface. Completely new to SOAP, I did some research and found it to be very complicated. I would like to know what's the easier way to incorporate this interface to my HTTP server. Or should I find ready made SOAP To HTTP Conversion app if there is such a software. Thank you. Note: I'm not the original developer of the HTTP Server.
There is a Web Service Toolkit for Free Pascal and Delphi which can be used to write SOAP servers. I have not yet used it myself but it is in active development and might be compatible with Synapse. Update: the current version seems to include support for Internet Direct (Indy) and Synapse (HTTP server and TCP server).
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "delphi, soap, delphi 7" }
Unexpected token ":" in query modifier I am using sailsjs for my api project. According to the documentation < following query modifier may be used User.find({ or: [ name: { startsWith: 'thelas' }, email: { startsWith: 'thelas' } ] }, cb); So based on this I build following modifier: var query = { or: [ cityName: { contains: req.param('city') }, zoneNumber: { startsWith: req.param('query') } ] }; And I pass it like this User.find(query, function(err, res){}); However I get an error regarding the query format: cityName: { ^ SyntaxError: Unexpected token : Does my query break json format rules? Or is this a not common error comming from the framework?
Try this: var query = { or: [{ cityName: { contains: req.param('city') }, zoneNumber: { startsWith: req.param('query') } }] }; You are missing `{}`
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "javascript, json, express, sails.js" }
HTML CSS Form - How to center the form on the page? I made a form and I am trying to center it on page but it doesn't work. I tried applying these 2 CSS to it but it didn't work. form{margin: 0 auto;} form{margin: auto;} I also tried enclosing the form into div.container and applying same CSS to it but still nothing. But this works: {margin: 0 250px 0;} Form here
You need to do two things to achieve this: 1) Change `inline-block` display on the form to be `block`. 2) Fix the width (you currently have it as `auto`). Demo: < Or if you don't want to fix the form size, you can use `text-align: center` (Thanks @donderpiet) Demo: <
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 0, "tags": "html, css, forms, margin" }
AppleScript to export script editor script as application I have a binary that I want wrapped up as an Application, so I thought this was a good use case for AppleScript. I want to automate how Script Editor lets you export an AppleScript as a .app bundle. This is what I have so far, I'm confused about how to read the libraries dictionary for the script editor. tell application "Script Editor" set command to "do shell script " & "\"APP_PATH\"" set innard to {contents: command} set Tallgeese to make new document with properties innard save Tallgeese as "application" end tell
You must specify the full path where you want to save this application. Here is an example that saves it in the " **Applications** " folder of the user. set appName to "someAppName" set thePath to (path to applications folder from user domain as string with folder creation) & appName & ".app" tell application "Script Editor" set command to "do shell script " & "\"/bin/ls\"" set innard to {contents:command} set Tallgeese to make new document with properties innard compile Tallgeese save Tallgeese as "application" in thePath close document 1 -- close the document -- quit ---- quit the editor end tell
stackexchange-apple
{ "answer_score": 2, "question_score": 1, "tags": "applescript, automator, script" }
Scraping Wolfram Alpha for h2 tag I'm currently trynig to < and get to the h2 tag that includes the text "Market Data". I am doing this using BeautifulSoup by finding all h2 tags and checking h2.text for "Market Data". However, the problem is the soup version of this url's text does not include any h2 tags. This contrasts with when I click "inspect element" and find h2s in Chrome. Why can't I see h2s when I do soup(url.text)? Does that mean its not a static page or something? How then can I scrape this h2 tag?
The actual source is from the URL linked in the ng-include tag (documentation). A detailed answer on how to account for angularJS source, which is not static but dynamically loaded, can be found here
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "html, web scraping, beautifulsoup" }
Help evaluating summation. I am trying to evaluate: $$\lim_{n \to \infty}\frac{\sum\limits_{i=1}^{n}{10}^{i/n}}{n}$$ My thought is convert it to convert it to an integral: $$\lim_{n \to \infty}\frac{\sum\limits_{i=1}^{n}{10}^{i/n}}{n} = \lim_{n \to \infty}\sum\limits_{i=1}^{n}{10}^{i/n} \times \frac{1}{n} $$ Which means: $$ \frac{b-a}{n} = \frac{1}{n} $$ $$ b - a = 1 $$ Therefore we can say the integral evaluates from **0 and 1 (not sure about this)** : $$ \int_0^1{10^{x} dx}$$ And using U-substitution I get: $$ \frac{1}{ln(10)} \times e^{ln(10)} - \frac{1}{ln(10)} $$ $$ \frac{9}{ln(10)} $$ Did I do this right?
You should recognize this as a Riemann sum, with value $$\int_0^1 dx \, 10^x = \int_0^1 dx \, e^{\log{10} x}=\frac1{\log{10}} (e^{\log{10}}-1)= \frac{9}{\log{10}}$$
stackexchange-math
{ "answer_score": 2, "question_score": 2, "tags": "calculus" }
Editing config file via a bash script on ubuntu i am trying to write a script that will edit a config file on ubuntu i need to enable an option for ip forward for the file /etc/sysctl.conf i need to edit this line, from this #net.ipv4.ip_forward = 0 to that: net.ipv4.ip_forward = 0 to remove the "#" can i do it with a script? thanks for the help!
You should use the Stream EDitor `sed` to do this. sudo sed -i '/net\.ipv4\.ip_forward =/s/^#//' /etc/sysctl.conf This command runs using `sudo`, which is needed to edit `/etc/sysctl.conf`. `sudo` calls `sed -i` which edits the files instead of printing the result to stdout. `/net\.ipv4\.ip_forward =/` is a regex that looks for lines to modify, and `s/^#//` removes `#` only if it is the first character of the line. One good practice when finding the right syntax for your edits is to _not_ use `sed -i` and instead just use `sed` and view what comes out. Also, if you want another safety net, you can run `sed -i.bak` which will create a backup file with `.bak` as the suffix. Be careful where you use that though, because the backup is created in the same dir as the original file, which can cause issues in various circumstances, such as when all the files in a directory are read, such as various `.d` directories.
stackexchange-unix
{ "answer_score": 0, "question_score": 0, "tags": "scripting" }
traverse Core Data object graph with added predicate? I want to load a client object and then pull their related purchase orders based on whether they have been placed or not, purchase orders have an IsPlaced BOOL property. So I have my client object and I can get all purchase orders like this, which is working great: purchaseordersList =[[myclient.purchaseorders allObjects] mutableCopy]; But ideally I would actually like 2 array's - one for each order type: IsPlaced=YES and IsPlaced=NO How do I do that here? Or do I need to do another fetch?
First, there is no reason to be turning the set into an array unless you are sorting it and there is no reason to be turning that array into a mutable array. Did you get that from some example code? Second, you can filter an array or a set by using a predicate so you can create two sets (or arrays) easily via: NSSet *placed = [[myclient purchaseorders] filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"isPlaced == YES"]]; NSSet *notPlaced = [[myclient purchaseorders] filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"isPlaced == YES"]]; If you are wanting to use this for a `UITableView` then look into a `NSFetchedResultsController` instead. It will save you a LOT of boiler-plate code. Do you remember what example code you got that from? Been seeing that `-mutableCopy` a lot lately and would love to quash it. :)
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "objective c, core data" }
TFS Workitems always leave 'Closed By' blank We have a TFS workitem workflow where developers set workitems to be 'done'. It is largely our of the box with little custom configuration. This populates the 'Closed Date' but not 'Closed By'. The workflow continues as testers assign it to themselves and set the state to be 'Tested', but now I can no longer see on a report which developer closed the item. How can I get a report of who did the work?
Given that you have a "Tested" state, it seems that the transitions have been customized. Ensure that all transitions to the "Closed" state have the correct rule on them to update the "Closed By" field. The Closed By definition on the transition should look something like this: <STATE value="Closed"> <FIELDS> .... <FIELD refname="Microsoft.VSTS.Common.ClosedBy"> <ALLOWEXISTINGVALUE /> <COPY from="currentuser" /> <VALIDUSER /> <REQUIRED /> </FIELD> .... </FIELDS> </STATE> More information on customizing work item transitions can be found here and here.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "tfs, tfs workitem, tfs process template" }
How to use includeLocs in Spring Mongo Template Need to write this query in spring mongo template "$geoNear": { "near": [ -73.9815103, 40.7475731 ], "spherical": true, "distanceField": "distance", "includeLocs": "locs" } Specially **" includeLocs": "locs"** this part
This option is currently missing. I opened #3586 to provide support for it. Meanwhile you could do something like the following. GeoNearOperation operation = new GeoNearOperation(query, "distance") { @Override public Document toDocument(AggregationOperationContext context) { Document $geoNear = super.toDocument(context); $geoNear.put("includeLocs", "distance.location"); return $geoNear; } }
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "mongodb, spring data mongodb, mongotemplate" }
The Equivalent of indexof I am trying to find out the equivalent of indexof to get the position of specific element in array golang the purpose for integers in array. package main import ( "fmt" ) func main() { fmt.Println("what") arr := []int{1, 2, 3, 4, 2, 2, 3, 5, 4, 4, 1, 6} i := IndexOf(2, arr) }
There is no equivalent for `IndexOf` in Go. You need to implement one your self. But if you have have sorted array of Ints, you can use `sort.SearchInts` as shown below. package main import ( "fmt" "sort" ) func main() { fmt.Println(sort.SearchInts([]int{2,3,4,5,9,10,11}, 5)) } Also from the godoc: _SearchInts searches for x in a sorted slice of ints and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order._
stackexchange-stackoverflow
{ "answer_score": -2, "question_score": 0, "tags": "go" }
How may allowing HTML inside Twitter Bootstrap's tooltips cause XSS issues? I was going through Twitter Bootstrap's docs on tooltips. It is stated there not to set `data-html=true` inside tooltips if you're worried about XSS attacks. What `data-html=true` does is it allows you to write HTML in an element's `title` attribute. I don't know anything about XSS attacks. I tried reading about it on Wikipedia but that wasn't much help. Can you please explain: 1. How might it raise security issues? 2. What would be the secure way to allow HTML inside tooltips?
XSS means cross site scripting, so an XSS attack often involves injection of code (e.g. JS) into a site that then communicates with or initializes malicious code from another site/server. 1) It would raise security issues because unless `data-html` is set to `true` any HTML in the tooltip will be escaped / shown as text and not parsed. If it is set to `true` the content will be parsed as HTML. This means if you have user input variables displayed here that are not properly sanitized they could potentially inject malicious HTML code, for instance javascript that initiates an XSS attack. 2) Just make sure everything you are outputting in the tooltip is safe. For example, if you let users enter information about themselves that is displayed in a tooltip make sure it is properly sanitized before you output it in the tooltip.
stackexchange-stackoverflow
{ "answer_score": 9, "question_score": 7, "tags": "html, twitter bootstrap, xss" }
Why I am getting 'valueForUndefinedKey' error when using AnyObject in Swift? Im have a question. Why the following crash reason? since "name" exists? viewcontroller1: struct pointDict { let id: Int let name: String } var pointsPlane: [pointDict] = [] let wp = pointDict(id: 123, name: "test") pointsPlane.append(wp) override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let destVC = segue.destination as? viewcontroller2 { destVC.dt = pointsPlane[0] as AnyObject } } viewcontroller2: var dt: AnyObject? let detail = self.dt name.text = detail?.value(forKeyPath: "name") as? String Crash Report: > valueForUndefinedKey:]: this class is not key value coding-compliant for the key name
`AnyObject` is reference type but a struct is value type and therefore is not ObjC key-value coding compliant. Your approach is bad practice anyway. A _swiftier_ way is to declare the properties with the real type. The default declaration of `detail` in the template is not needed. viewcontroller1: struct PointDict { let id: Int let name: String } var pointsPlane: [PointDict] = [] let wp = PointDict(id: 123, name: "test") pointsPlane.append(wp) override func prepare(for segue: UIStoryboardSegue, sender: Any?) if let destVC = segue.destination as? viewcontroller2 { destVC.dt = pointsPlane.first } } viewcontroller2: var dt : PointDict? override func viewDidLoad() { super.viewDidLoad() name.text = dt?.name ?? "" }
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "swift, xcode, anyobject" }
How can we find the largest $B$ that the implications of the implicit function theorem hold? In the _implicit function theorem_ , it is stated that (Analysis on Manifolds, Munkres, p74) ![enter image description here]( My question is that how can we find the largest $B$ s.t the function $g$ satisfies the conditions given in the theorem ? I mean the theorem just states the existence of such $B$ as a neighbourhood of $x$; however, practically, how can we find the largest $B$ ? **Edit:** For example, since we do know the existance of such $B$, can we just compute $g$ and argue that the largest possible $C$ where $g$ is class of $C^r$ and $f(x,(g(x))) = 0$ is the largest possible $B$ ?
The size of this $B$ depends on many things: higher derivatives of $f$, the slope of the tangent plane to the graph of $g$ at $(a,b)$, what have you. Therefore it is almost impossible to give a cute answer. Consider as an example the equation $$f(x,y):=x^2+y^2-1=0\ .$$ At $(a,b):=(0,1)$ we have $g(x)=\sqrt{1-x^2} \quad (-1<x<1)$, but at $(a,b)=(0.9, 0.436)$ the function $g$ is only defined in an open interval of length $0.2$. If you can "explicitly solve" $f(x,y)=0$ in the neighborhood of $(a,b)$ and are in possession of a finite expression for $g$ you don't need the implicit function theorem at all. Instead you can determine the radius of $B$ by inspecting this expression.
stackexchange-math
{ "answer_score": 2, "question_score": 1, "tags": "real analysis, analysis, implicit function theorem" }
Can I use IConnectivityManager, IWifiManager or ServiceManager? I have an app that uses these imports to access functions like setMobileDataEnabledMethod() or startTethering(): import android.net.IConnectivityManager; import android.net.wifi.IWifiManager; import android.os.ServiceManager; My app compiled on Android Studio and was able to build the apk. After Android Studio updated to 4.1 the app cannot compile. I get the error: Cannot resolve symbol IConnectivityManager Cannot resolve symbol IWifiManager Cannot resolve symbol ServiceManager Any ideas why?
The problem was that in the Android Studio update, I also updated the SDK. The SDK override the android.jar files that have the hidden apis. So I downloaded the hidden android.jar file again and override the sdk one. Everything started to work as before. I download the (hidden apis) android.jar from here: <
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android studio" }
Headed down the wrong path (Proof by Induction) I'm trying to solve a relatively simply problem, but I believe my path is going the wrong direction, or maybe i'm close and just stuck. Any guidance? Prove $(1+ \frac{1}{2})^k+ \ge 1+ \frac {k}{2}$ P(1) is true. Assume P(k) is true, prove P(k+1) $(1+ \frac{1}{2})^{k+1} \ge 1+ \frac {k+1}{2}$ $(1+ \frac{1}{2})^1 + (1 + \frac{1}{2})^k \ge 1 + \frac {1}{2} + \frac{k}{2}$ $\frac{3}{2} + 1^k + (\frac{1}{2})^k \ge \frac{3}{2} + \frac {k}{2}$ $\frac{5}{2} + (\frac{1}{2})^k \ge \frac{3}{2} + \frac {k}{2}$ So this is clearly not correct, and I think my problem is in my very first step, but I just don't know what it is.
Start here: \begin{align} \left( 1+\frac12\right)^{k+1}&=\left( 1+\frac12\right)^{k}\left( 1+\frac12\right)^{1} \end{align} For the next move, you want to use the induction hypothesis. $$ \left( 1+\frac12\right)^{k} \geq 1+\frac{k}2$$
stackexchange-math
{ "answer_score": 2, "question_score": 0, "tags": "proof verification, induction" }
Getting php code issue in AJAX file upload example at sitepoint Can someone please help me to debug the php code in the post at < . PHP script here is no longer able to upload the file. I tried this with my local server but the file is not uploading in upload folder. Thanks in adv.
This tutorial is old. In file `filedrag.js` there is function `function UploadFile(file) {....}` in that change `xhr.setRequestHeader("X_FILENAME", file.name);` to `xhr.setRequestHeader("X-FILENAME", file.name);` since underscores are deprecated in later Apache releases, and ignores it, so there is error which is seen in console. For more (refer Header names with underscores ignored in php 5.5.1 / apache 2.4.6 ) After changing it will upload to respective directory
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -1, "tags": "javascript, php" }
Autonomous equation having $\frac{t^2}{1+t}$ as a solution > Find an autonomous equation having $\displaystyle\frac{t^2}{1+t}$ as a solution. So the desired function $f$ should depend only on $x$, if I'm not wrong in the form $x'=f(x)$, that means the goal is to write $t$ as a function of $x$, but this seems almost impossible, however I compute the derivative; $$\bigg(\frac{t^2}{1+t}\bigg)'=\frac{2t}{(1+t)}-\frac{t^2}{(1+t)^2}$$ and $$x=\frac{t^2}{1+t}=t-\frac{t}{(1+t)}$$ for example, if I try $\displaystyle -x^2=-\frac{t^2}{(1+t)^2}-t^2+\frac{2t}{(1+t)}$ the middle part is redundant, how can I get rid of it ?
Hint: solve $x = t^2/(1+t)$ for $t$ in terms of $x$. Differentiate the resulting equation $t = T(x(t))$ with respect to $t$, and isolate $x'(t)$.
stackexchange-math
{ "answer_score": 3, "question_score": 3, "tags": "ordinary differential equations" }
When should we whitelist Community Cloud IP ranges? As per the article Salesforce IP Addresses and Domains to Allow : > Recommended for seamless access: Our best practice is to allow our entire set of IP ranges. This is to ensure our login pools can process your end users’ and integrations’ login authentications when accessing Salesforce all over the world, and to avoid any unintended service disruptions due to movement between data center sites. There is a section dedicated for Community Cloud IP Ranges in this same article, but the question is when should we allow/whitelist Community Cloud IP ranges ? This question may sound opinion-based, but this just of better of collecting some facts and actual experience from the community Thank you
To me it makes sense if you are an organization which allows outside connections to specific systems/IP's only and you need to allow access to experience cloud from your internal corporate network. It doesn't matter then if your experience is public or requires login as this feature is whitelisting IP's in other systems like a firewall not Salesforce. I am assuming that external API calls via Salesforce (For community specific code) are made from Salesforce's IP Ranges, if they use Community Cloud IP ranges then the external systems need to whitelist these IP's as well..
stackexchange-salesforce
{ "answer_score": 1, "question_score": 0, "tags": "community, security, community cloud, experience cloud, ip" }
ifelse with list of possible string matches and no else So normally, if I want to populate a new column data$new.col with 1s if it finds the strings "foo" or "bar" in data$strings and 0s if not, I would use something like this: data$new.col <- ifelse(grepl("foo|bar", data$strings, ignore.case = T, perl = T), "1", "0") However, I want to do the equivalent of this without an "else". I tried using a simple assignment but I must be doing something wrong because it's not working: data$new.col[data$strings == "foo|bar"] <- "1" Thanks in advance.
Try `data$new.col[data$strings %in% c("foo", "bar")] <- "1"` **_Why your code doesn't work:_** Using the condition `data$strings == "foo|bar"`, you are matching with the (unique) string `"foo|bar"`, not with `"foo"` or `"bar"`. The `%in%` operator allows you to match with any element in the vector `c("foo", "bar")`
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "r, if statement" }
how can I get Windows Remote Desktop to work on two monitors instead of just one? At home, I have two monitors on my computer running Vista, which I then use Windows Remote Desktop to access a remote Windows computer. But, the Remote Desktop session only uses just one of my home monitors. I want to have it use both monitors, to have all the screen for the remote session. Complication: I keep one of my home monitors veritical, which is great for source code.
Seems you need a version of Remote Desktop Client 7.0 to achieve this. This is the version that came with Windows 7 but you can download an update here: < Once you have the latest version of the RDC client here's instructions on setting up multiple monitors: Link
stackexchange-superuser
{ "answer_score": 4, "question_score": 2, "tags": "windows, windows vista, remote desktop, remote access" }
¿Como puedo deshabilitar los puntos '.' y comas ',' en una entrada de texto? Saludos, necesito que en una entrada de texto (text input) como: <input type="text" id="txtNombre" name="txtNombre" value="" placeholder="Ej: Juan" required="" /> no me deje colocar ' **.** ' y ' **,** '
En vanilla JS: function noPuntoComa( event ) { var e = event || window.event; var key = e.keyCode || e.which; if ( key === 110 || key === 190 || key === 188 ) { e.preventDefault(); } } <input type="text" onkeydown="noPuntoComa( event )"> Desglose `KeyCode`: * `110` \- Punto en el teclado izquierdo * `190` \- Punto en el teclado derecho * `188` \- Coma
stackexchange-es_stackoverflow
{ "answer_score": 9, "question_score": 4, "tags": "javascript, html" }
NPAPI mac plugin shows unresponsive message in Chrome when opening context menu I'm working on an NPAPI based plugin, and have been observing an issue when opening the context menu in Chrome, displaying an error message saying that the page is unresponsive after leaving it open for 30 seconds. I've observed the same issue with Flash Player 10.3 (which uses NPAPI, 11.x versions uses PPAPI). Also, this issue only happens with Chrome, and trying to open the context menu when we aren't in the mouse down event takes no action, and no menu gets visible. Any thoughts? Thanks, Rodrigo.
This is simply a bug in Chrome's NPAPI plugin host on OS X.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "macos, google chrome, npapi, browser plugin" }
How to properly write multiple authors in bibtex file? I use Jabref to store all articles I need and bibtex4word add-on (in MS Word) to maintain the reference list. So, I would like to know how to properly fill the "author" field in Jabref with multiple authors to appear them correct in the reference list. For example, I've got the article with several authors: > E. Orti, J.L. Bredas, C. Clarisse And I would like them to appear in this manner. But instead I get this: > C. C. E. Orti, J. L. Bredas
The appropriate separator for authors is "and". Comma is used to distinguish first and last name (link): author = "Orti, E. and Bredas, J.L. and Clarisse, C.",
stackexchange-tex
{ "answer_score": 260, "question_score": 199, "tags": "bibtex, jabref" }
Is the "fr-DZ" label ( that we put on the hreflang ) correct for SEO? Is this code recognizable by google by Google? I mean, is the "DZ" code correct for SEO? I searched about this subject, but any precise answer. <link rel="alternate" hreflang="fr-DZ" href=" I'm using wpml for translation, and support told me that is not sur that "fr-DZ" are correct for SEO directive. Any idea about this subject, which can help me? This code is very important for me, to target my audience.
In the guide **Tell Google about localized versions of your page --> Supported language/region codes**, Google says: > The value of the hreflang attribute identifies the language (in ISO 639-1 format) and optionally a region (in ISO 3166-1 Alpha 2 format) of an alternate URL. (The language need not be related to the region.) For example: > > * de: German language content, independent of region > * en-GB: English language content, for GB users > * de-ES: German language content, for users in Spain > DZ is the entry for **Algeria in ISO 3166**. Therefore, your markup is correct for French for Algeria.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "wordpress, seo, wpml, hreflang" }
Running event function after event has been set up This will do it: $('input').on('change', function(event){ ... }).change(); ...but what if there is another plugin installed that hooks some function on the change event? I'll trigger that function too, and it may not be desirable. How can I avoid such conflicts?
Use namespaced events $('input').on('change.myevent', function(event){ ... }).trigger('change.myevent'); This will get triggered on normal `change` events ( _along with other`change` handlers on it_) but will also be triggered by `change.myevent` ( _only it_ ) This will also allow you to unbind only your own event in case you need to ..
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "events, jquery" }
How to split and iterate over a string in Javascript? On a React Page inside `render` I have the code below, which produces the error: > topic.language.map is not a function {console.log(JSON.stringify(topic.language))} //this returns "English,French,Other" {topic.language.map( (ln, i) => { return ( <div key={i} className="language" > {ln} </div> ); } )} What am I doing wrong and how can I map the different languages? Do I need `.split` instead of `.map`? What would that look like?
If your `language` value is a string, you will need to split the string into an array before calling `map`. const topic = { language: 'English,French,Other' }; topic.language.split(/,/g).map((ln, i) => { console.log(ln); });
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -3, "tags": "javascript, reactjs" }
Problem with UV unwrap, collapsing vertices I am somewhat new to modeling but I have done uv's a few times before, but for some reason, I can't get it to work right this time. I have marked seams and set up a blank texture but when I unwrap (using the basic "unwrap") it comes out really strange, with most of the islands being a diamond shape.(Edit) I have deleted all seams and started from scratch and the same problem persists so it cant be from modifying the mesh after the uv is made. [![Example\[!\[\]\[1\]](
The problem was that I had pinned vertices(They are red when pinned), the fix was as simple as selecting all vertices in the uv editor and pressing Alt-p. Thank you so much, Mr Zak for bringing this to my attention.
stackexchange-blender
{ "answer_score": 1, "question_score": 0, "tags": "texturing, uv" }
Is there a driver for mysql on nodejs that supports stored procedures? I am looking for a mySQL driver for nodejs that supports stored procedures. < that I have been using gives the error PROCEDURE can't return a result set in the given context
it works in nodejs-mysql-native stored procedure: DELIMITER // CREATE PROCEDURE test1p1() BEGIN SELECT 1+1; END // DELIMITER ; node.js script: mysql = require('mysql-native'); var db = mysql.createTCPClient(); db.auth('test', 'tester', ''); // db, user, password db.query('call test.test1p1;').on('row', function(r) { console.log(r); }).on('end', function() { console.log('OK!'); }); output: { '1+1': 2 } OK!
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 11, "tags": "mysql, node.js, stored procedures" }
Regex to dynamically replace text in java What I am trying to do is make something like: some random stuff substitute("random stuff","xxx") test be replaced to the following: some xxx test If I use: substitute\((.*?)*\) I get to find the portion, but what I ultimately want is multiple groups where the first group is the text to search and the second group is to replace. I want it to be generic enough so I dont depend on the `,` since it can appear anywhere. Is there a regex that could work for all cases or should I be depending on the "" to get what I need?
Don't have tested it but you could try \w*\(\"(.*)\".*\"(.*)\"\) If order in substitute doesn't change you have in your first group the search and in second the replace term. And yes I don't see another way but depending on () and "".
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "java, regex" }
Need help for the category posts layout in wordpress On my wordpress website, I am using NewsCard theme referring this youtube tutorial. I have added categories to Menu but I am running into a strange problem. **As visible in the below image, I am getting huge gutters between the news cards which is ugly and resulting into the cards layout as very long vertical post cards.** Can someone help me resolving this? I am not able to figure out what I am doing wrong here. I was using generatepress theme earlier. ![enter image description here]( The more natural layout should be: ![enter image description here]( Thanks in advance.
In the file < this rule is adding the issue .generate-columns.grid-50, .grid-sizer.grid-50 { width: 50%; } I can't see without accessing your admin the best way to add a custom CSS rule to fix the one above, but as I don't see a child theme or plugin, go to Appearance > Cutomize > Additional CSS, add the CSS below and "Publish" to save the changes: body.archive.category #main .generate-columns.grid-50{ width:auto; } That should do it, but if it doesn't let me know.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -1, "tags": "wordpress" }
Can I avoid using live Firebase Storage when using emulators? as I patiently wait for Firebase storage to be added to the emulators, I was wondering if there is a way I can avoid modifying live storage files and folders when running hosting / functions in the emulator? For example I use the following code to delete all the files in a folder. Last night someone accidentally deleted all the documents in our emulator as part of a test and it deleted all the LIVE storage folders as we use an import of real documents into our emulator async function deleteStorageFolder(path:string) { const bucket = admin.storage().bucket(); return bucket.deleteFiles({ prefix: path }) Is there any way I can tell firebase to avoid using the production storage APIs when emulators are running?
I have used the following condition in my function to prevent using firebase storage API when running in emulator: if (process.env.FUNCTIONS_EMULATOR == "true") { console.log(`Running in emulator, won't call firebase storage`) } else { // Code goes here to run storage APIs }
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "node.js, firebase, google cloud functions, firebase storage" }
non-jquery css animation on page-load and page-unload/exit-page Is there **a non-jquery way** to have a purely css based animation run on page load and another animation run on page-unload/exit-page?
Animations on load can be done with css alone, but for animations on click I think you'll need a little jQuery. Are you looking for something like this? -jsFiddle $('#container').click(function () { $('#container').fadeOut(); $('#quote1').fadeIn().addClass('bounceInLeft'); }); $('#quote1').click(function () { $('#quote1').fadeOut(); $('#quote2').fadeIn().addClass('bounceInRight'); }); You Can also do hover triggered animations in css alone. To connect two or more elements I think that they have to be nested. As in hover over parent, animate child.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -1, "tags": "css, animation" }
Is "influence of stg on stg" equal to "influence on stg of stg"? Can we say "It shows how strong is the influence on children of tv " instead of "It shows how strong is the influence of tv on children"?
You can swap the order, but it is unusual. “Influence of stg on stg” is much more common.
stackexchange-english
{ "answer_score": 0, "question_score": 0, "tags": "word order" }
Can we prove, without invoking invariance of domain, that $\mathbb R$ and $\mathbb R^2$ are not homeomorphic? Can we prove, without invoking invariance of domain, that $\mathbb R$ and $\mathbb R^2$ are not homeomorphic, or equivalently, that no open set of $\mathbb R$ is homeomorphic to an open set of $\mathbb R^2$?
Sure. If they were, then $\mathbb{R}\setminus\\{0\\}$ and $\mathbb{R}^2\setminus\\{(0, 0)\\}$ would be homeomorphic. This is a contradiction as $\mathbb{R}^2\setminus\\{(0, 0)\\}$ is connected but $\mathbb{R}\setminus\\{0\\}$ is not.
stackexchange-math
{ "answer_score": 4, "question_score": 0, "tags": "general topology, metric spaces, continuity" }
Draw Another Border in line on Canvas I have problem. I need draw another border in my canvas. If I try this: c2.beginPath(); c2.moveTo(0, 0); c2.lineTo(0, 100); c2.lineWidth = Number(sw) + 6; c2.strokeStyle = "red"; c2.stroke(); c2.lineTo(100, 100); c2.lineWidth = Number(sw) + 6; c2.strokeStyle = "#00ec11"; c2.stroke(); c2.lineTo(0, 100); c2.lineWidth = Number(ss) + 6; c2.strokeStyle = "red"; c2.stroke(); c2.closePath(); c2.lineWidth = Number(sw) + 6; c2.strokeStyle = "#00ec11"; c2.stroke(); c2.fill(); it is not working because all line have green border. Can you help me? \--- Edit: I can;t close patch when close my line bacouse this line draw shape. When i close patch my shape isn't correct. Mayby another ideas?
`c2.stroke();` redraws the whole path up to that point with the current strokeStyle. So in the end, only the last style will be applied. Try adding `c2.closePath();` followed by `c2.beginPath()` after each `c2.stroke()` to begin a new path which can have a separate strokeStyle. for example: c2.lineTo(0, 100); c2.lineWidth = Number(sw) + 6; c2.strokeStyle = "red"; c2.stroke(); c2.closePath(); c2.beginPath(); c2.moveTo(0, 100); c2.lineTo(100, 100); c2.lineWidth = Number(sw) + 6; c2.strokeStyle = "#00ec11"; c2.stroke(); c2.closePath(); . . .
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "javascript, css, canvas, border, stroke" }
How to introduce a variable in a Markup function in Flask I am writing a python flask function that uses a flash() to give a user an opportunity to undo an action. I am trying to present a variable "task_id" within a Markup(). This variable is defined earlier in the function before the flash is called. I am trying to assign a data-* attribute the value of this variable, but it is not working. flash(task_name + " was marked complete " + Markup('<a href="#" class="toggle_task" data-task_id=task_id>UNDO</a>')) I also tried using jinja syntax, like {{task_id}} but this does not work either. How can I pass a variable into the Markup()?
Try this: flash(task_name + " was marked complete " + Markup('<a href="#" class="toggle_task" data-task_id={}>UNDO</a>'.format(task_id)))
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "python 3.x" }
GDPR compliant multitenant MYSQL DB I wonder what are the GDPR constraint on a MySQL DB for a multitenant SaaS application. While a solution with a single DB per each multitenant customer and restricted access will probably be fine, what about a single DB? How do I guarantee a proper insulation of data for single tenants? Pure applicative solutions seems weak to me (...where tenantID=xx for each query). Will I be forced to create restricted views on each table or for most queries? How well will MySQL 6.7 handle this? I've read about indexing views and performance, I'm not sure what will happen to my application if I switch every table to a view. Have new versions of MySQL improved? Should I use a db proxy like MaxScale? Or maybe it's reason enough to switch to postgres or other db?
Regardless of how you solve the problem, you have to go through some sort of "router". And that may be the least secure part. Separate computer for each customer -- you need to tell user which machine to go to. Separate process or API or VM on same machine -- user must log into the appropriate path. Separate databases (one per customer) on single MySQL server -- either API or MySQL could handle security. Single database, but separate rows in the tables -- Now the API must take responsibility for security. That is, the user must not have direct access to MySQL, only indirect through an API layer. Each has "privacy by design".
stackexchange-dba
{ "answer_score": 3, "question_score": 1, "tags": "mysql, multi tenant" }
Circuit analysis of partial circuit I want to analyze the cutoff frequencies, order and Qs of filters inside a complicated electronic circuit. Instead of solving equations, as a rookie I find using SPICE a lot easier. However, the results so far don't speak for themselves, for example take the band-pass filter: ![Circuit]( After connecting the IN and OUT to an AC battery and then running a SPICE simulation in order to graph the frequency and phase response, the results aren't even indicative of a band-pass filter. What needs to be done in order to make the approach work?
Here is how you would set this up in LTspice. Click for full-size. ![Filter Response]( Note, 0.0047 for C1 and C2 is ambiguous - is that micro-farads? So 4.7nF? I'm assuming so. You have to look at the LT1007 Datasheet to determine it's properties (is it rail-to-rail, can it operate with the negative supply grounded or do you need to supply it with + and - voltages?, etc.) This part is NOT a rail-to-rail opamp, so must be supplied with +/- voltages, because it's output cannot swing all the way to the power rail voltages. Design the circuit, press "Run" button, choose AC Sweep, set ranges.
stackexchange-electronics
{ "answer_score": 0, "question_score": 0, "tags": "filter, ltspice" }
java: Method cannot be resolved to a type I am trying to use the `.getClass()` method in java to mimic the `getattr` method of python to find a method with the same name as a input string "methodName", but I am getting an error saying > Method cannot be resolved as a type Here is the code: Method func = exampleObject.getClass().getMethod("methodName", Object[].class); func.invoke(exampleObject, args);
Looks like you forget the import for "Method"? import java.lang.reflect.Method;
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "java" }
Express.js and Angular.js html5mode (Avoiding # in url) I have been working on avoiding # in Angular app with ExpressJS serverside. I have researched how to enable html5mode and it worked great. But whenever there is another 'get' request to retrieve data from another url such as /api/services, it seems like somehow broken and do not provide data properly to the page. Here's what I have done in express end. router.get('/*', function (req, res, next) { res.render('index'); }); router.get('/api/service-edit', function (req, res, next) { Service.find(function (err, services) { if (err) {return next(err);} res.json(services); }); }); I am not 100% sure, but what I guess is '/*' causes a problem for the server in reading api urls. I am wondering if any of you have an experience in this problem and a solution to figure this out. Thank you for your time.
In expressjs the routing rules are matched in the order you present them in the code. So the '/*' rule is always matched first and the second rule is never reached. Putting the second rule before the first one will probably solve the problem. Hope it helps.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "javascript, angularjs, node.js, express, html5mode" }
For any constant $a>0$ and strictly increasing function $h$ s.t. $h(a)>0$. $P\{Y \geq a\} \leq \frac{E[h(Y)]}{h(a)} $ For any constant $a>0$ and strictly increasing function $h$ s.t. $h(a)>0$. $P\\{Y \geq a\\} \leq \frac{E[h(Y)]}{h(a)} $ I am having trouble figuring out how to start this problem. I was thinking to start with $$P\\{Y \geq a\\} = 1 - P\\{Y < a\\} $$ and the definition of expectation on $E[h(Y)]$. But do not know how to go from there or whether this approach is right.
Note that $Y \geq a \Longleftrightarrow h(Y) \geq h(a)$ since $h$ is increasing. Then apply Markov's inequality.
stackexchange-math
{ "answer_score": 2, "question_score": 0, "tags": "probability, statistics" }