qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
2,038,376
Our company just completed a Win 32 Application project, and we have a executable program and it works fine in Windows. Now we have to run it as a windows service under Network account. I am pretty new to Windows Service, so please advice, what should I do to transform this program to a Windows Service? Thank you!
2010/01/10
[ "https://Stackoverflow.com/questions/2038376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234935/" ]
If by "Win32 Application project" you mean "GUI program", then do **not** run that as a service. Otherwise, here's what you need to do: * Register a service control handler using [RegisterServiceCtrlHandler](http://msdn.microsoft.com/en-us/library/ms685054%28VS.85%29.aspx) as soon as your program starts. This is requi...
If you mean that you want to run your application as a windows service, there is a utility in Windows Resource Kits. It's name is srvany.exe and you can find documentation about it here: <http://search.microsoft.com/search/results.aspx?st=b&View=en-us&s=1&c=0&qu=137890> Srvany.exe can be downloaded as part of Windows ...
2,038,376
Our company just completed a Win 32 Application project, and we have a executable program and it works fine in Windows. Now we have to run it as a windows service under Network account. I am pretty new to Windows Service, so please advice, what should I do to transform this program to a Windows Service? Thank you!
2010/01/10
[ "https://Stackoverflow.com/questions/2038376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234935/" ]
If you mean that you want to run your application as a windows service, there is a utility in Windows Resource Kits. It's name is srvany.exe and you can find documentation about it here: <http://search.microsoft.com/search/results.aspx?st=b&View=en-us&s=1&c=0&qu=137890> Srvany.exe can be downloaded as part of Windows ...
Srvany.exe is a fine, free solution (as described by alemjerus), but please check out [AlwaysUp](http://www.coretechnologies.com/products/AlwaysUp/) if you are working in a professional environment and need a robust/advanced feature set. Good luck!
2,038,376
Our company just completed a Win 32 Application project, and we have a executable program and it works fine in Windows. Now we have to run it as a windows service under Network account. I am pretty new to Windows Service, so please advice, what should I do to transform this program to a Windows Service? Thank you!
2010/01/10
[ "https://Stackoverflow.com/questions/2038376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234935/" ]
If by "Win32 Application project" you mean "GUI program", then do **not** run that as a service. Otherwise, here's what you need to do: * Register a service control handler using [RegisterServiceCtrlHandler](http://msdn.microsoft.com/en-us/library/ms685054%28VS.85%29.aspx) as soon as your program starts. This is requi...
Srvany.exe is a fine, free solution (as described by alemjerus), but please check out [AlwaysUp](http://www.coretechnologies.com/products/AlwaysUp/) if you are working in a professional environment and need a robust/advanced feature set. Good luck!
60,024,530
I'm working on to compute the average of x records and I don't want to include the last one (the record where I trigger the action).I can trigger the action in existing record or in a new one (not yet in database). Here is my code: ``` @api.one @api.depends('stc') def _compute_average_gross(self): if self.stc: ...
2020/02/02
[ "https://Stackoverflow.com/questions/60024530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10894916/" ]
To check if record is not saved in database do this: ```py if isinstance(self.id, models.NewId): # record is not saved in database. # do your logic # record is saved in databse if not isinstance(self.id, models.NewId): # .... ```
for all who are coming to this after the accepted answer: the correct solution should be this ``` if isinstance(self.id, models.NewId) and not self._origin: # record is not saved in database. # do your logic # record is saved in databse if not isinstance(self.id, models.NewId) or self._origin: # .... ...
255,409
When writing, you can substitute the definition of a word for a word and still make a correct (if more complicated) sentence. Does that make the definition of a word a synonym for the actual word itself? By the same logic, are words basically variables in a mathematical equation? Is: 3 + Y = 4 Y = 1 The same as say...
2015/06/27
[ "https://english.stackexchange.com/questions/255409", "https://english.stackexchange.com", "https://english.stackexchange.com/users/126928/" ]
That would be more of an **appositive** than a synonym. > > **Apposition** is a grammatical construction in which two elements, normally noun phrases, are placed side by side, with one element serving to identify the other in a different way. The two elements are said to be in **apposition**. One of the elements is c...
**Footnote:** Very rarely, the definition will be a single word; and then it becomes a synonym. > > Today I saw a **spadger** playing snow-angels in the seed-bed. > > Today > I saw a sparrow playing snow-angels in the seed-bed. > > > Wild **mallard** came into the lake in the evening. > > Wild ducks came ...
72,517,070
I'm trying to dynamically assign Elements for my GRID in XAML with the use of Objects. However the method in Grid that allows to SetRows or Column does not work. The code is as followed: [![enter image description here](https://i.stack.imgur.com/ntomv.png)](https://i.stack.imgur.com/ntomv.png) The error i receive is...
2022/06/06
[ "https://Stackoverflow.com/questions/72517070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537619/" ]
You can not set the Row or Column of a Grid by using SetColumn or SetRow you have to do it like this: ``` _grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); _grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); _grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLe...
> > SetColumn, SetRow, SetColumnSpan are not working for me in UWP > > > Please refer to Grid [document](https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.grid.setcolumn?view=winrt-22621) `SetColumn, SetRow, SetColumnSpan` are static method, so you can not use *grid instance* to call such method. ...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not necessarily a bad idea to allocate memory in a function. You just have to be sure to clean it up appropriately. The problem is that you might lose the ability to do that once you leave function scope. Just be careful with your design. Match up malloc with free every time and you won't have memory leaks.
There are certain patterns to manage memory: 1. to allocate the memory inside of the function, free it outside when it outlives due time 2. to hold the pointer in the function where malloc is called, and free it after it is expired, as joveha said. Keep consistency in mind, or else it will easily lead to a memory lea...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
This question is easiest to answer if we reverse it: * Why might it be a good idea if every object `malloc`'d in a function is also `free`d in that same function? The answer is, *there will be no memory leaks or dangling pointers*, and this valuable outcome is achieved **without cooperation of any other function**. A...
Here is a code that work with malloc in a function. ``` #include <stdlib.h> #include <stdio.h> void CopyString(char *src,char *dst) { int cpt=0; while(*src!='\0') { dst[cpt]=*src; src++; cpt++; } dst[cpt]='\0'; } char * MallocnFree() { char *NewChar; char String[128...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not a "bad idea", but rather "sometimes a bad idea", which can be said about many ideas in programming. Allocating memory inside a function and releasing it outside may be a common design pattern, by the way. Consider: ``` // hashtable is a typedef-ed pointer type hashtable ht = hashtable_new(); // .. do somethi...
It's not a bad idea if you just keep it consistent in your own style. A good approach is to pass the allocated memory to the caller that can then free it when its done. Something like this: ``` void my_new(char **obj) { *obj = malloc(somesize); } ``` and then call this from your function like this: ``` char *o...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not necessarily a bad idea to allocate memory in a function. You just have to be sure to clean it up appropriately. The problem is that you might lose the ability to do that once you leave function scope. Just be careful with your design. Match up malloc with free every time and you won't have memory leaks.
Here is a code that work with malloc in a function. ``` #include <stdlib.h> #include <stdio.h> void CopyString(char *src,char *dst) { int cpt=0; while(*src!='\0') { dst[cpt]=*src; src++; cpt++; } dst[cpt]='\0'; } char * MallocnFree() { char *NewChar; char String[128...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not a "bad idea", but rather "sometimes a bad idea", which can be said about many ideas in programming. Allocating memory inside a function and releasing it outside may be a common design pattern, by the way. Consider: ``` // hashtable is a typedef-ed pointer type hashtable ht = hashtable_new(); // .. do somethi...
Here is a code that work with malloc in a function. ``` #include <stdlib.h> #include <stdio.h> void CopyString(char *src,char *dst) { int cpt=0; while(*src!='\0') { dst[cpt]=*src; src++; cpt++; } dst[cpt]='\0'; } char * MallocnFree() { char *NewChar; char String[128...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
There are certain patterns to manage memory: 1. to allocate the memory inside of the function, free it outside when it outlives due time 2. to hold the pointer in the function where malloc is called, and free it after it is expired, as joveha said. Keep consistency in mind, or else it will easily lead to a memory lea...
Here is a code that work with malloc in a function. ``` #include <stdlib.h> #include <stdio.h> void CopyString(char *src,char *dst) { int cpt=0; while(*src!='\0') { dst[cpt]=*src; src++; cpt++; } dst[cpt]='\0'; } char * MallocnFree() { char *NewChar; char String[128...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not a "bad idea", but rather "sometimes a bad idea", which can be said about many ideas in programming. Allocating memory inside a function and releasing it outside may be a common design pattern, by the way. Consider: ``` // hashtable is a typedef-ed pointer type hashtable ht = hashtable_new(); // .. do somethi...
It's not necessarily a bad idea to allocate memory in a function. You just have to be sure to clean it up appropriately. The problem is that you might lose the ability to do that once you leave function scope. Just be careful with your design. Match up malloc with free every time and you won't have memory leaks.
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
This question is easiest to answer if we reverse it: * Why might it be a good idea if every object `malloc`'d in a function is also `free`d in that same function? The answer is, *there will be no memory leaks or dangling pointers*, and this valuable outcome is achieved **without cooperation of any other function**. A...
It's not necessarily a bad idea to allocate memory in a function. You just have to be sure to clean it up appropriately. The problem is that you might lose the ability to do that once you leave function scope. Just be careful with your design. Match up malloc with free every time and you won't have memory leaks.
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not a bad idea if you just keep it consistent in your own style. A good approach is to pass the allocated memory to the caller that can then free it when its done. Something like this: ``` void my_new(char **obj) { *obj = malloc(somesize); } ``` and then call this from your function like this: ``` char *o...
There are certain patterns to manage memory: 1. to allocate the memory inside of the function, free it outside when it outlives due time 2. to hold the pointer in the function where malloc is called, and free it after it is expired, as joveha said. Keep consistency in mind, or else it will easily lead to a memory lea...
2,549,981
if this is a bad idea, how to allocate memory in the function?
2010/03/31
[ "https://Stackoverflow.com/questions/2549981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233254/" ]
It's not a bad idea if you just keep it consistent in your own style. A good approach is to pass the allocated memory to the caller that can then free it when its done. Something like this: ``` void my_new(char **obj) { *obj = malloc(somesize); } ``` and then call this from your function like this: ``` char *o...
Here is a code that work with malloc in a function. ``` #include <stdlib.h> #include <stdio.h> void CopyString(char *src,char *dst) { int cpt=0; while(*src!='\0') { dst[cpt]=*src; src++; cpt++; } dst[cpt]='\0'; } char * MallocnFree() { char *NewChar; char String[128...
29,490,676
I am trying to rotate a div using an onclick function with js but when I click my button nothing happens. Any suggestions? I want to be able to keep clicking the button for a 90 degree rotation, not just once. ``` <html> <form action="#" method="post"> <input type="url" name="imglink" id="imglink" placeho...
2015/04/07
[ "https://Stackoverflow.com/questions/29490676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3406488/" ]
I was able to do achieve my goal using the following code below. It's not perfect since I have yet to deal with the overlapping issue, but it does rotate the picture (within the div) which is really all I wanted. Special thanks to user Asgu for helping me solve this issue here <http://tinyurl.com/qezs3yk>. You CAN rota...
You can't do this with just javascript, unless you're using a `<canvas>`. You have to set the CSS properties like this: ``` -ms-transform: rotate(7deg); /* IE 9 */ -webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */ transform: rotate(7deg); ``` So maybe something like this: ``` document.getElementById('pho...
29,490,676
I am trying to rotate a div using an onclick function with js but when I click my button nothing happens. Any suggestions? I want to be able to keep clicking the button for a 90 degree rotation, not just once. ``` <html> <form action="#" method="post"> <input type="url" name="imglink" id="imglink" placeho...
2015/04/07
[ "https://Stackoverflow.com/questions/29490676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3406488/" ]
I was able to do achieve my goal using the following code below. It's not perfect since I have yet to deal with the overlapping issue, but it does rotate the picture (within the div) which is really all I wanted. Special thanks to user Asgu for helping me solve this issue here <http://tinyurl.com/qezs3yk>. You CAN rota...
You must have canvs with img inside and then apply rotation to canvas or you can do it with CSS transform: rotate(?deg)
11,805
This is [HtDP Excercise 12.4.2](http://htdp.org/2003-09-26/Book/curriculum-Z-H-16.html#node_sec_12.4): > > Develop a function insert-everywhere. It consumes a symbol and a list > of words. The result is a list of words like its second argument, but > with the first argument inserted between all letters and at the >...
2012/05/16
[ "https://codereview.stackexchange.com/questions/11805", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13483/" ]
Check [this Stack Overflow question](https://stackoverflow.com/questions/20125784/insert-everywhere-procedure/) out, which has a solution to the same problem. A simplified version would look like this ``` (define (insert-at pos elmt lst) (if (empty? lst) (list elmt) (if (= 1 pos) (cons elmt lst) (cons (first lst...
Inserting an element into a list at some index is not really idiomatic in Lisp-like languages. With proper use of recursion, indexing is not necessary at all, and the solution is much simpler. ``` (define (insert-everywhere sym los) (define (prepend a) (lambda (as) (cons a as))) (if (empty? los) (list (li...
36,006
> > 昨天我有过敏反应了, 所以,现在我不吃西瓜了。 > > > I asked whether this sounded unnatural or not and was voted as 'a little unnatural'. And was answered with this; > > 昨天我吃完西瓜有过敏反应、所以我现在不吃西瓜了。 > > > Is the first form acceptable **grammatically** (even though it sounds better the other way) or is the grammar wrong as well? ...
2019/12/09
[ "https://chinese.stackexchange.com/questions/36006", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/23224/" ]
> > 昨天我有过敏反应了, 所以,现在我不吃西瓜了。 > > > Your sentence is grammatical. However, you haven't explicitly said to what you have your allergy. It's not something with grammar though. To be clear and concise, you could say: 我昨天吃西瓜过敏了,现在不能再吃了。 The reason why 了 is not needed at the end of 昨天我吃完西瓜有过敏反应 is that 有 already denotes...
You were minded to say -- you had an allergic reaction after eating watermelon and so decided to stop eating it. But your original sentence ended up saying -- you had an allergic reaction of some kind and so stopped eating watermelon; thus giving the impression that the allergic reaction was not necessarily due to ea...
36,006
> > 昨天我有过敏反应了, 所以,现在我不吃西瓜了。 > > > I asked whether this sounded unnatural or not and was voted as 'a little unnatural'. And was answered with this; > > 昨天我吃完西瓜有过敏反应、所以我现在不吃西瓜了。 > > > Is the first form acceptable **grammatically** (even though it sounds better the other way) or is the grammar wrong as well? ...
2019/12/09
[ "https://chinese.stackexchange.com/questions/36006", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/23224/" ]
> > 昨天我有过敏反应了, 所以,现在我不吃西瓜了。 > > > Your sentence is grammatical. However, you haven't explicitly said to what you have your allergy. It's not something with grammar though. To be clear and concise, you could say: 我昨天吃西瓜过敏了,现在不能再吃了。 The reason why 了 is not needed at the end of 昨天我吃完西瓜有过敏反应 is that 有 already denotes...
我昨天吃完西瓜后有过敏反应,所以现在不吃西瓜。 Yet for me, in daily life I would just say: 昨天吃完西瓜过敏,今天不吃了。
36,006
> > 昨天我有过敏反应了, 所以,现在我不吃西瓜了。 > > > I asked whether this sounded unnatural or not and was voted as 'a little unnatural'. And was answered with this; > > 昨天我吃完西瓜有过敏反应、所以我现在不吃西瓜了。 > > > Is the first form acceptable **grammatically** (even though it sounds better the other way) or is the grammar wrong as well? ...
2019/12/09
[ "https://chinese.stackexchange.com/questions/36006", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/23224/" ]
我昨天吃完西瓜后有过敏反应,所以现在不吃西瓜。 Yet for me, in daily life I would just say: 昨天吃完西瓜过敏,今天不吃了。
You were minded to say -- you had an allergic reaction after eating watermelon and so decided to stop eating it. But your original sentence ended up saying -- you had an allergic reaction of some kind and so stopped eating watermelon; thus giving the impression that the allergic reaction was not necessarily due to ea...
36,425,719
I'm attempting to save the output of a stored procedure into a temporary table or a table variable using various methods I've found. I've tried declaring a temp table and then doing: ``` INSERT INTO #temptable EXEC storedprocedurename ``` I'm running into an issue, because the stored procedure has around 550 colu...
2016/04/05
[ "https://Stackoverflow.com/questions/36425719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4970827/" ]
I can't find a way to insert only some of the columns in `INSERT ... EXEC` statement. It means that temp table should have all 550 columns. But, you can try to avoid inserting all returned data into those columns. First option. `INSTEAD OF` trigger. I never used one, so I'm not sure if it will work with temp tables. ...
You can use cursor for the data to sent to temp table with the limit number of cols till it reach its end. May this affects the performance.
36,425,719
I'm attempting to save the output of a stored procedure into a temporary table or a table variable using various methods I've found. I've tried declaring a temp table and then doing: ``` INSERT INTO #temptable EXEC storedprocedurename ``` I'm running into an issue, because the stored procedure has around 550 colu...
2016/04/05
[ "https://Stackoverflow.com/questions/36425719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4970827/" ]
Have you tried [OPENQUERY](https://msdn.microsoft.com/en-us/library/ms188427.aspx)? I do not believe it has the same requirements as `OPENROWSET`. You would create a "loopback" Linked Server and use that in the call to `OPENQUERY`. There are some restrictions on `OPENQUERY`, though, in that it does not like Dynamic SQL...
You can use cursor for the data to sent to temp table with the limit number of cols till it reach its end. May this affects the performance.
36,425,719
I'm attempting to save the output of a stored procedure into a temporary table or a table variable using various methods I've found. I've tried declaring a temp table and then doing: ``` INSERT INTO #temptable EXEC storedprocedurename ``` I'm running into an issue, because the stored procedure has around 550 colu...
2016/04/05
[ "https://Stackoverflow.com/questions/36425719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4970827/" ]
Have you tried [OPENQUERY](https://msdn.microsoft.com/en-us/library/ms188427.aspx)? I do not believe it has the same requirements as `OPENROWSET`. You would create a "loopback" Linked Server and use that in the call to `OPENQUERY`. There are some restrictions on `OPENQUERY`, though, in that it does not like Dynamic SQL...
I can't find a way to insert only some of the columns in `INSERT ... EXEC` statement. It means that temp table should have all 550 columns. But, you can try to avoid inserting all returned data into those columns. First option. `INSTEAD OF` trigger. I never used one, so I'm not sure if it will work with temp tables. ...
2,789,398
I am tying to join the following 2 queries but I am having duplicated .... it is possible to remove duplacted fro this: ``` ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_activity_id_fk =14 ...
2010/05/07
[ "https://Stackoverflow.com/questions/2789398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/164497/" ]
If I understand you correctly, a simple `GROUP BY`, witholding only the maxium subscription types should do the trick. ``` SELECT dupAlias.bar_id , dupAlias.bar_name , dupAlias.town_name , dupAlias.bar_telephone , MAX(dupAlias.subscription_type_id) AS subscription_type_id FROM ( ...
The fastest way would be to use a temp table. And them from there you could do insert the first query into the temp table and then only insert those rows you want from the second query that aren't in the temp table either by using an outer join to the temp table or by using a not in statement. Or you could insert all o...
2,789,398
I am tying to join the following 2 queries but I am having duplicated .... it is possible to remove duplacted fro this: ``` ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_activity_id_fk =14 ...
2010/05/07
[ "https://Stackoverflow.com/questions/2789398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/164497/" ]
You can bracket your query: ``` SELECT bar_id, bar_name, town_name, bar_telephone, max(subscription_type_id) FROM ( ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_ac...
The fastest way would be to use a temp table. And them from there you could do insert the first query into the temp table and then only insert those rows you want from the second query that aren't in the temp table either by using an outer join to the temp table or by using a not in statement. Or you could insert all o...
2,789,398
I am tying to join the following 2 queries but I am having duplicated .... it is possible to remove duplacted fro this: ``` ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_activity_id_fk =14 ...
2010/05/07
[ "https://Stackoverflow.com/questions/2789398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/164497/" ]
If I understand you correctly, a simple `GROUP BY`, witholding only the maxium subscription types should do the trick. ``` SELECT dupAlias.bar_id , dupAlias.bar_name , dupAlias.town_name , dupAlias.bar_telephone , MAX(dupAlias.subscription_type_id) AS subscription_type_id FROM ( ...
You can bracket your query: ``` SELECT bar_id, bar_name, town_name, bar_telephone, max(subscription_type_id) FROM ( ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_ac...
388,109
I have a number of [solenoids](https://www.ebay.com/itm/Solenoid-electric-solenoid-type-push-pull-10-mm-DC-12-V-2-1-kg-force-R1F8/332189541393?epid=785586878&hash=item4d580a2411%3Ag%3AoVAAAOSwhztbH4HR&_sacat=0&_nkw=Solenoid%20electric%20solenoid%20type%20push%20%2F%20pull%2010%20mm%20DC%2012%20V%202.1%20kg%20force%20R1...
2018/07/27
[ "https://electronics.stackexchange.com/questions/388109", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/99352/" ]
It's choke, a.k.a. an inductor. The nameplate says 125mH 6A. From inspecting the wiring, only two power wires go to the spindle, so it's single-phase and the inductor is in series. Its purpose is to limit the current that can flow to the spindle motor; this limits the torque the spindle motor can develop. It also muc...
It is also translated as [choke](https://en.wikipedia.org/wiki/Choke_(electronics)). If your motor is 3-phase then this is most likely used to create phase-shift. Kinda ad-hoc starter for asynchronous motor. [![enter image description here](https://i.stack.imgur.com/hnhgP.png)](https://i.stack.imgur.com/hnhgP.png)
388,109
I have a number of [solenoids](https://www.ebay.com/itm/Solenoid-electric-solenoid-type-push-pull-10-mm-DC-12-V-2-1-kg-force-R1F8/332189541393?epid=785586878&hash=item4d580a2411%3Ag%3AoVAAAOSwhztbH4HR&_sacat=0&_nkw=Solenoid%20electric%20solenoid%20type%20push%20%2F%20pull%2010%20mm%20DC%2012%20V%202.1%20kg%20force%20R1...
2018/07/27
[ "https://electronics.stackexchange.com/questions/388109", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/99352/" ]
It's choke, a.k.a. an inductor. The nameplate says 125mH 6A. From inspecting the wiring, only two power wires go to the spindle, so it's single-phase and the inductor is in series. Its purpose is to limit the current that can flow to the spindle motor; this limits the torque the spindle motor can develop. It also muc...
This kind of "drossels" or chokes have been used in massive C-L-C filters after standard AC rectification in old power supplies for tube-based equipment, to filter out 100 (or 120) Hz component in power rail. At that time (60-th and 70-th) there were no affordable means (linear stabilizers) for high-power supplies, so ...
27,434,238
So I have 3 objects in my project right now: ``` _vLabel.hidden = YES; _wLabel.hidden = YES; _nextButton.hidden = YES; ``` As you can see I do the `.hidden` thing for all of them . Is there a way of creating variable or something with which I would only have to apply it instead writing the whole line, like: ``` _vL...
2014/12/11
[ "https://Stackoverflow.com/questions/27434238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3397217/" ]
It seems silly to do it, as you should just follow the convention that any other iOS programmer expects and understands, but yes you can do it: ``` UIView+MyCategory.h: @interface UIView (MyCategory) -(void) hide; @end UIView+MyCategory.m: @implementation UIView (MyCategory) -(void) hide { [self setHidden:YES...
Hmm, if your only problem is that writing `label.hidden = YES;` is too long then why don´t you just use code snippets? That way you keep using the naming conventions with less writing. You can even use Xcode to create these snippets. Just select the text and drag it from the edge(this part can be pretty tricky) to the...
27,434,238
So I have 3 objects in my project right now: ``` _vLabel.hidden = YES; _wLabel.hidden = YES; _nextButton.hidden = YES; ``` As you can see I do the `.hidden` thing for all of them . Is there a way of creating variable or something with which I would only have to apply it instead writing the whole line, like: ``` _vL...
2014/12/11
[ "https://Stackoverflow.com/questions/27434238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3397217/" ]
I find the question unclear. What would be a "shortcut" in this situation? How can you get any "shorter" than this: ``` _vLabel.hidden = YES; _wLabel.hidden = YES; _nextButton.hidden = YES; ``` To me, the "length" here - the thing that needs shortening - is that you're doing something three times instead of once. If...
Hmm, if your only problem is that writing `label.hidden = YES;` is too long then why don´t you just use code snippets? That way you keep using the naming conventions with less writing. You can even use Xcode to create these snippets. Just select the text and drag it from the edge(this part can be pretty tricky) to the...
44,191,406
So I want to use the Instagram API to get a specific user's (NOT MY USER) recent media. Instagram has the following endpoint for doing so: ``` (GET) https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN ``` This is a problem because I do not have the user's ID (*why would I, Instagram?...
2017/05/25
[ "https://Stackoverflow.com/questions/44191406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569739/" ]
I couldn't find anything in the API that gets a username's media. However, by using the search endpoint, you can come up with a solution to get a user's media. Since you're using PHP cURL, you could do something like this: ``` //this is what was returned by cURL $response = /*what was returned by the API - see below*...
you can **find user id !!!** like this : ``` <html> <head> <script src="jquery.js" type="text/javascript" ></script> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ type: 'GET', url: 'https://api.instagram.com/v1/users/self/?access_token=' + window.location.hash....
44,191,406
So I want to use the Instagram API to get a specific user's (NOT MY USER) recent media. Instagram has the following endpoint for doing so: ``` (GET) https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN ``` This is a problem because I do not have the user's ID (*why would I, Instagram?...
2017/05/25
[ "https://Stackoverflow.com/questions/44191406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569739/" ]
You can get all of a user's information (including the id) by requesting this URL: ``` https://www.instagram.com/{username}/?__a=1 ``` For example, this gets you all of the information related to the account taylorswift: ``` https://www.instagram.com/taylorswift/?__a=1 ```
you can **find user id !!!** like this : ``` <html> <head> <script src="jquery.js" type="text/javascript" ></script> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ type: 'GET', url: 'https://api.instagram.com/v1/users/self/?access_token=' + window.location.hash....
44,191,406
So I want to use the Instagram API to get a specific user's (NOT MY USER) recent media. Instagram has the following endpoint for doing so: ``` (GET) https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN ``` This is a problem because I do not have the user's ID (*why would I, Instagram?...
2017/05/25
[ "https://Stackoverflow.com/questions/44191406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569739/" ]
You can get all of a user's information (including the id) by requesting this URL: ``` https://www.instagram.com/{username}/?__a=1 ``` For example, this gets you all of the information related to the account taylorswift: ``` https://www.instagram.com/taylorswift/?__a=1 ```
I couldn't find anything in the API that gets a username's media. However, by using the search endpoint, you can come up with a solution to get a user's media. Since you're using PHP cURL, you could do something like this: ``` //this is what was returned by cURL $response = /*what was returned by the API - see below*...
37,443,282
I have been given a set S, of n integers, and have to print the size of a maximal subset S' of S where the sum of any 2 numbers in S' are not evenly divisible by k. **Input Format** The first line contains 2 space-separated integers, n and k, respectively. The second line contains n space-separated integers describi...
2016/05/25
[ "https://Stackoverflow.com/questions/37443282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6347132/" ]
You can solve it in `O(n)` time using the following approach: ``` L = [0]*k for x in a: L[x % k] += 1 res = 0 for i in range(k//2+1): if i == 0 or k == i*2: res += bool(L[i]) else: res += max(L[i], L[k-i]) print(res) ```
``` # given k, n and a as per your input. # Will return 0 directly if n == 1 def maxsize(k, n, a): import itertools while n > 1: sets = itertools.combinations(a, n) for set_ in sets: if all((u+v) % k for (u, v) in itertools.combinations(set_, 2)): return n n -...
37,443,282
I have been given a set S, of n integers, and have to print the size of a maximal subset S' of S where the sum of any 2 numbers in S' are not evenly divisible by k. **Input Format** The first line contains 2 space-separated integers, n and k, respectively. The second line contains n space-separated integers describi...
2016/05/25
[ "https://Stackoverflow.com/questions/37443282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6347132/" ]
``` # given k, n and a as per your input. # Will return 0 directly if n == 1 def maxsize(k, n, a): import itertools while n > 1: sets = itertools.combinations(a, n) for set_ in sets: if all((u+v) % k for (u, v) in itertools.combinations(set_, 2)): return n n -...
Java solution ``` public class Solution { static PrintStream out = System.out; public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner (System.in); int n = in.next...
37,443,282
I have been given a set S, of n integers, and have to print the size of a maximal subset S' of S where the sum of any 2 numbers in S' are not evenly divisible by k. **Input Format** The first line contains 2 space-separated integers, n and k, respectively. The second line contains n space-separated integers describi...
2016/05/25
[ "https://Stackoverflow.com/questions/37443282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6347132/" ]
You can solve it in `O(n)` time using the following approach: ``` L = [0]*k for x in a: L[x % k] += 1 res = 0 for i in range(k//2+1): if i == 0 or k == i*2: res += bool(L[i]) else: res += max(L[i], L[k-i]) print(res) ```
Yes O(n) solution for this problem is very much possible. Like planetp rightly pointed out its pretty much the same solution I have coded in java. Added comments for better understanding. > > import java.io.*; import java.util.*; > > > public class Solution { > > > > ``` > public static void main(String[] args) ...
37,443,282
I have been given a set S, of n integers, and have to print the size of a maximal subset S' of S where the sum of any 2 numbers in S' are not evenly divisible by k. **Input Format** The first line contains 2 space-separated integers, n and k, respectively. The second line contains n space-separated integers describi...
2016/05/25
[ "https://Stackoverflow.com/questions/37443282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6347132/" ]
You can solve it in `O(n)` time using the following approach: ``` L = [0]*k for x in a: L[x % k] += 1 res = 0 for i in range(k//2+1): if i == 0 or k == i*2: res += bool(L[i]) else: res += max(L[i], L[k-i]) print(res) ```
Java solution ``` public class Solution { static PrintStream out = System.out; public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner (System.in); int n = in.next...
37,443,282
I have been given a set S, of n integers, and have to print the size of a maximal subset S' of S where the sum of any 2 numbers in S' are not evenly divisible by k. **Input Format** The first line contains 2 space-separated integers, n and k, respectively. The second line contains n space-separated integers describi...
2016/05/25
[ "https://Stackoverflow.com/questions/37443282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6347132/" ]
Yes O(n) solution for this problem is very much possible. Like planetp rightly pointed out its pretty much the same solution I have coded in java. Added comments for better understanding. > > import java.io.*; import java.util.*; > > > public class Solution { > > > > ``` > public static void main(String[] args) ...
Java solution ``` public class Solution { static PrintStream out = System.out; public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner (System.in); int n = in.next...
51,119,063
I'm not sure what's happening. I created table yesterday in hbase using the following code. I start hbase using this command. `hbase-2.0.0/bin$ ./start-hbase.sh` Code to create table ``` private void createStudentTable(String workspace) { List<ColumnFamilyDescriptor> colms = new ArrayList<>(); colms...
2018/06/30
[ "https://Stackoverflow.com/questions/51119063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2104638/" ]
By default the hbase.rootdir is in /tmp which is cleaned up every time you reboot. Update the hbase-site.xml to use a directory of your choice.
To give an example for @gagan's answer Config File: `/hbase-2.0.0/conf/hbase-site.xml` ``` <configuration> <property> <name>hbase.rootdir</name> <value>file:///home/pasu/apps/hbase-2.0.0</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/pasu/apps/hbase-2.0...
2,369,765
Let $\{f\_k\}\_{k\ge 0}$ be a sequence of continuous and bounded functions $f\_k\colon \mathbb{R}\to \mathbb{R},\ x\mapsto f\_k(x)$, converging pointwise to $f$. Suppose that there exists a sequence of increasing integers $k\_1,k\_2,\dots$ and a corresponding convergent sequence $x\_1,x\_2,\dots$ such that $\displaysty...
2017/07/24
[ "https://math.stackexchange.com/questions/2369765", "https://math.stackexchange.com", "https://math.stackexchange.com/users/85065/" ]
No, consider f.e. the functions $f\_n(x)=x^n$ on $[0,1]$, and $x\_n=1-1/n$. It follows that $x\_n \to x=1$ and $f\_n(x\_n)=(1-1/n)^n \to 1/e$, but $1^n\to 1$. To ensure that the limit of a converging sequence of continuous functions is itself continuous, you need uniform convergence.
If each $f\_k$ is defined on a closed and bounded interval and $(f\_k)$ is uniformly bounded and equicontinuous, then by the Arzela-Ascoli theorem there exists a uniformly convergent subsequence. Under these very restricted conditions the result is true for that subsequence. There are counterexamples where the sequenc...
2,369,765
Let $\{f\_k\}\_{k\ge 0}$ be a sequence of continuous and bounded functions $f\_k\colon \mathbb{R}\to \mathbb{R},\ x\mapsto f\_k(x)$, converging pointwise to $f$. Suppose that there exists a sequence of increasing integers $k\_1,k\_2,\dots$ and a corresponding convergent sequence $x\_1,x\_2,\dots$ such that $\displaysty...
2017/07/24
[ "https://math.stackexchange.com/questions/2369765", "https://math.stackexchange.com", "https://math.stackexchange.com/users/85065/" ]
No, consider f.e. the functions $f\_n(x)=x^n$ on $[0,1]$, and $x\_n=1-1/n$. It follows that $x\_n \to x=1$ and $f\_n(x\_n)=(1-1/n)^n \to 1/e$, but $1^n\to 1$. To ensure that the limit of a converging sequence of continuous functions is itself continuous, you need uniform convergence.
Assuming the limit is continuous changes nothing. Consider the "$n$th hat" $\Lambda\_n:[0,1]→[0,1]$ whose $(x,y)$-graph, drawn not to scale, $$\wedge\text{\_} $$ is made up of 3 straight lines, the first joining $(0,0)$ to $(1/n,1)$ and the second joining $(1/n,1)$ to $(2/n,0)$, and then 0 for $x>2/n$. In symbols, $$...
47,724,728
Scenario : Join Table ORDER with Table COST where COST has multiple rows for a single reference from Table ORDER Desired outcome: Return single row per Order with its associated costs. ``` ID NAME PRICE GST 1 Book 100 10 2 CD 50 5 ``` Ex: Table ORDER ``` ID NAME COST 1 Book 110 2 CD 55 ...
2017/12/09
[ "https://Stackoverflow.com/questions/47724728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2083153/" ]
``` select o.id, o.name, c.price, c.gst from order o left outer join ( select order_id, sum(case when cost_type = 'PRICE' then value end) as price, sum(case when cost_type = 'GST' then value end) as gst from cost group by order_id ) c ...
So `Select ORDER.ID, COST.COST_TYPE, COST.VALUE from ORDERS LEFT OUTER JOIN COST ON ORDER.ID = COST.ORDER_ID and COST.COST_TYPE = 'PRICE'` If you don't specify `COST_TYPE` then it will return multiple rows because `ORDER_ID` repeats on your COST TABLE.
47,724,728
Scenario : Join Table ORDER with Table COST where COST has multiple rows for a single reference from Table ORDER Desired outcome: Return single row per Order with its associated costs. ``` ID NAME PRICE GST 1 Book 100 10 2 CD 50 5 ``` Ex: Table ORDER ``` ID NAME COST 1 Book 110 2 CD 55 ...
2017/12/09
[ "https://Stackoverflow.com/questions/47724728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2083153/" ]
``` select o.id, o.name, c.price, c.gst from order o left outer join ( select order_id, sum(case when cost_type = 'PRICE' then value end) as price, sum(case when cost_type = 'GST' then value end) as gst from cost group by order_id ) c ...
This is what i found working in my case. Had to use 2 LEFT OUTER JOIN's and alias to get it working ``` SELECT ID, NAME, PRICE.value as PRICE, GST.value as GST from ORDER LEFT OUTER JOIN COST as PRICE ON ORDER.ID = COST.ORDER_ID AND PRICE.COST_TYPE = 'PRICE' LEFT OUTER JOIN COST as GST ON ORDER.ID = COST.ORDER_ID ...
1,048,964
I have 280 thousand photos to delete in a folder, but some videos to keep. In the folder, I gave the command: `#rm *.jpg`, but I get "argument list too long". When I create an argument to delete some of the photos, it works on a smaller set, like this: # rm 104-\*.jpg. How can I efficiently delete all the JPEG files i...
2018/06/22
[ "https://askubuntu.com/questions/1048964", "https://askubuntu.com", "https://askubuntu.com/users/139675/" ]
A typical way to handle the “argument list too long” error is via the `find` command: ``` find -maxdepth 1 -mindepth 1 -type f -name "*.jpg" -delete ```
You can use `xargs`: ``` printf '%s\0' *.jpg | xargs -0 rm -- ``` In `bash`, the `printf` command is a built-in and is not subject to the same argument length limitations.
31,225,111
i have a large application where task part is modeling objects and the other part is timeline-backed animation of objects. It may be possible that a user deletes an animateable object while the timeline is still animating it. The timeline accesses (animates) the objects through smart pointers, so it would be perfectly...
2015/07/04
[ "https://Stackoverflow.com/questions/31225111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4366545/" ]
On a mac by default the path is `/Library/Python/2.7/site-packages/foo.egg`. Before doing anything, in terminal, start a new Python session and do ``` import sys print sys.path ``` If the paths are of the form `/Library/Python/2.7/site-packages/foo.egg`, then just follow [link](https://support.enthought.com/hc/en-us...
I found the solution: added to the bash\_profile this line " export PATH="$HOME/canopy/bin:$PATH" ", and uncomment all other lines in bash\_profile.
47,445,451
I am creating a recursive process to import csv data into a table. I can't seem to dynamically insert the variable I need to insert into my http request with my pgsql function. I am trying to insert the variable 'insert\_var' using %L with Execute Format and dynamic sql. When I see the link that the function passes i...
2017/11/22
[ "https://Stackoverflow.com/questions/47445451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7180874/" ]
The short answer: *it depends*. Specifically, it depends on the kinds of operations that you are using in your reducers. If you find yourself frequently creating / modifying complex subtrees of your app's sate tree, you might want to look at libraries that efficiently handle immutability (see [Immutable.js](https://f...
Ideally you're only copying the piece of state that needs to be modified, not an entire large, deeply-nested object. You can read through these links to see discussion points that may be relevant to your implementation/usage. Performance is unlikely to be a real concern if used as designed. [Redux Performance FAQ](htt...
689,599
I Can't find out how to format my usb stick. Have read some guides but can't find **"Format Device"** anywhere. Anyone got the same problem? Or have a solution to my problem? Greatful for all answers. SOULUTION Go to Dash and find the program Disk, open it and Right Click on de device you want to format. Or you can...
2015/10/25
[ "https://askubuntu.com/questions/689599", "https://askubuntu.com", "https://askubuntu.com/users/464756/" ]
Based on [this question](https://askubuntu.com/questions/614422/problem-with-installing-steam-on-ubuntu-15-04), execute the following commands: ``` mv ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1{,.disable} mv ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linu...
Based on Daniel's answer (i don't have the rep to comment!), on a vanilla ubuntu-gnome 15.10 where i've done an 'apt-get install steam' I had to run these modified commands: ``` mv ~/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6{,.disable} mv ~/.steam/steam/ubuntu12_32/steam-runtime...
53,437,475
I want export channel messages to ftp server or external drive. I thing we can export messages via rest API. Could you any one help on this..
2018/11/22
[ "https://Stackoverflow.com/questions/53437475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10692796/" ]
If you want to send messages to a REST API, you can use the `HTTP Sender` destination connector type. [![Setting up HTTP Sender Mirth Destination](https://i.stack.imgur.com/RrDjr.png)](https://i.stack.imgur.com/RrDjr.png) If your REST API Endpoint requires any special headers or authentication, you will need to config...
The `POST /channels/{channelId}/messages/_export` endpoint is to export messages to files on the server filesystem. When the client does an export to the local file system, it basically writes the results of `GET /channels/{channelId}/messages` with one file per message and attachments included. See [Source](https://gi...
20,328
This is from a post in sci.math that did not get a full answer; I may repost it for the OP there: I am interested on the issue I read in another site of when an embedding from a closed set extends into a homeomorphism, i.e., if $C$ is closed in $X$, and $f:C \rightarrow Y$ is an embedding, when can we extend $f$ to $F...
2011/02/04
[ "https://math.stackexchange.com/questions/20328", "https://math.stackexchange.com", "https://math.stackexchange.com/users/6595/" ]
gary, I think your question is too general. For instance, there is something called 'cofibration' in topology, which deals with this type of problem under a strong condition: Namely, $f:A\rightarrow Y$ is continuous and has an extension iff every $g\colon A\rightarrow Y$ satisfies this property where $g$ is homotopic t...
This will never happen unless $C=X$. Consider the identity embedding $C \to C$; by your hypothesis, this extends to a homeomorphism $X \to C$ extending $C \to C$. This is an inverse to the inclusion $C \to X$. Thus $C=X$. ~~In general, this is unlikely. Consider any $Y$ between $X$ and $C$. Then there is an embedding ...
20,328
This is from a post in sci.math that did not get a full answer; I may repost it for the OP there: I am interested on the issue I read in another site of when an embedding from a closed set extends into a homeomorphism, i.e., if $C$ is closed in $X$, and $f:C \rightarrow Y$ is an embedding, when can we extend $f$ to $F...
2011/02/04
[ "https://math.stackexchange.com/questions/20328", "https://math.stackexchange.com", "https://math.stackexchange.com/users/6595/" ]
gary, I think your question is too general. For instance, there is something called 'cofibration' in topology, which deals with this type of problem under a strong condition: Namely, $f:A\rightarrow Y$ is continuous and has an extension iff every $g\colon A\rightarrow Y$ satisfies this property where $g$ is homotopic t...
Thanks both for your comments. I am sorry if I did not make this clear; I don't know if you were assuming this, but the embedding is *into* Y, and not onto it, i.e., we have an embedding e:C-->e(C) , and not e:C-->Y, which, as you said, cannot be 1-1. I can see how my using the identity on C was misleading, sorry; ...
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The console standby for this is `top`, but there are alternatives like my favorite `htop` that give you a little more display flexibility and allow you a few more operations on the processes. A less interactive view that is better for use in scripts would be the `ps` program and all it's relatives. **Edit:** Based on...
You are probably looking for [sysdig](http://www.sysdig.org/wiki/sysdig-examples/) For example: ``` sysdig -A -c echo_fds ```
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
You may want to take a look at `lsof` and `strace`. Sysinternal's Process Monitor is actually Filemon and Regmon combined with a some additional enhancements. The `top` command is more like Process Explorer.
I've not used that Process Monitor, but as far as I can tell it's the same as `gnome-system-monitor` on a Gnome system. If you use KDE they probably have something similar.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The console standby for this is `top`, but there are alternatives like my favorite `htop` that give you a little more display flexibility and allow you a few more operations on the processes. A less interactive view that is better for use in scripts would be the `ps` program and all it's relatives. **Edit:** Based on...
This was just released yesterday: <https://github.com/microsoft/ProcMon-for-Linux>
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
I'm really late for answering this, but I have started a project that aims to do exactly what you're looking for. Have a look at it here: <https://github.com/alexandernst/monks>
dtrace4linux allows you to trace some interesting tidbits of the kernel. Although it appears to be more powerful than sysdig, unfortunately is not so well behaved.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The console standby for this is `top`, but there are alternatives like my favorite `htop` that give you a little more display flexibility and allow you a few more operations on the processes. A less interactive view that is better for use in scripts would be the `ps` program and all it's relatives. **Edit:** Based on...
I've not used that Process Monitor, but as far as I can tell it's the same as `gnome-system-monitor` on a Gnome system. If you use KDE they probably have something similar.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The grandaddy of all process monitors is [`top`](http://en.wikipedia.org/wiki/Top_%28Unix%29), and many system monitoring tools are called `top`. For example, there's [`iotop`](http://guichaz.free.fr/iotop/) to watch disk I/O, [`atop`](http://www.atoptool.nl/) for a bunch of system resources, [`powertop`](http://www.li...
dtrace4linux allows you to trace some interesting tidbits of the kernel. Although it appears to be more powerful than sysdig, unfortunately is not so well behaved.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
You may want to take a look at `lsof` and `strace`. Sysinternal's Process Monitor is actually Filemon and Regmon combined with a some additional enhancements. The `top` command is more like Process Explorer.
This was just released yesterday: <https://github.com/microsoft/ProcMon-for-Linux>
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The grandaddy of all process monitors is [`top`](http://en.wikipedia.org/wiki/Top_%28Unix%29), and many system monitoring tools are called `top`. For example, there's [`iotop`](http://guichaz.free.fr/iotop/) to watch disk I/O, [`atop`](http://www.atoptool.nl/) for a bunch of system resources, [`powertop`](http://www.li...
You may want to take a look at `lsof` and `strace`. Sysinternal's Process Monitor is actually Filemon and Regmon combined with a some additional enhancements. The `top` command is more like Process Explorer.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The console standby for this is `top`, but there are alternatives like my favorite `htop` that give you a little more display flexibility and allow you a few more operations on the processes. A less interactive view that is better for use in scripts would be the `ps` program and all it's relatives. **Edit:** Based on...
dtrace4linux allows you to trace some interesting tidbits of the kernel. Although it appears to be more powerful than sysdig, unfortunately is not so well behaved.
13,555
Is there a Unix/Linux equivalent of [Process Monitor](http://technet.microsoft.com/en-us/sysinternals/bb896645), whether GUI or CUI? If it makes a difference, I'm looking at Ubuntu, but if there's an equivalent for other systems (Mac, other Linux variants like Fedora, etc.) then knowing any of those would be useful to...
2011/05/21
[ "https://unix.stackexchange.com/questions/13555", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6252/" ]
The grandaddy of all process monitors is [`top`](http://en.wikipedia.org/wiki/Top_%28Unix%29), and many system monitoring tools are called `top`. For example, there's [`iotop`](http://guichaz.free.fr/iotop/) to watch disk I/O, [`atop`](http://www.atoptool.nl/) for a bunch of system resources, [`powertop`](http://www.li...
I'm really late for answering this, but I have started a project that aims to do exactly what you're looking for. Have a look at it here: <https://github.com/alexandernst/monks>
73,561,485
hope you all are doing well, I am new to ReactJS and JSX syntax below in the problem I am rendering a table element based on different roles from the same Generic Table component now I have to set onClick attribute's navigation on basis of role and I cannot make a function outside of the scope because I am using the ro...
2022/08/31
[ "https://Stackoverflow.com/questions/73561485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19890455/" ]
Pass a function directly to the `onClick` prop and handle your `if` statement in there. ``` <Button onClick={() => { if (props.heading === "CLEARANCES") { markCleared(row.resignationId) } else if { navigate(`/resignations/${props.role}/action/${row.resignationId}`) } }} variant="outlined"...
Yes you can. **OnClick** gives you an event that you can catch in following way: ``` onclick((e) => { //your code goes here } ```
73,561,485
hope you all are doing well, I am new to ReactJS and JSX syntax below in the problem I am rendering a table element based on different roles from the same Generic Table component now I have to set onClick attribute's navigation on basis of role and I cannot make a function outside of the scope because I am using the ro...
2022/08/31
[ "https://Stackoverflow.com/questions/73561485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19890455/" ]
Pass a function directly to the `onClick` prop and handle your `if` statement in there. ``` <Button onClick={() => { if (props.heading === "CLEARANCES") { markCleared(row.resignationId) } else if { navigate(`/resignations/${props.role}/action/${row.resignationId}`) } }} variant="outlined"...
You can't just insert statements as your onClick prop, you need to pass a function. You can write the entire function into the JSX but that's not recommended and not necessary. You can simply pass any data you need along, like onClick={() => onClick(row)} ``` const onClick = (row) =>{ if (props.heading === "CL...
300,968
We're running Tomcat 6 on an Ubuntu 2GB slice on slicehost.com The JSP application fwiw is Open Clinica 3.1 I implemented SSL pretty much by the book as you can see: ``` <Connector port="8443" scheme="https" SSLEnabled="true" keystorePass="XXXXX" keystoreFile="XXXXX" maxKeepAliveRequ...
2011/08/14
[ "https://serverfault.com/questions/300968", "https://serverfault.com", "https://serverfault.com/users/91576/" ]
SSL handshaking on each resource is a telltale sign that HTTP's [keep-alive](http://en.wikipedia.org/wiki/HTTP_persistent_connection) functionality isn't working. With keep-alive, a single SSL handshake is done for a TCP connection, then multiple resources can be requested via that single connection. Modern browsers l...
I would suggest using an Apache reverse proxy with the AJP connector on the front end. Put the SSL in Apache, and connect to Tomcat in clear-text over a private link (e.g., localhost). Use Apache for what it's good at (web server with lots of fancy options) and Tomcat for what it's good at (Java applications).
300,968
We're running Tomcat 6 on an Ubuntu 2GB slice on slicehost.com The JSP application fwiw is Open Clinica 3.1 I implemented SSL pretty much by the book as you can see: ``` <Connector port="8443" scheme="https" SSLEnabled="true" keystorePass="XXXXX" keystoreFile="XXXXX" maxKeepAliveRequ...
2011/08/14
[ "https://serverfault.com/questions/300968", "https://serverfault.com", "https://serverfault.com/users/91576/" ]
SSL handshaking on each resource is a telltale sign that HTTP's [keep-alive](http://en.wikipedia.org/wiki/HTTP_persistent_connection) functionality isn't working. With keep-alive, a single SSL handshake is done for a TCP connection, then multiple resources can be requested via that single connection. Modern browsers l...
Keep-alive is obviously the biggest gain you will have but if you still need to reduce latency you should check that you are using APR native connector. [http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Connector Comparison](http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Connector%20Comparison)
6,272,904
The communication between Facebook users seem to be stored in one long "conversation." So, emails sent and private chat messages exchanged all seem to be part of one long ongoing conversation. I think this implementation works well for users (at least it does for me). I assume the table design for this part could be i...
2011/06/08
[ "https://Stackoverflow.com/questions/6272904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253976/" ]
I believe a message should be an entity, regardless of platform or sender/receiver, with `id`,`message`,`timestamp` fields, and a message relation table - like you suggested - with `id`,`message_id`,`from_id`,`to_id`. Then, if you are showing a single user to user conversation, you can show every message between them. ...
You could also group messages by topics. You add a topic table. You add a recipients table, tied to a topic. Messages will also be tied to a topic. You can programmatically limit the topics between two users by looking which topic has those two users in its recipients. You could also separate your messages by giving t...
53,446,505
I'm looking the navigation stack of ros and I have a doubt regarding local and global costmaps. What kind of information is stored in each one? For example, if my global planner computes the shortest path among two points of a map, is in the global costmap the distance of each street that the global planner will use fo...
2018/11/23
[ "https://Stackoverflow.com/questions/53446505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5604964/" ]
As far as I know, the difference is simple. * In the global costmap is everything the robot knows from previous visits and stored knowledge e.g. the map. * In the local costmap is everything that can be known from the current position with the sensors right know. E.g. walking people and other moving objects, as well ...
The content is/can be the same, but there are other differences: * resolution * how long is sensor data stored? (The local costmap moves with the robot and discards old data, if falls outside after moving.) * how often is the costmap updated? * what happens if the global or local planner are blocked? * different infla...
46,540,069
I'm using `python 2.7` and I have a list that contains lists. Here is my list: ``` range_list=[['encoding_txt\\pirkagia_10b_192x144_15_qp_26_ON_encoder_randomaccess_B16_Filters_ON_scalable_JOURNAL2017.txt', 26, 35.1782, 136.8125, 300.788, 0.844, -3.5, '192x144'], ['encoding_txt\\pirkagia_10b_192x144_25_qp_26_ON_encod...
2017/10/03
[ "https://Stackoverflow.com/questions/46540069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395874/" ]
You can use a simple list comprehension: ``` [s for s in range_list if '_25_' in s[0]] ``` I have also changed the name of your list since `range` is a function.
``` newlist = [] #renamed the list to rangeVar for i in rangeVar: if '25' in i[0]: newlist.append(i) print newlist ``` output ``` [['encoding_txt\\pirkagia_10b_192x144_25_qp_26_ON_encoder_randomaccess_B16_Filters_ON_scalable_JOURNAL2017.txt', 26, 35.1782, 228.0208, 302.251, 0.962, -2.5, '192x144'], ['en...
46,540,069
I'm using `python 2.7` and I have a list that contains lists. Here is my list: ``` range_list=[['encoding_txt\\pirkagia_10b_192x144_15_qp_26_ON_encoder_randomaccess_B16_Filters_ON_scalable_JOURNAL2017.txt', 26, 35.1782, 136.8125, 300.788, 0.844, -3.5, '192x144'], ['encoding_txt\\pirkagia_10b_192x144_25_qp_26_ON_encod...
2017/10/03
[ "https://Stackoverflow.com/questions/46540069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395874/" ]
You can use a simple list comprehension: ``` [s for s in range_list if '_25_' in s[0]] ``` I have also changed the name of your list since `range` is a function.
Using simple loop : ``` new_list=[] for i in range_1: if '_25_' in i[0]: new_list.append(i) print(new_list) ``` list comprehension : ``` print([i for i in range_1 if '_25_' in i[0]]) ``` > > additional information : > > > list comprehension `new_list=[i for i in range_1]` is same as : ``` new_l...
1,080,594
It is well known that for manifolds without boundary, there exist a domain invariance theorem in the following form. **Theorem.** A subspace in an $n$-dimensional manifold without boundary is open if and only if it is an $n$-dimensional manifold without boundary. I am curious on the case of manifolds with boundary. ...
2014/12/25
[ "https://math.stackexchange.com/questions/1080594", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203156/" ]
**Answer:** Yes. Since $\left|\frac{f(x)}{f''(x)}\right|\le k\_1^2$ for large $x$, we know that if $f(x)\ne0$, $$ \left|\frac{f''(x)}{f(x)}\right|\ge\frac1{k\_1^2}\tag{1} $$ In an interval where $f(x)\ne0$, $\frac{f''(x)}{f(x)}$ is continuous and either always positive or always negative. If $f(x\_0)=0$, then, since ...
This is a partial answer addressing strict positivity of the functions. The main conclusion is this: either $f$ vanishes identically or we can assume the following for $x>N$ (possibly after increasing $N$): * $f>0$ * $f''>0$ * $f'$ has constant sign and $\lim\_{x\to\infty}f'(x)\in[0,\infty]$ exists Note that it is po...
4,413
Is there an open source solution to interface any profibus slave or master chips? These are the latest finds for a Profibus slave AVR solution: * AVR GCC with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/topic/106174)** * AVR GCC with up to **[12Mbps profibus slave in hardware](http:/...
2010/09/14
[ "https://electronics.stackexchange.com/questions/4413", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1129/" ]
No idea, but since I googled, I might just paste this: <http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=692535>
ProfiBus-DP is just RS-485; electrically this is not a challenge. If you're going after PA it's a little trickier, as you might have some trouble sourcing onesie-twosie quantities, but I can't imagine an Arduino talking on the PA network anyway, so let's not worry about it. I think your biggest challenge will be in fi...
4,413
Is there an open source solution to interface any profibus slave or master chips? These are the latest finds for a Profibus slave AVR solution: * AVR GCC with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/topic/106174)** * AVR GCC with up to **[12Mbps profibus slave in hardware](http:/...
2010/09/14
[ "https://electronics.stackexchange.com/questions/4413", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1129/" ]
No idea, but since I googled, I might just paste this: <http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=692535>
Here is a working link for AVR ASM with up to **[187.5Kbps profibus slave in software](http://web.archive.org/web/20070714172355/http://www.htw-dresden.de/fe/labor/mikror/projects/pb_slave/index.htm)**. This is an **[online translation](http://translate.google.com/translate?langpair=auto%7Cen&u=http://web.archive.org/w...
4,413
Is there an open source solution to interface any profibus slave or master chips? These are the latest finds for a Profibus slave AVR solution: * AVR GCC with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/topic/106174)** * AVR GCC with up to **[12Mbps profibus slave in hardware](http:/...
2010/09/14
[ "https://electronics.stackexchange.com/questions/4413", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1129/" ]
No idea, but since I googled, I might just paste this: <http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=692535>
Here is a working link for AVR GCC source with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/attachment/76882/AVRSoftBus.zip)**. This is the **[original forum link](http://www.mikrocontroller.net/topic/106174)**, and online google translation breaks before reaching important part, so I d...
4,413
Is there an open source solution to interface any profibus slave or master chips? These are the latest finds for a Profibus slave AVR solution: * AVR GCC with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/topic/106174)** * AVR GCC with up to **[12Mbps profibus slave in hardware](http:/...
2010/09/14
[ "https://electronics.stackexchange.com/questions/4413", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1129/" ]
ProfiBus-DP is just RS-485; electrically this is not a challenge. If you're going after PA it's a little trickier, as you might have some trouble sourcing onesie-twosie quantities, but I can't imagine an Arduino talking on the PA network anyway, so let's not worry about it. I think your biggest challenge will be in fi...
Here is a working link for AVR ASM with up to **[187.5Kbps profibus slave in software](http://web.archive.org/web/20070714172355/http://www.htw-dresden.de/fe/labor/mikror/projects/pb_slave/index.htm)**. This is an **[online translation](http://translate.google.com/translate?langpair=auto%7Cen&u=http://web.archive.org/w...
4,413
Is there an open source solution to interface any profibus slave or master chips? These are the latest finds for a Profibus slave AVR solution: * AVR GCC with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/topic/106174)** * AVR GCC with up to **[12Mbps profibus slave in hardware](http:/...
2010/09/14
[ "https://electronics.stackexchange.com/questions/4413", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/1129/" ]
Here is a working link for AVR GCC source with up to **[187.5Kbps profibus slave in software](http://www.mikrocontroller.net/attachment/76882/AVRSoftBus.zip)**. This is the **[original forum link](http://www.mikrocontroller.net/topic/106174)**, and online google translation breaks before reaching important part, so I d...
Here is a working link for AVR ASM with up to **[187.5Kbps profibus slave in software](http://web.archive.org/web/20070714172355/http://www.htw-dresden.de/fe/labor/mikror/projects/pb_slave/index.htm)**. This is an **[online translation](http://translate.google.com/translate?langpair=auto%7Cen&u=http://web.archive.org/w...
54,499,120
this is my code: i want to disable these two buttons if my checkbox from below is unchecked ``` <td><a href="manage-bookings.php?aeid=<?php echo htmlentities($result- >id);?>" onclick="return confirm('Do you really want to Confirm this booking?')"> Confirm</a> / <a href="manage-bookings.php?eid=<?p...
2019/02/03
[ "https://Stackoverflow.com/questions/54499120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10697780/" ]
Add an event listener for the `change` event on the checkbox which toggles a `.disabled` class on the links parent `td` which ignores pointer events and greys them out. Here's an example: ```js const containers = document.querySelectorAll('.link-container') document .querySelector('#checkbox') .addEventListen...
Use jquery for this problem Set id for the checkbox like this: ``` <td><input type="checkbox" value="" name="requirements" id="requirements" /></td> ``` then add a listener in jquery to check if user has check the checkbox like this: ``` $("#requirements").on('click', function(){ if($(this). prop("checked") == t...
2,283,152
Here's a code from the C# Windows Form ``` SpeechSynthesizer audio = new SpeechSynthesizer(); audio.Speak(textBox1.Text); ``` * This will read anything that is in the textbox **Problem in trying to implement the pause and stop feature.Any button or menuitem doesnt get clicked when the code reads something** ``` ...
2010/02/17
[ "https://Stackoverflow.com/questions/2283152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/275481/" ]
Use the SpeakAsync() method instead. That prevents the UI from blocking on the Speak() method, it cannot respond to button clicks while it is blocked. You can use SpeakAsyncCancelAll() to stop it from nattering on.
you need to manage this block `audio.Speak(textBox1.Text);` using [**Threads**](http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx) ``` Thread t = new Thread(() => { SpeechSynthesizer audio = new SpeechSynthesizer(); audio.Speak(textBox1.Text); }); t.S...
1,495,105
I'm iterating through a list of links on a page, creating a URI object for each. When the URI object is created, I don't know whether the URL has a scheme, so when I later call `$uri->host()`, I will sometimes get `Can't locate object method "host" via package "URI::_generic" at -e line 1.` because the URI object is ...
2009/09/29
[ "https://Stackoverflow.com/questions/1495105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17339/" ]
My suggestion: use the built in language features to your advantage before a regex. Instead of a regex, you can do this: ``` if ($uri->can('host')) { say "We're good!"; } ``` ...to see if it's available. You could also check it's type: ``` if ($uri->isa('URI::_generic')) { die 'A generic type - not good!' ...
The UNIVERSAL class ([perldoc UNIVERSAL](http://perldoc.perl.org/UNIVERSAL.html)) is pretty useful indeed; it contains: * `$obj->can( METHOD )`, for determining if METHOD is available on the $obj class (or you can use a bare classname rather than a blessed object - used for [duck typing](https://stackoverflow.com/sear...
66,127,954
I have a dataframe with every transaction from multiple stores df\_transaction: ``` client_id purchase_id store value 1 100 A 100 1 101 B 500 2 102 A 200 2 103 C 300 3 104 B 400 3 ...
2021/02/09
[ "https://Stackoverflow.com/questions/66127954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11233264/" ]
Try self merge then `groupby`: ``` (df.merge(df, on='client_id') .query('store_x < store_y') .groupby(['store_x', 'store_y'], as_index=False) .agg({'value_x':'sum','value_y':'sum', 'client_id':'nunique'}) ) ``` Output: ``` store_x store_y value_x value_y client_id 0 A B 700 ...
Quang Hoang answer worked great for the count but for the sum it would duplicate values if a cliente went to store A more than once and also went to store B more than once I had this in my transaction dataframe ``` client_id purchase_id store value 1 100 A 10 1 101 ...
26,499
Prove or disprove the following statment: For all integers b, c,and d, if x is a rational number such that $x^2+bx+c=d$, then x is an integer. This is a homework question from the book Discrete Mathematics for Computer Scientists by Stein, Drysdale and Bogart. I since x is rational I thought I could start off with: ...
2011/03/12
[ "https://math.stackexchange.com/questions/26499", "https://math.stackexchange.com", "https://math.stackexchange.com/users/6391/" ]
This is simply the monic quadratic case of the [Rational Root Test](http://en.wikipedia.org/wiki/Rational_root_theorem). You could specialize that proof, or else proceed similarly to various irrationality proofs for square-roots. $\: $ E.g. $\:$ below is a [proof that I discovered in high-school.](https://math.stackexc...
Hint: First, you can combine $c$ and $d$ as you only care about their difference. There is the theorem that the square root of a positive integer is either integer or irrational. You are right that one example disproves the assertion "for all b,c, and d". Added: If you look at the quadratic formula, the only threat t...
68,158,350
im using svg for circular progress bar , i want to make one end curve not the both end . how is this possible ? how can i implement one end curve in svg? [![enter image description here](https://i.stack.imgur.com/jQgnL.png)](https://i.stack.imgur.com/jQgnL.png) ```css svg { height: 80vh; margin: 10vh auto; borde...
2021/06/28
[ "https://Stackoverflow.com/questions/68158350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020444/" ]
The easiest way would be to mask the starting point of the blue circle. For this you will need a `<mask>` like so: ``` <mask id="m"> <rect width="100" height="100" fill="white"/> <rect x="85" y="40" width="10" height="10" /> </mask> ``` Please observe that the first rectangle is white and it covers the w...
Try this code: ```css svg { height: 80vh; margin: 10vh auto; border: 1px solid red; display: block; transform: rotate(-90deg); border-top-right-radius: 20px; } svg circle { stroke-width: 10; fill: transparent; } #outer { stroke: lightgrey; } #inner { stroke: blue; animation: value 2.5s linear ...
68,158,350
im using svg for circular progress bar , i want to make one end curve not the both end . how is this possible ? how can i implement one end curve in svg? [![enter image description here](https://i.stack.imgur.com/jQgnL.png)](https://i.stack.imgur.com/jQgnL.png) ```css svg { height: 80vh; margin: 10vh auto; borde...
2021/06/28
[ "https://Stackoverflow.com/questions/68158350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020444/" ]
The easiest way would be to mask the starting point of the blue circle. For this you will need a `<mask>` like so: ``` <mask id="m"> <rect width="100" height="100" fill="white"/> <rect x="85" y="40" width="10" height="10" /> </mask> ``` Please observe that the first rectangle is white and it covers the w...
I came up with an alternative solution than [enxaneta](https://stackoverflow.com/users/7897395/enxaneta) suggested. The problem with using a mask is that when your value goes over 96% or so, the circle isn't completely filled and the mask is revealed. Instead, you can set a rounded progress line on top of another prog...
41,978,966
I am using pluck method to get data from single column ``` $systems = OptionUser::pluck('user_skill'); ``` This systems variable returning only one value while I have around 50 values in this table. Please suggest what is correct way to get all the data from this column.
2017/02/01
[ "https://Stackoverflow.com/questions/41978966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6830438/" ]
please use `get` (which returns simple array of stdObjects) instead of `pluck` (which returns single value - string by default) in laravel 5.4, because of pluck only gives single value from database ``` $systems = OptionUser::select('user_skill')->get(); ```
I know it's late but still if someone need it. For laravel 4.2 `lists` will work. Try this : `OptionUser::lists('user_skill');` > > Note: > > > The following features are deprecated in 5.2 and will be removed in the 5.3 release in June 2016 > > > The lists method on the Collection, query builder and Eloquent qu...
41,978,966
I am using pluck method to get data from single column ``` $systems = OptionUser::pluck('user_skill'); ``` This systems variable returning only one value while I have around 50 values in this table. Please suggest what is correct way to get all the data from this column.
2017/02/01
[ "https://Stackoverflow.com/questions/41978966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6830438/" ]
please use `get` (which returns simple array of stdObjects) instead of `pluck` (which returns single value - string by default) in laravel 5.4, because of pluck only gives single value from database ``` $systems = OptionUser::select('user_skill')->get(); ```
It will work. ``` $systems = OptionUser::select('user_skill')->get(); ```
41,978,966
I am using pluck method to get data from single column ``` $systems = OptionUser::pluck('user_skill'); ``` This systems variable returning only one value while I have around 50 values in this table. Please suggest what is correct way to get all the data from this column.
2017/02/01
[ "https://Stackoverflow.com/questions/41978966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6830438/" ]
I know it's late but still if someone need it. For laravel 4.2 `lists` will work. Try this : `OptionUser::lists('user_skill');` > > Note: > > > The following features are deprecated in 5.2 and will be removed in the 5.3 release in June 2016 > > > The lists method on the Collection, query builder and Eloquent qu...
It will work. ``` $systems = OptionUser::select('user_skill')->get(); ```
37,412,712
I have the following code: ``` QStringListModel* m=new QStringListModel(gc.get_lista_file()); ui->lista_immagini_listView->setModel(m); ``` where `gc.get_lista_file()` returns a `QStringList` object and `lista_immagini_listView` is a `QListView`. I need to update my `lista_immagini_listView` adding a string when I ...
2016/05/24
[ "https://Stackoverflow.com/questions/37412712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1973451/" ]
`QStringListModel` does not allow you to simply add a string (sadly). Simply updating the `QStringList` does not work because the model stores a copy of the list. There are basically two ways to get the desired behavior: **1. Reset:** This is the simple way. You just take the list from the model, add the string an...
You need to only use the string list provided by the `QStringListModel` - don't keep a separate copy, use `QStringListModel::stringList()` for *reading only*. To modify the list, use the model's methods: `insertRows`, `removeRows` and `setData` instead of using `QStringList` methods.
2,106,637
As the title says the task is to find the limit:$\\$ $$\lim\_{n\to\infty}\frac{\ln2^{1/n}-\ln n^2}{1+1/2+1/3+...+1/n})$$ $\\$ I assume I should attempt to somehow reach the form of $\lim\_{n\to0}\frac{\ln(1+n)}{n}$ or use the Cesaro-Stolz theorem,but both of those attempts of mine have failed to get me the correct a...
2017/01/20
[ "https://math.stackexchange.com/questions/2106637", "https://math.stackexchange.com", "https://math.stackexchange.com/users/321708/" ]
Here is my solution to get the generating functions. I have shown every step so any errors can be readily found. The method should be valid even if there are errors. Let $A(x) =\sum\_{n=0}^{\infty} a\_n x^n $ and $B(x) =\sum\_{n=0}^{\infty} b\_n x^n $. Then $A(x)-a\_0 =\sum\_{n=1}^{\infty} a\_n x^n =x\sum\_{n=0}^{\...
Hint:  written in matrix form: $$ \begin{pmatrix} a\_{n+1} \\ b\_{n+1} \end{pmatrix} = \begin{pmatrix} 2 & -1 \\ 1 & 4 \end{pmatrix} \begin{pmatrix} a\_{n} \\ b\_{n} \end{pmatrix} $$ Let $A\_n = \begin{pmatrix} a\_{n+1} \\ b\_{n+1} \end{pmatrix} \,$, $A = \begin{pmatrix} 2 & -1 \\ 1 & 4 \end{pmatrix}\,$ then $A\_n = ...
5,988,968
When I have text beside an image and set them at the same point on the screen, why don't they align properly at the top of their containing div? The text appears to be a pixel or two lower than the image. Is it because of the hight of the text? The site I am concerned with is below. I want the top of the head-shots to...
2011/05/13
[ "https://Stackoverflow.com/questions/5988968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/701790/" ]
That's because of the `line-height`
The line- height is pushing it down a couple of px but if you want to keep that for ease of reading I'd give the paragraphs a -5px margin on the top ``` #content .single p { line-height: 1.5em; margin-bottom: 10px; margin-top: -5px; ```
5,988,968
When I have text beside an image and set them at the same point on the screen, why don't they align properly at the top of their containing div? The text appears to be a pixel or two lower than the image. Is it because of the hight of the text? The site I am concerned with is below. I want the top of the head-shots to...
2011/05/13
[ "https://Stackoverflow.com/questions/5988968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/701790/" ]
That's because of the `line-height`
It rather seems to be font-related, perhaps the [ascent line](http://font.is/wallpaper/FontAnatomyWallpaper1920x1200.jpg) is pushing the font down. If so, there's nothing that can be done about it except adjusting the margins & padding’s applied to your elements to move the text some pixels upwards. Changing fonts or...
43,499,382
I'm trying to create a webapp for a web art class using node (w/ npm) and express. The idea is to have the body of the site be all one color, but anyone can text the site a hexcode/CSS color at a Twilio number and the color of the site will instantly change to that color value. Essentially how it works is the server ...
2017/04/19
[ "https://Stackoverflow.com/questions/43499382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7879689/" ]
**(See update below for a working example)** TL;DR - example:[Deploy to Heroku](https://heroku.com/deploy?template=https://github.com/rsp/node-live-color) ------------------------------------------------------------------------------------------------------------- Original answer --------------- There are few proble...
I think, the problem is in `var dataStr = fs.readFileSync(dataPath).toString();`. Please change your `dataPath` as follow: ``` var dataPath = __dirname + '/data/color.tmp'; ``` And also make sure that file has read/write permission by the .
49,891,633
I have a question very similar to [this](https://stackoverflow.com/questions/5824173/replace-a-value-in-a-data-frame-based-on-a-conditional-if-statement) question ``` country continent <chr> <chr> 1 Taiwan Asia 2 New Zealand ...
2018/04/18
[ "https://Stackoverflow.com/questions/49891633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4678834/" ]
You need to `mutate`: ``` library(dplyr) gm %>% mutate(continent = ifelse(country == "Bahamas", "S America", continent)) ```
**This works:** ``` gm[,'continent'][gm[,'country'] == "Bahamas"] <- "South America" ``` You might get a warning message like this if "South America" is not already in the dataframe: ``` Warning message: In `[<-.factor`(`*tmp*`, gm[, "country"] == "Bahamas", value = c(2L, : invalid factor level, NA generated ``...
15,382,945
**Below is the code of ModelController.m:** ``` - (id)init { self = [super init]; if (self) { // Create the data model. DataHandler *handler = [DataHandler defaultDataHandler]; [handler syncData]; NSInteger tempTotal=1;//[[DataHandler defaultDataHandler] getTotalContents]; NSMutableDictionary *...
2013/03/13
[ "https://Stackoverflow.com/questions/15382945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1657189/" ]
``` [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:0.80]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO]; [UIView commitAnimations]; ``` //Addd ...
You could simply try and animate the view transform like this (for a vertical flip): ``` [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^(void) { view.transform = CGAffineTransformMakeScale(1, -1); } ...
56,510,063
It looks like one of the latest updates to firefox now style text inputs when using a password saved in the browser. I really hate how this yellow looks. Is it possible to remove this styling? I thought it would just be a matter of adding something like: ``` -webkit-appearance: none; -moz-appearance: none; appearanc...
2019/06/08
[ "https://Stackoverflow.com/questions/56510063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There are multiple ways to remove the problem: **Process 1** Use a `ScrollView` as the root layout and put all the other layouts inside it. **Process 2** *(recommended)* Use `android:windowSoftInputMode="adjustPan|adjustResize"` in your manifest file. More detail about this is [here.](https://stackoverflow.com/ques...
please add this in your activity attribute in the manifest ``` <activity android:name="Your_Activity" android:windowSoftInputMode="adjustPan" ></activity> ```
70,926,212
I have the following sample dataset where i want to create the **NUMBER\_OF\_RENEWALS** column. Basically, when the value for SUB\_ID changes for each ID I would like to add 1 to the NUMBER\_OF\_RENEWALS column Below, there is an example dataset with the desired outcome (column NUMBER\_OF\_RENEWALS). ``` ID <- c("A"...
2022/01/31
[ "https://Stackoverflow.com/questions/70926212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13791444/" ]
After grouping by `ID` you can use `cumsum` and increase the count for number of renewals when there's a change in `SUB_ID`: ``` library(tidyverse) sample_df %>% group_by(ID) %>% mutate(NUMBER_OF_RENEWALS = cumsum(SUB_ID != lag(SUB_ID, default = first(SUB_ID)))) ``` Or with `data.table` `rleid` you can do: ```...
Here's base R attempt - ``` transform(sample_df, NUMBER_OF_RENEWALS = as.integer(ave(SUB_ID, ID, FUN = function(x) match(x, unique(x)))) - 1) # ID SUB_ID NUMBER_OF_RENEWALS #1 A 250 0 #2 A 252 1 #3 A 252 1 #4 A 252 1 #5 ...
22,017,924
I'm trying to understand the line `if variable <> 1 then`. I'm having a guess, based on a similar question for a different language, that `<>` is an alternative way of saying `!=` which means not equal to. Am I right in saying this?
2014/02/25
[ "https://Stackoverflow.com/questions/22017924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3228944/" ]
Sounds like a use-case for [`preg_split()`](http://php.net/preg_split): ``` $arr = preg_split('/[.,?!]/', $text, -1, PREG_SPLIT_NO_EMPTY); ``` [**Demo**](http://3v4l.org/VRhWJ)
If you have to take care of an optional quote character behind your split character, try this: ``` preg_split('/[?!.]"?/', $text, -1, PREG_SPLIT_NO_EMPTY); ```
54,648,310
I have a for loop in and it generation id for div i need to get all values for elements in a div when click any element at div ``` <div id="{{ item3.id }}" (click)="getChildren($event)"> <input type="checkbox" name="status" [checked]="item3.templatesFields.status"/> <input type="checkbox" name="inMain" [checked]="ite...
2019/02/12
[ "https://Stackoverflow.com/questions/54648310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7421390/" ]
Convert your column to type `logical`, use `cumsum` first and then add the negation of the input vector to get desired output ``` x <- as.logical(df$new_activity) cumsum(x) + !x # [1] 1 2 3 4 4 5 6 7 8 9 10 11 12 13 14 14 14 15 16 16 ```
One option would be to convert the 'new\_activity' to `logical`, place it on the `i`, create column 'sequence1' as the sequence of rows, then pad the `NAs` with `na.locf` ``` library(zoo) library(data.table) setDT(df)[as.logical(new_activity), sequence1 := seq_len(.N) ][, sequence1 := na.locf(sequence1, fromLas...
42,311,888
I made an API and want to make swagger doc. I don't develop any Serializes for that. > > Views.py > > > ``` class DeliveryView(APIView): renderer_classes = (XMLRenderer,) def get_campaign_vast(self, request, *args): return response def get(self, request): return self.get_campaign_va...
2017/02/18
[ "https://Stackoverflow.com/questions/42311888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7480697/" ]
Consider using the `GenericAPIView` instead as this will generate the documentation. It is a bit of a hack using this when the endpoint does not relate to a model, but it does work. As an example, the following code will create an endpoint that only accepts post requests and is documented within swagger using the sera...
The `get_swagger_view()` method does not give you the control to add parameters and descriptions to the urls in your app The solution for this is to use **explicit schema definition**. You can create a Document which is a representation of the Core API schema container. Go through the following link. Read the Core API...
19,693,410
I am trying to create a Metro Tile type grid with Angular, to achieve this i want each of the tiles to be a different colour. So my plan of action was to create a function that would randomly pick a colour inside a loop (using `ng-repeat`). Here is what i have so far.... ```html <div class={{RandomColourClass()}} ng-r...
2013/10/30
[ "https://Stackoverflow.com/questions/19693410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2859298/" ]
Angular performs a **digest** function to update the DOM when your data changes. During the digest, it recomputes all the values you have bound in the DOM, in this case `{{RandomColorClass()}}`. If any of them change, it again performs a digest cycle (since some variables may depend on the value of of the changed vari...
Answer unrelated to this particular question, but I'm adding it here because it's on the Google front page when you search for the error message and it took me a bit until I figured it out: I had something like this in my view: ``` <custom-tag data="[1,2,3]"/> ``` And the controller of the custom tag had a watcher ...
19,693,410
I am trying to create a Metro Tile type grid with Angular, to achieve this i want each of the tiles to be a different colour. So my plan of action was to create a function that would randomly pick a colour inside a loop (using `ng-repeat`). Here is what i have so far.... ```html <div class={{RandomColourClass()}} ng-r...
2013/10/30
[ "https://Stackoverflow.com/questions/19693410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2859298/" ]
Angular performs a **digest** function to update the DOM when your data changes. During the digest, it recomputes all the values you have bound in the DOM, in this case `{{RandomColorClass()}}`. If any of them change, it again performs a digest cycle (since some variables may depend on the value of of the changed vari...
I had the same problem in IE10 turns ut that the problem was that I was redirecting using window.location. ``` window.location = "#route/yada"; ``` Changed the code to ``` $location.path("/route/yada); ``` And that solved my issues. =D