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
47,497,110
I'd like to use the vim sort command to start sorting at a certain position. Without installing any plugins. ``` 2011-09-17 00:37 |Free|ALL RIGHT NOW 2011-09-17 00:41 |Kim Wilde|CAMBODIA 2011-09-17 00:45 |Take That|NEVER FORGET 2011-09-17 00:53 |Visage|FADE TO GREY 2011-09-17 00:56 |SUTHERLAND BROTHERS & QUIVER|A...
2017/11/26
[ "https://Stackoverflow.com/questions/47497110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2335020/" ]
Out of the box, you can sort starting at a virtual column ``` :sort /\%20v/ ``` from `:help :sort`
If you really want to sort from position 20, use the next syntax: ``` :sort /^.\{19}/ ``` Mind the *backslash* before the opening bracket and the character to be repeated must be *before* the quantifier.
50,648,084
Using `df`, I am creating a new data frame (`final.df`) that has a row for every date between the `startdate` and `enddate` from the `df` datadframe. ``` df <- data.frame(claimid = c("123A", "125B", "151C", "124A", ...
2018/06/01
[ "https://Stackoverflow.com/questions/50648084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4716625/" ]
You can use `gather` from `tidyr` to convert wide to long format, then use `pad` from `padr` to create new date rows between start and end date. The `group = "claimid"` argument lets you specify grouping variables: ``` library(dplyr) library(tidyr) library(padr) df %>% gather(var, date, -claimid) %>% pad(group = ...
In base `R`: ``` do.call(rbind, Map(function(claimid, startdate, enddate) data.frame(claimid, date=as.Date(startdate:enddate, origin = "1970-01-01")), df$claimid, df$startdate, df$enddate)) # claimid date # 1 123A 2018-01-01 # 2 123A 2018-01-02 # 3 123A 2018-01-03 # 4 123A 2018-01-04 # 5 12...
50,648,084
Using `df`, I am creating a new data frame (`final.df`) that has a row for every date between the `startdate` and `enddate` from the `df` datadframe. ``` df <- data.frame(claimid = c("123A", "125B", "151C", "124A", ...
2018/06/01
[ "https://Stackoverflow.com/questions/50648084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4716625/" ]
You can use `gather` from `tidyr` to convert wide to long format, then use `pad` from `padr` to create new date rows between start and end date. The `group = "claimid"` argument lets you specify grouping variables: ``` library(dplyr) library(tidyr) library(padr) df %>% gather(var, date, -claimid) %>% pad(group = ...
One option is to use `tidyr::expand` function to expand rows between `startdate` to `enddate`. ``` library(tidyverse) df %>% group_by(claimid) %>% expand(date = seq(startdate, enddate, by="day")) %>% as.data.frame() # claimid date # 1 123A 2018-01-01 # 2 123A 2018-01-02 # 3 123A 2018-01-03 #...
26,933,961
I have a Xpages app that containts Tips. I send out weekly emails with links to the documents in the database. I want to be able to compute in the document the proper URL for opening these in the web, but I cannot seem to be able to do that (I need to do this as the users might be on cellphones, at home, in iNotes, etc...
2014/11/14
[ "https://Stackoverflow.com/questions/26933961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796709/" ]
Define the XPage you want to open a form with in forms properties: ![enter image description here](https://i.stack.imgur.com/Ishls.png) This way your URL `http://server/database/0/...UNID...?OpenDocument` will work.
To open XPage in Notes client use notes url syntax: ``` notes://server/path/database.nsf/pagename.xsp?openXpage ```
26,933,961
I have a Xpages app that containts Tips. I send out weekly emails with links to the documents in the database. I want to be able to compute in the document the proper URL for opening these in the web, but I cannot seem to be able to do that (I need to do this as the users might be on cellphones, at home, in iNotes, etc...
2014/11/14
[ "https://Stackoverflow.com/questions/26933961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796709/" ]
Define the XPage you want to open a form with in forms properties: ![enter image description here](https://i.stack.imgur.com/Ishls.png) This way your URL `http://server/database/0/...UNID...?OpenDocument` will work.
If you're trying to identify which XPage a Form opens with, that's defined in the $XPageAlt field for web and $XPageAltClient field if you have a specific alternative XPage to open for XPiNC. You can create a NoteCollection to retrieve the Form, then access that element. It's something we've extended in OpenNTF Domino...
5,877,184
I want to change the style on anchor tags using jquery, once the link is clicked. ``` <tr class="row-tab" style="height: 30px;"> <td class="subtab-selected"><a href="#" id="as1">TOP % GAINERS</a></td> <td class="subtab-notselected"><a href="#" id="as2">TOP % LOSERS</a></td> </tr> $('#as1, #as2').click(functio...
2011/05/04
[ "https://Stackoverflow.com/questions/5877184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737115/" ]
Try removing the quotes around `'this'`
Try changing that second line to: ``` $('this').parent().addClass('subtab-selected').removeClass('subtab-notselected'); ``` I assume you wouldn't want both.
5,877,184
I want to change the style on anchor tags using jquery, once the link is clicked. ``` <tr class="row-tab" style="height: 30px;"> <td class="subtab-selected"><a href="#" id="as1">TOP % GAINERS</a></td> <td class="subtab-notselected"><a href="#" id="as2">TOP % LOSERS</a></td> </tr> $('#as1, #as2').click(functio...
2011/05/04
[ "https://Stackoverflow.com/questions/5877184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737115/" ]
Try removing the quotes around `'this'`
I wrote a solution without the fixed `#ids` on the jQuery: ``` $("td a").click(function() { var p = $(this).parents("tr"); $("td", p).removeClass("subtab-selected").addClass("subtab-notselected"); $(this).parent().addClass("subtab-selected"); return false; }); ``` You can see it runing [here](http://...
5,877,184
I want to change the style on anchor tags using jquery, once the link is clicked. ``` <tr class="row-tab" style="height: 30px;"> <td class="subtab-selected"><a href="#" id="as1">TOP % GAINERS</a></td> <td class="subtab-notselected"><a href="#" id="as2">TOP % LOSERS</a></td> </tr> $('#as1, #as2').click(functio...
2011/05/04
[ "https://Stackoverflow.com/questions/5877184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737115/" ]
I wrote a solution without the fixed `#ids` on the jQuery: ``` $("td a").click(function() { var p = $(this).parents("tr"); $("td", p).removeClass("subtab-selected").addClass("subtab-notselected"); $(this).parent().addClass("subtab-selected"); return false; }); ``` You can see it runing [here](http://...
Try changing that second line to: ``` $('this').parent().addClass('subtab-selected').removeClass('subtab-notselected'); ``` I assume you wouldn't want both.
18,741,241
In my case, with the right query server always returns an XML response that is normally processed and sent back. But at the same time, the server configuration is such that when an incorrect query it returns an HTML response instead of XML.If you attempt to handle or how to replace, re-create the body of the response I...
2013/09/11
[ "https://Stackoverflow.com/questions/18741241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2768551/" ]
Forgive me for asking that question literally just managed to solve it! In the search for solutions has been spent a lot of time and then I just leave the resolution of this issue here. The problem was that the default settings for ``` contentType="text/html" ``` in the system settings not specified Message Builder ...
You can see whether the payloadFactory mediator has created the body of the message or not by adding a mediator after the mediator like below. ``` <case regex="401"> <payloadFactory media-type="xml"> <format> <error xmlns=""> <message>some message</message> </error> ...
151,817
I just ran into this site (<http://stuck.include-once.org/>) via comment on the main site [via this question](https://stackoverflow.com/questions/12954018/calling-clr-stored-procedure). I know its not a SE site, it just seems bad taste Are we now encouraging 3rd party sites to hold the FAQ and not meta? I sure hope no...
2012/10/18
[ "https://meta.stackexchange.com/questions/151817", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/23528/" ]
Definitely not part of the SE family. Just someone who appears to have too much time on their hands. Maybe it exists to get around the whole ["What Stack Overflow Is Not" controversy](https://meta.stackexchange.com/questions/137795/why-what-stack-overflow-is-not-was-deleted?lq=1)? Since we have pretty clear guidance ...
Their [about page](http://stuck.include-once.org/about) seems to state the site's objectives - > > STUCK is intended as evil support tool. It's just a list of comment > templates actually. And it's the editing backend for the small > quickcomments userscript. Also pretty simplistic. > > >
151,817
I just ran into this site (<http://stuck.include-once.org/>) via comment on the main site [via this question](https://stackoverflow.com/questions/12954018/calling-clr-stored-procedure). I know its not a SE site, it just seems bad taste Are we now encouraging 3rd party sites to hold the FAQ and not meta? I sure hope no...
2012/10/18
[ "https://meta.stackexchange.com/questions/151817", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/23528/" ]
Definitely not part of the SE family. Just someone who appears to have too much time on their hands. Maybe it exists to get around the whole ["What Stack Overflow Is Not" controversy](https://meta.stackexchange.com/questions/137795/why-what-stack-overflow-is-not-was-deleted?lq=1)? Since we have pretty clear guidance ...
[mario](https://meta.stackoverflow.com/users/148103/mario) claims ownership of the site in his Meta profile. [Another page](http://milki.include-once.org/blog/) on the same domain links to his SO profile, and [here](https://stackoverflow.com/questions/12868864/php-code-for-api-not-working#comment17420327_12868864) is a...
49,853,955
I'm trying to test a functionality out where if you have a list of `li` with an attribute of `aria-checked`, clicking on one will toggle it to `true`, while turning the rest of the `li's` `aria` to `false`. I have implemented it below: ``` class Parent extends React.Component { constructor(props){ super(props);...
2018/04/16
[ "https://Stackoverflow.com/questions/49853955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3102993/" ]
I think You add Top 100% important to #rev\_slider\_11\_1 .uranus.tparrows this class. ``` #rev_slider_11_1 .uranus.tparrows { top: 100% !important; background: rgba(255,255,255,0); } ```
There is an CSS file names 1523871058index.css. In this CSS at line 26 ``` .rev_slider_wrapper .rev_slider .tp-leftarrow.tparrows, .rev_slider_wrapper .rev_slider .tp-rightarrow.tparrows { opacity: 0.8 !important; position: absolute; top: 50% !important; margin-top: -31px !important; width: 63px !i...
9,924,725
I have imageView in activity. How I can set position this imageView in my activity. I know how I can do this in xml file but I want to do this in activity, because I have onTouch method where I get coordinates where I clicked and I want to draw this images in this coordinates.
2012/03/29
[ "https://Stackoverflow.com/questions/9924725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705544/" ]
@edi233-- I think you can get touch x & y so that you can calculate top margin & left margin. I think (0,0) will be left top corner so if you touch (100,75) you need to set margins of image view to top - 75 & left to 100 ``` LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)...
use the [View.layout(int, int, int, int)](http://developer.android.com/reference/android/view/View.html#layout%28int,%20int,%20int,%20int%29) in order to set its position
14,136,336
I am trying out CasperJS. I am trying to create a web **scraper** . I need to **scrape** all pages of site(s) and get data in less than 5 seconds(each page). For this I will have to crawl through all similar pages. Go to appropriate content div and get data from there. So If the site has say 1000 pages. I need to compl...
2013/01/03
[ "https://Stackoverflow.com/questions/14136336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1865233/" ]
This should do it: ``` function() { var TAG_CSS_PATH = 'div#buttons ul li.tab', selectOptions = document.querySelectorAll(TAG_CSS_PATH), results = [], l = selectOptions.length + 1; for(var i = 1; i < l; i++){ results.push(TAG_CSS_PATH+':nth-of-type('+i+')'); } return...
The jQuery part is the $selector, and the $each. These can be replaced as follows. ``` function() { var TAG_CSS_PATH = '#buttons ul li.tab', selectOptions = document.querySelectorAll(TAG_CSS_PATH), results = []; for( var i = 1, ln = selectOptions.length + 1; i < ln; i++ ) { result...
48,563,760
I have a javascript array that is populated like this: ``` var orderDetails = []; orderDetails.push({ City: "ABQ", Banana: 5, Mango:12 }); ``` I am looping through a list of cities. I would like to be able to look in this array to see if the city exists and if it does, update the count of Banana ...
2018/02/01
[ "https://Stackoverflow.com/questions/48563760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292064/" ]
You can use `array.prototype.find` if the object is already in your array: ```js function update(arr, obj) { var found = arr.find(o => o.City === obj.City); if (found) { found.Banana += obj.Banana; found.Mango += obj.Mango; } else { arr.push(obj); } } var orderDetails ...
You can search for a city while you're looping through the list of the cities. if you find it, you can update the two value, and you can push a new object otherwise. ``` cities.forEach(city => { var found = orderDetails.find(detail => detail.City === city.name); if (found) { found.Banana += city.banana...
6,853,243
I'm starting to program. Already did some things with Java: a calculator, one document management system powered with a database and some other home projects. But I don't like the visual look. I love however how mi Mac's Apps look. And I want to create Apps for mac. Already buy one but when I open netbeans to program i...
2011/07/28
[ "https://Stackoverflow.com/questions/6853243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866558/" ]
1. AFAIK You'll never get the *look and feel* of Aqua (Mac's UI Kit) by using Java. Why? Because to make Java platform independent some things needs to get ripped off. And native controls are one of them. 2. I think you're taking about *Objective C* which is the native development language for building Mac Apps. I'll r...
You're thinking of Objective C. You can also do applications for Mac using C/C++ but as of late the "popular" language for Mac development is Objective-C. There are tons of tutorials and plenty of documentation to walk you through writing apps for both Mac and iOS.
6,853,243
I'm starting to program. Already did some things with Java: a calculator, one document management system powered with a database and some other home projects. But I don't like the visual look. I love however how mi Mac's Apps look. And I want to create Apps for mac. Already buy one but when I open netbeans to program i...
2011/07/28
[ "https://Stackoverflow.com/questions/6853243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866558/" ]
1. AFAIK You'll never get the *look and feel* of Aqua (Mac's UI Kit) by using Java. Why? Because to make Java platform independent some things needs to get ripped off. And native controls are one of them. 2. I think you're taking about *Objective C* which is the native development language for building Mac Apps. I'll r...
Apple has deprecated a lot of the Java support in OS X. It's possible to have a Java application integrated, but there are some annoying bits missing. See [one of my questions](https://stackoverflow.com/questions/3153592/dropping-files-on-application-icon-in-dock/) demonstrating some issues with Java applications in th...
6,853,243
I'm starting to program. Already did some things with Java: a calculator, one document management system powered with a database and some other home projects. But I don't like the visual look. I love however how mi Mac's Apps look. And I want to create Apps for mac. Already buy one but when I open netbeans to program i...
2011/07/28
[ "https://Stackoverflow.com/questions/6853243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866558/" ]
1. AFAIK You'll never get the *look and feel* of Aqua (Mac's UI Kit) by using Java. Why? Because to make Java platform independent some things needs to get ripped off. And native controls are one of them. 2. I think you're taking about *Objective C* which is the native development language for building Mac Apps. I'll r...
If you want to code in Objective-C, you'll first need to trek over to the App Store and download Xcode. This will install C/C++/Objective-C compilers on your Mac and then you can start getting your hands dirty. Depending on what you are trying to accomplish, you can just google/read/learn and build your own frameworks...
3,544,503
i am trying to do `var width = ($(this).width() + $(this).css('padding-left') + $(this).css('padding-right'));` do add the width to the padding, so i should end up with width = `200 + 4 + 4 = 208` instead i end up with 2004px4px; how can i force it to add them to get 208?
2010/08/23
[ "https://Stackoverflow.com/questions/3544503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383759/" ]
Why dont you use outerWidth property instead. <http://api.jquery.com/outerWidth/>
Use [`parseInt`](http://www.w3schools.com/jsref/jsref_parseInt.asp) ``` var width = $(this).width(); var paddingLeft = parseInt($(this).css('padding-left' ), 10); var paddingRight = parseInt($(this).css('padding-right'), 10); var paddedWidth = width + paddingLeft + paddingRight; ``` Or better use the [jSizes](http...
34,206,620
Let's say I want to extend the following Python class, which includes a decorator that I don't know much about: ``` from somewhere import some_decorator class One(object): @some_decorator def some_method(self): do_something() ``` Should I decorate the overridden method or not? In other words, can I ...
2015/12/10
[ "https://Stackoverflow.com/questions/34206620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1005499/" ]
Remember what the `@decorator` syntax does: ``` @decorator def foo(): print "foo" ``` is just syntactic sugar for ``` def foo(): print "foo" foo = decorator(foo) ``` Thus, the undecorated function is no longer callable by its name after it has been decorated because its name has been assigned to something...
For those wondering about edge cases, here is an example: ```py import functools def print_hi(func): """Decorate a function to print stuff.""" @functools.wraps(func) def wrapper_print_hi(*args, **kwargs): print(f"hello and up next: calling {func.__qualname__}") return func(*args, **kwargs...
30,972,057
I know that k-means clustering is the one of simplest unsupervised learning algorithm. Looking at the source code of streaming k-means clustering packaged in MLlib, I find the terms: training data, test data, predict, and train. This makes me think that this streaming K-means might be supervised. So, is this algorithm...
2015/06/22
[ "https://Stackoverflow.com/questions/30972057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4958266/" ]
K-means (streaming or regular) is a clustering algorithm. Clustering algorithms are by definition unsupervised. That is, you don't know the natural groupings (labels) of your data and you want to automatically group similar entities together. The term `train` here refers to "learning" the clusters (centroids). The ...
It depends, but most would classify k-means as unsupervised. > > Other than specifying the number of clusters, k-means “learns” the > clusters on its own without any information about which cluster an > observation belongs to. k-means can be semi-supervised. > > > This is about k-means normally , so ideally I ...
17,167,350
I'm dynamically populating a table with a repeater and I want to trigger an asp:HyperLink when there is a click on a row. ``` <td id="hyperLink"> <asp:HyperLink ID="lnkDocPage_<%# Eval("ID")%>" ClientIDMode="Static" NavigateUrl="~/Pages/DocumentListPage.aspx?id=<%# Eval("ID")%>" Text="" runat="server">link</asp...
2013/06/18
[ "https://Stackoverflow.com/questions/17167350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1479895/" ]
You could simply do it using: ``` $('table').on('click', 'tr', function () { $(this).find('a[id*="lnkDocPage_"]').trigger('click'); }); ``` The expression `id*="lnkDocPage_"` matches elements which have an `id` containing `lnkDocPage_` and triggers a click event on it when the table row it is nested in is click...
``` <td id="hyperLink"> <asp:HyperLink ID="lnkDocPage_<%# Eval("ID")%>" ClientIDMode="Static" NavigateUrl="~/Pages/DocumentListPage.aspx?id=<%# Eval("ID")%>" Text="" runat="server">link</asp:HyperLink> </td> ``` Below is the Script ``` $(document).ready(function(){ $('#productTable').find('tr').click(func...
17,167,350
I'm dynamically populating a table with a repeater and I want to trigger an asp:HyperLink when there is a click on a row. ``` <td id="hyperLink"> <asp:HyperLink ID="lnkDocPage_<%# Eval("ID")%>" ClientIDMode="Static" NavigateUrl="~/Pages/DocumentListPage.aspx?id=<%# Eval("ID")%>" Text="" runat="server">link</asp...
2013/06/18
[ "https://Stackoverflow.com/questions/17167350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1479895/" ]
Just use event beforeunload, because of navigating to a different page all functionality is disabled. window.addEventListener("beforeunload", function (event) { event.preventDefault();//or show progress bar... });
``` <td id="hyperLink"> <asp:HyperLink ID="lnkDocPage_<%# Eval("ID")%>" ClientIDMode="Static" NavigateUrl="~/Pages/DocumentListPage.aspx?id=<%# Eval("ID")%>" Text="" runat="server">link</asp:HyperLink> </td> ``` Below is the Script ``` $(document).ready(function(){ $('#productTable').find('tr').click(func...
48,173,267
I am using [MkDocs](http://www.mkdocs.org), question I have is - I understand that within the documentation files I can say: `[My Link Name](My link URL)` But it's such a hustle when I want to change up my navigation or change up my keywords. Can anyone suggest a plugin - At the point of building the documentation, ...
2018/01/09
[ "https://Stackoverflow.com/questions/48173267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591799/" ]
You can import them inside component using `import`. For example for `jQuery` it will be ``` import * as $ from 'jquery'; ``` which means "import all as '$' (and use it as '$' further) from 'jquery' library", and you don't really need to include another import to `.angular.cli.json`. It works fine for Angular 5 (I h...
You can do it simply by fetching the src js and importing it in your component. Here is an example from a leaflet application I did : **package.json :** ``` "leaflet.markercluster": "^1.1.0", "leaflet-draw": "^0.4.12", ``` **random1.component.ts :** with markercluster library example ``` declare const L: any; ...
48,173,267
I am using [MkDocs](http://www.mkdocs.org), question I have is - I understand that within the documentation files I can say: `[My Link Name](My link URL)` But it's such a hustle when I want to change up my navigation or change up my keywords. Can anyone suggest a plugin - At the point of building the documentation, ...
2018/01/09
[ "https://Stackoverflow.com/questions/48173267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591799/" ]
Things like jQuery and bootstrap are global and will be available to the application. But, it is good practice to make them injectable and thus referable from single components. First install jQuery ``` npm install --save jquery npm install -D @types/jquery ``` Second make an injection module ``` import { NgModule...
You can import them inside component using `import`. For example for `jQuery` it will be ``` import * as $ from 'jquery'; ``` which means "import all as '$' (and use it as '$' further) from 'jquery' library", and you don't really need to include another import to `.angular.cli.json`. It works fine for Angular 5 (I h...
48,173,267
I am using [MkDocs](http://www.mkdocs.org), question I have is - I understand that within the documentation files I can say: `[My Link Name](My link URL)` But it's such a hustle when I want to change up my navigation or change up my keywords. Can anyone suggest a plugin - At the point of building the documentation, ...
2018/01/09
[ "https://Stackoverflow.com/questions/48173267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591799/" ]
Things like jQuery and bootstrap are global and will be available to the application. But, it is good practice to make them injectable and thus referable from single components. First install jQuery ``` npm install --save jquery npm install -D @types/jquery ``` Second make an injection module ``` import { NgModule...
You can do it simply by fetching the src js and importing it in your component. Here is an example from a leaflet application I did : **package.json :** ``` "leaflet.markercluster": "^1.1.0", "leaflet-draw": "^0.4.12", ``` **random1.component.ts :** with markercluster library example ``` declare const L: any; ...
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
You can't write: ``` public Bar() : base(new FooAttributeCollection(this)) ``` Because `this`, the current object, must be put in the implementation of a method, not in the method signature: here you have no access to the current instance of the object. You can't do a such thing in every method declaration because...
the class needs to be constructed before you can access the `this` keyword. You can try the bellow. ``` class Bar : Foo { private readonly FooAttributeCollection attributes; public Bar() : base(null) { var attributes = new FooAttributeCollection(this); } } ```
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
Why don't affect attributes in abstract class ? If you want in FooAttributeCollection you can cast owner in Bar class. ```cs abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes=null) { if(attributes = null) {attributes = new FooA...
the class needs to be constructed before you can access the `this` keyword. You can try the bellow. ``` class Bar : Foo { private readonly FooAttributeCollection attributes; public Bar() : base(null) { var attributes = new FooAttributeCollection(this); } } ```
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
If **Foo** and **FooAttributeCollection** can't be modified, this code seems to be a bad design. To instantiate a derivated Foo class you must instantiate FooAttributeCollection before and to instantiate FooAttributeCollection you must instantiate the same derivated Foo class. Its a endless circular dependency impossib...
the class needs to be constructed before you can access the `this` keyword. You can try the bellow. ``` class Bar : Foo { private readonly FooAttributeCollection attributes; public Bar() : base(null) { var attributes = new FooAttributeCollection(this); } } ```
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
You can't write: ``` public Bar() : base(new FooAttributeCollection(this)) ``` Because `this`, the current object, must be put in the implementation of a method, not in the method signature: here you have no access to the current instance of the object. You can't do a such thing in every method declaration because...
**Try this way:** ``` public class Bar : Foo { public Bar(FooAttributeCollection attributes) : base(attributes) { } } ``` **Other Example:** ``` public class BaseClass { int num; public BaseClass(int i) { num = i; Console.WriteLine(...
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
If **Foo** and **FooAttributeCollection** can't be modified, this code seems to be a bad design. To instantiate a derivated Foo class you must instantiate FooAttributeCollection before and to instantiate FooAttributeCollection you must instantiate the same derivated Foo class. Its a endless circular dependency impossib...
You can't write: ``` public Bar() : base(new FooAttributeCollection(this)) ``` Because `this`, the current object, must be put in the implementation of a method, not in the method signature: here you have no access to the current instance of the object. You can't do a such thing in every method declaration because...
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
Why don't affect attributes in abstract class ? If you want in FooAttributeCollection you can cast owner in Bar class. ```cs abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes=null) { if(attributes = null) {attributes = new FooA...
**Try this way:** ``` public class Bar : Foo { public Bar(FooAttributeCollection attributes) : base(attributes) { } } ``` **Other Example:** ``` public class BaseClass { int num; public BaseClass(int i) { num = i; Console.WriteLine(...
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
If **Foo** and **FooAttributeCollection** can't be modified, this code seems to be a bad design. To instantiate a derivated Foo class you must instantiate FooAttributeCollection before and to instantiate FooAttributeCollection you must instantiate the same derivated Foo class. Its a endless circular dependency impossib...
Why don't affect attributes in abstract class ? If you want in FooAttributeCollection you can cast owner in Bar class. ```cs abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes=null) { if(attributes = null) {attributes = new FooA...
58,187,467
``` abstract class Foo { private readonly FooAttributeCollection attributes; public Foo(FooAttributeCollection attributes) { this.attributes = attributes; } } class FooAttributeCollection { public FooAttributeCollection(Foo owner) { } } class Bar : Foo { public Bar() : ba...
2019/10/01
[ "https://Stackoverflow.com/questions/58187467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291215/" ]
If **Foo** and **FooAttributeCollection** can't be modified, this code seems to be a bad design. To instantiate a derivated Foo class you must instantiate FooAttributeCollection before and to instantiate FooAttributeCollection you must instantiate the same derivated Foo class. Its a endless circular dependency impossib...
**Try this way:** ``` public class Bar : Foo { public Bar(FooAttributeCollection attributes) : base(attributes) { } } ``` **Other Example:** ``` public class BaseClass { int num; public BaseClass(int i) { num = i; Console.WriteLine(...
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
In your case you can use something like: ``` get_class = lambda x: globals()[x] c = get_class("foo") ``` And it's even easier to get the class from the module: ``` import somemodule getattr(somemodule, "SomeClass") ```
try this ``` cls = __import__('cls_name') ``` and this - <http://effbot.org/zone/import-confusion.htm> maybe helpful
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
``` classname = "Foo" foo = vars()[classname](Bar, 0, 4) ``` Or perhaps ``` def mkinst(cls, *args, **kwargs): try: return globals()[cls](*args, **kwargs) except: raise NameError("Class %s is not defined" % cls) x = mkinst("Foo", bar, 0, 4, disc="bust") y = mkinst("Bar", foo, batman="robin") ...
try this ``` cls = __import__('cls_name') ``` and this - <http://effbot.org/zone/import-confusion.htm> maybe helpful
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
If you know the namespace involved, you can use it directly -- for example, if all classes are in module `zap`, the dictionary `vars(zap)` is that namespace; if they're all in the current module, `globals()` is probably the handiest way to get that dictionary. If the classes are not all in the same namespace, then bui...
``` classdict = {'foo': foo} x = classdict['foo'](A, B) ```
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
``` classdict = {'foo': foo} x = classdict['foo'](A, B) ```
try this ``` cls = __import__('cls_name') ``` and this - <http://effbot.org/zone/import-confusion.htm> maybe helpful
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
``` classdict = {'foo': foo} x = classdict['foo'](A, B) ```
You might consider usage of metaclass as well: ``` Cls = type('foo', (), foo.__dict__) x = Cls(A, B) ``` Yet it creates another similar class.
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
If you know the namespace involved, you can use it directly -- for example, if all classes are in module `zap`, the dictionary `vars(zap)` is that namespace; if they're all in the current module, `globals()` is probably the handiest way to get that dictionary. If the classes are not all in the same namespace, then bui...
``` classname = "Foo" foo = vars()[classname](Bar, 0, 4) ``` Or perhaps ``` def mkinst(cls, *args, **kwargs): try: return globals()[cls](*args, **kwargs) except: raise NameError("Class %s is not defined" % cls) x = mkinst("Foo", bar, 0, 4, disc="bust") y = mkinst("Bar", foo, batman="robin") ...
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
In your case you can use something like: ``` get_class = lambda x: globals()[x] c = get_class("foo") ``` And it's even easier to get the class from the module: ``` import somemodule getattr(somemodule, "SomeClass") ```
``` classdict = {'foo': foo} x = classdict['foo'](A, B) ```
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
If you know the namespace involved, you can use it directly -- for example, if all classes are in module `zap`, the dictionary `vars(zap)` is that namespace; if they're all in the current module, `globals()` is probably the handiest way to get that dictionary. If the classes are not all in the same namespace, then bui...
try this ``` cls = __import__('cls_name') ``` and this - <http://effbot.org/zone/import-confusion.htm> maybe helpful
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
In your case you can use something like: ``` get_class = lambda x: globals()[x] c = get_class("foo") ``` And it's even easier to get the class from the module: ``` import somemodule getattr(somemodule, "SomeClass") ```
``` classname = "Foo" foo = vars()[classname](Bar, 0, 4) ``` Or perhaps ``` def mkinst(cls, *args, **kwargs): try: return globals()[cls](*args, **kwargs) except: raise NameError("Class %s is not defined" % cls) x = mkinst("Foo", bar, 0, 4, disc="bust") y = mkinst("Bar", foo, batman="robin") ...
2,226,330
So i have a set of classes and a string with one of the class names. How do I instantiate a class based on that string? ``` class foo: def __init__(self, left, right): self.left = left self.right = right str = "foo" x = Init(str, A, B) ``` I want x to be an instantiation of class foo.
2010/02/09
[ "https://Stackoverflow.com/questions/2226330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181239/" ]
If you know the namespace involved, you can use it directly -- for example, if all classes are in module `zap`, the dictionary `vars(zap)` is that namespace; if they're all in the current module, `globals()` is probably the handiest way to get that dictionary. If the classes are not all in the same namespace, then bui...
You might consider usage of metaclass as well: ``` Cls = type('foo', (), foo.__dict__) x = Cls(A, B) ``` Yet it creates another similar class.
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
This does not exist in the UI currently. However, it does seem like a good idea to have a script that deletes OR archives mailings that are greater than N months / years old. So i'd recommend writing a api job that does the needful. Approx steps would be: a. Create a new delete/archive mailing job taking parameters l...
I like this idea. For reference, one of my bigger installs has the following sizes of the 4 biggest files in mysql (in MB). So removing the corresponding activities (or maybe only some of the associations) is probably a good idea also. ``` 110592 civicrm_mailing_event_delivered.ibd 151552 civicrm_mailing_recipients....
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
This does not exist in the UI currently. However, it does seem like a good idea to have a script that deletes OR archives mailings that are greater than N months / years old. So i'd recommend writing a api job that does the needful. Approx steps would be: a. Create a new delete/archive mailing job taking parameters l...
I don't think it is likely that old mailings would cause troubles with sending a CiviMail. They would use up disk space which would likely manifest other problems when disk space ran low or was exhausted. It's more likely that a problem sending a mass mailing is due to growth in your list size, and that sending to mo...
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
This does not exist in the UI currently. However, it does seem like a good idea to have a script that deletes OR archives mailings that are greater than N months / years old. So i'd recommend writing a api job that does the needful. Approx steps would be: a. Create a new delete/archive mailing job taking parameters l...
You can try this extension **Delete Old Bulk Mailings for CiviCRM** (<https://github.com/jitendrapurohit/nz.co.fuzion.deleteoldbulkmailings>) which provides some new API calls. You can either use the API in a script or you can use the command line tool **cv** (<https://github.com/civicrm/cv>). The README provides some...
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
I don't think it is likely that old mailings would cause troubles with sending a CiviMail. They would use up disk space which would likely manifest other problems when disk space ran low or was exhausted. It's more likely that a problem sending a mass mailing is due to growth in your list size, and that sending to mo...
I like this idea. For reference, one of my bigger installs has the following sizes of the 4 biggest files in mysql (in MB). So removing the corresponding activities (or maybe only some of the associations) is probably a good idea also. ``` 110592 civicrm_mailing_event_delivered.ibd 151552 civicrm_mailing_recipients....
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
You can try this extension **Delete Old Bulk Mailings for CiviCRM** (<https://github.com/jitendrapurohit/nz.co.fuzion.deleteoldbulkmailings>) which provides some new API calls. You can either use the API in a script or you can use the command line tool **cv** (<https://github.com/civicrm/cv>). The README provides some...
I like this idea. For reference, one of my bigger installs has the following sizes of the 4 biggest files in mysql (in MB). So removing the corresponding activities (or maybe only some of the associations) is probably a good idea also. ``` 110592 civicrm_mailing_event_delivered.ibd 151552 civicrm_mailing_recipients....
3,180
DB has grown so huge and it started to cause problems with sending mass mailings. I want to delete old mass mailings, the sent ones and the drafts, etc. Is there away to do it in one click instead of deleting each and everyone individually?
2015/06/11
[ "https://civicrm.stackexchange.com/questions/3180", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/658/" ]
You can try this extension **Delete Old Bulk Mailings for CiviCRM** (<https://github.com/jitendrapurohit/nz.co.fuzion.deleteoldbulkmailings>) which provides some new API calls. You can either use the API in a script or you can use the command line tool **cv** (<https://github.com/civicrm/cv>). The README provides some...
I don't think it is likely that old mailings would cause troubles with sending a CiviMail. They would use up disk space which would likely manifest other problems when disk space ran low or was exhausted. It's more likely that a problem sending a mass mailing is due to growth in your list size, and that sending to mo...
521,170
I recently upgraded from 12.04 tot 14.04, gnome flashback Compiz. Conky tranparant behaves abnormally now and I can't fix it. Transparency turned off, conky acts normally. Transparency turned on, it is as if upon each refresh, the previous layer isn't removed, so they stack onto eachother. See screenshots: no trans...
2014/09/07
[ "https://askubuntu.com/questions/521170", "https://askubuntu.com", "https://askubuntu.com/users/65499/" ]
I've run into same problem. Transparency does not work with window\_type override. And window\_type desktop disappears on show\_desktop. I've come up with this config for ubuntu 14.04 with unity and compiz own\_window\_type panel own\_window\_hints undecorated,below,sticky,skip\_taskbar,skip\_pager
For me this works, even though I don't use compiz and 14.04. After applying new values to `.conkyrc` did you restart conky in terminal like this `killall conky`, then `conky`? > > background yes > > update\_interval 1 > > > use\_xft yes > override\_utf8\_locale yes > > xftalpha 0.84 > > uppercase no > > ...
521,170
I recently upgraded from 12.04 tot 14.04, gnome flashback Compiz. Conky tranparant behaves abnormally now and I can't fix it. Transparency turned off, conky acts normally. Transparency turned on, it is as if upon each refresh, the previous layer isn't removed, so they stack onto eachother. See screenshots: no trans...
2014/09/07
[ "https://askubuntu.com/questions/521170", "https://askubuntu.com", "https://askubuntu.com/users/65499/" ]
I've run into same problem. Transparency does not work with window\_type override. And window\_type desktop disappears on show\_desktop. I've come up with this config for ubuntu 14.04 with unity and compiz own\_window\_type panel own\_window\_hints undecorated,below,sticky,skip\_taskbar,skip\_pager
I fixed it with this setup ``` -- — WINDOW — # own_window_argb_visual = true, own_window_argb_value=0, own_window=true, own_window_transparent=true, own_window_hints='undecorated,below,sticky,skip_taskbar,skip_pager', -- — BORDER — # border_inner_margin = 1, border_outer_margin = 1, bo...
44,234,704
I created a template class Number. I overloaded << operator but I'm not able to get % operator working. ``` template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number() :n{ t() } {}; friend ostream & operator<<<>(ostream & os, const Number<t>& a); friend Number<t> oper...
2017/05/29
[ "https://Stackoverflow.com/questions/44234704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8058876/" ]
You should first declare the operator as a function template before "befriending" it in the class. See [this](http://en.cppreference.com/w/cpp/language/friend#Template_friend_operators) and [this](https://stackoverflow.com/questions/4660123/overloading-friend-operator-for-template-class) for more details on how to prop...
Define these functions in the class body and save yourself the hassle. Also, in case that the left-hand side operand of `%` is `Number` you don't have to make it a friend. ``` #include <iostream> using std::ostream; template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number(...
44,234,704
I created a template class Number. I overloaded << operator but I'm not able to get % operator working. ``` template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number() :n{ t() } {}; friend ostream & operator<<<>(ostream & os, const Number<t>& a); friend Number<t> oper...
2017/05/29
[ "https://Stackoverflow.com/questions/44234704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8058876/" ]
**Method 1** Declare the functions before the definition of the class template. ``` template <typename t> class Number; template <typename t> std::ostream & operator<<(std::ostream & os, const Number<t>& a); template <typename t> Number<t> operator%(Number<t> a, Number<t> b); ``` Define the class. Make sure the `...
Define these functions in the class body and save yourself the hassle. Also, in case that the left-hand side operand of `%` is `Number` you don't have to make it a friend. ``` #include <iostream> using std::ostream; template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number(...
44,234,704
I created a template class Number. I overloaded << operator but I'm not able to get % operator working. ``` template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number() :n{ t() } {}; friend ostream & operator<<<>(ostream & os, const Number<t>& a); friend Number<t> oper...
2017/05/29
[ "https://Stackoverflow.com/questions/44234704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8058876/" ]
**Method 1** Declare the functions before the definition of the class template. ``` template <typename t> class Number; template <typename t> std::ostream & operator<<(std::ostream & os, const Number<t>& a); template <typename t> Number<t> operator%(Number<t> a, Number<t> b); ``` Define the class. Make sure the `...
You should first declare the operator as a function template before "befriending" it in the class. See [this](http://en.cppreference.com/w/cpp/language/friend#Template_friend_operators) and [this](https://stackoverflow.com/questions/4660123/overloading-friend-operator-for-template-class) for more details on how to prop...
44,234,704
I created a template class Number. I overloaded << operator but I'm not able to get % operator working. ``` template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number() :n{ t() } {}; friend ostream & operator<<<>(ostream & os, const Number<t>& a); friend Number<t> oper...
2017/05/29
[ "https://Stackoverflow.com/questions/44234704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8058876/" ]
You should first declare the operator as a function template before "befriending" it in the class. See [this](http://en.cppreference.com/w/cpp/language/friend#Template_friend_operators) and [this](https://stackoverflow.com/questions/4660123/overloading-friend-operator-for-template-class) for more details on how to prop...
You could make the friend operator a templated operator itself: ``` template<typename t> class Number { private: t n; public: Number(t a) :n ( a ){}; Number() :n( t() ) {}; template<typename TT> friend Number<TT> operator%(Number<TT> a,const Number<TT>& b); }; template<typename t> Number<t> ope...
44,234,704
I created a template class Number. I overloaded << operator but I'm not able to get % operator working. ``` template<typename t> class Number { private: t n; public: Number(t a) :n{ a } {}; Number() :n{ t() } {}; friend ostream & operator<<<>(ostream & os, const Number<t>& a); friend Number<t> oper...
2017/05/29
[ "https://Stackoverflow.com/questions/44234704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8058876/" ]
**Method 1** Declare the functions before the definition of the class template. ``` template <typename t> class Number; template <typename t> std::ostream & operator<<(std::ostream & os, const Number<t>& a); template <typename t> Number<t> operator%(Number<t> a, Number<t> b); ``` Define the class. Make sure the `...
You could make the friend operator a templated operator itself: ``` template<typename t> class Number { private: t n; public: Number(t a) :n ( a ){}; Number() :n( t() ) {}; template<typename TT> friend Number<TT> operator%(Number<TT> a,const Number<TT>& b); }; template<typename t> Number<t> ope...
40,343,301
I searched a lot but could not get correct / updated answer (*arguments.caller.callee does not exist it seems*). I want to know the code line number where a particular function is called. I got [**this**](https://stackoverflow.com/a/30687518/5336818) solution where function caller name can be retrieved . But I am call...
2016/10/31
[ "https://Stackoverflow.com/questions/40343301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5336818/" ]
If you use `console.error()`, it will show the call stack and the line numbers (at least in Chrome, when you click the small black arrow): ``` function foo(){ bar(); } function bar(){ console.error("hello"); } foo(); ``` Will show: [![enter image description here](https://i.stack.imgur.com/1Y7HB.jpg)](htt...
I have try with `try` `catch` `throw` Note: snippet works inside a `iframe` so line wont be correctly. ```js var i = 2016; i++; var str = "Happy new year "+i; try{ clog();throw new error("l"); }catch(e){ console.log("current line: "+e.stack.split(" at ")[1]);//current file and line } function clog(){ con...
63,569,186
I'm exporting a Google Docs and convert it with <https://github.com/facundoolano/googledoc2latex>. (It's the most accurate and free tool I've found so far). Footnotes from Docs are (as in the html version) below the text. ``` [text] This is an example.$^{[1]}$ I like it.$^{[2]}$ [text] [1] I'm a footnote! [2] I'm als...
2020/08/24
[ "https://Stackoverflow.com/questions/63569186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461754/" ]
There are many ways this can be achieved, one quick way is that you can have some flags in the form of properties in the page as following: ``` public bool IsStepOneSuccess { get; set; } public bool IsStepTwoSuccess { get; set; } public bool IsStepThreeSuccess { get; set; } ``` And you can raise these flags as true ...
It seems like a bug in the asp.net core framework. <https://github.com/dotnet/aspnetcore/issues/13275>
60,928,007
I have a process that builds a cell with a calculation of different values ``` Val_1 = [A1] Val_2 = [A2] [E1] = "=-" & Val_1 & " -" & Val_2 ``` This builds a formula so that the users can see how the output is calculated for example ``` E1 =-123 -234 ``` I have this VBA code running correctly in UK, but when the ...
2020/03/30
[ "https://Stackoverflow.com/questions/60928007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2148939/" ]
No need to use `dplyr`, simple base-R is enough, with the `match`-function. ``` largedataset$Val <- lookuptable$Val[match(largedataset$Lookup, lookuptable$Lookup)] ``` If you need to do the lookup more often and have a really large lookuptable, there may be some benefit in using the `fastmatch`-package with the simi...
If you prefer to use `dplyr` package, use `left_join` function: ``` library(dplyr) bigDF %>% left_join(lookupDF) # Joining, by = "Lookup" # A tibble: 11 x 5 # Species Site Present Lookup Val # <chr> <chr> <dbl> <chr> <dbl> # 1 A A1 1 Aa1 12 # 2 A A2 0 Ab2 15 #...
17,376,932
How would one go about implementing Pipeline architecture in terms of OOP? To better explain myself: ``` Source -> Filter -> Filter -> Filter -> Sink ``` Let's say we have a base class called PipelineStage. How would one implement Filter, Source and Sink? I have 2 ideas : With ISource and ISink interfaces![ISink ...
2013/06/29
[ "https://Stackoverflow.com/questions/17376932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189755/" ]
Logging on iOS is a bit different than logging on a desktop/server application, as the user has no (easy) way to retrieve the logs. There are multiple options though: 1. For your own debugging purposes: use `System.Console.WriteLine()`. That's equivalent to Obj-C `NSLog` 2. For remote logging: use a third party fra...
I forked Apache log4net and made it compile under MonoTouch with some essential appenders. Expect bugs since it's not fully tested, but it's a start. [monotouch-log4net @ GitHub](https://github.com/drunkirishcoder/monotouch-log4net)
17,376,932
How would one go about implementing Pipeline architecture in terms of OOP? To better explain myself: ``` Source -> Filter -> Filter -> Filter -> Sink ``` Let's say we have a base class called PipelineStage. How would one implement Filter, Source and Sink? I have 2 ideas : With ISource and ISink interfaces![ISink ...
2013/06/29
[ "https://Stackoverflow.com/questions/17376932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189755/" ]
Logging on iOS is a bit different than logging on a desktop/server application, as the user has no (easy) way to retrieve the logs. There are multiple options though: 1. For your own debugging purposes: use `System.Console.WriteLine()`. That's equivalent to Obj-C `NSLog` 2. For remote logging: use a third party fra...
[Crittercism](http://www.crittercism.com) just released an official crash reporting and logging framework for Xamarin (Full disclosure: I'm one of the co-founders). It has full support for automatically logging unhandled exceptions and signals (signals like SIGSEGV are handled gracefully by letting the Mono runtime han...
17,376,932
How would one go about implementing Pipeline architecture in terms of OOP? To better explain myself: ``` Source -> Filter -> Filter -> Filter -> Sink ``` Let's say we have a base class called PipelineStage. How would one implement Filter, Source and Sink? I have 2 ideas : With ISource and ISink interfaces![ISink ...
2013/06/29
[ "https://Stackoverflow.com/questions/17376932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189755/" ]
Logging on iOS is a bit different than logging on a desktop/server application, as the user has no (easy) way to retrieve the logs. There are multiple options though: 1. For your own debugging purposes: use `System.Console.WriteLine()`. That's equivalent to Obj-C `NSLog` 2. For remote logging: use a third party fra...
I think you can use Xamarin Insights for logging. [Xamarin Insights](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0CCgQFjAC&url=http%3A%2F%2Fdeveloper.xamarin.com%2Fguides%2Fcross-platform%2Finsights%2Fapplication%2F&ei=mOgIVd6FJJKTuATxtICACA&usg=AFQjCNG2K7A-i_yBHPIP1ciBBgdtL3VSe...
17,376,932
How would one go about implementing Pipeline architecture in terms of OOP? To better explain myself: ``` Source -> Filter -> Filter -> Filter -> Sink ``` Let's say we have a base class called PipelineStage. How would one implement Filter, Source and Sink? I have 2 ideas : With ISource and ISink interfaces![ISink ...
2013/06/29
[ "https://Stackoverflow.com/questions/17376932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189755/" ]
I think you can use Xamarin Insights for logging. [Xamarin Insights](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0CCgQFjAC&url=http%3A%2F%2Fdeveloper.xamarin.com%2Fguides%2Fcross-platform%2Finsights%2Fapplication%2F&ei=mOgIVd6FJJKTuATxtICACA&usg=AFQjCNG2K7A-i_yBHPIP1ciBBgdtL3VSe...
I forked Apache log4net and made it compile under MonoTouch with some essential appenders. Expect bugs since it's not fully tested, but it's a start. [monotouch-log4net @ GitHub](https://github.com/drunkirishcoder/monotouch-log4net)
17,376,932
How would one go about implementing Pipeline architecture in terms of OOP? To better explain myself: ``` Source -> Filter -> Filter -> Filter -> Sink ``` Let's say we have a base class called PipelineStage. How would one implement Filter, Source and Sink? I have 2 ideas : With ISource and ISink interfaces![ISink ...
2013/06/29
[ "https://Stackoverflow.com/questions/17376932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189755/" ]
I think you can use Xamarin Insights for logging. [Xamarin Insights](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0CCgQFjAC&url=http%3A%2F%2Fdeveloper.xamarin.com%2Fguides%2Fcross-platform%2Finsights%2Fapplication%2F&ei=mOgIVd6FJJKTuATxtICACA&usg=AFQjCNG2K7A-i_yBHPIP1ciBBgdtL3VSe...
[Crittercism](http://www.crittercism.com) just released an official crash reporting and logging framework for Xamarin (Full disclosure: I'm one of the co-founders). It has full support for automatically logging unhandled exceptions and signals (signals like SIGSEGV are handled gracefully by letting the Mono runtime han...
3,698,252
Let $p$ be a prime and $k$ be an integer greater or equal to $1$. Then $φ(p^k) = p^k - p^{k-1}$.
2020/05/30
[ "https://math.stackexchange.com/questions/3698252", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
For one thing, $\varphi(p)\equiv 2\pmod 4$ for all primes $p$ such that $p\equiv 3\pmod 4$. The set of such primes is infinite.
**Hint:** $\phi(n)$ is even for $n > 2$.
3,698,252
Let $p$ be a prime and $k$ be an integer greater or equal to $1$. Then $φ(p^k) = p^k - p^{k-1}$.
2020/05/30
[ "https://math.stackexchange.com/questions/3698252", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint**: For any prime $p\equiv 3\mod 4$, you have $\varphi(p)=p-1\equiv2\mod4$.
**Hint:** $\phi(n)$ is even for $n > 2$.
3,698,252
Let $p$ be a prime and $k$ be an integer greater or equal to $1$. Then $φ(p^k) = p^k - p^{k-1}$.
2020/05/30
[ "https://math.stackexchange.com/questions/3698252", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint**: For any prime $p\equiv 3\mod 4$, you have $\varphi(p)=p-1\equiv2\mod4$.
For one thing, $\varphi(p)\equiv 2\pmod 4$ for all primes $p$ such that $p\equiv 3\pmod 4$. The set of such primes is infinite.
3,698,252
Let $p$ be a prime and $k$ be an integer greater or equal to $1$. Then $φ(p^k) = p^k - p^{k-1}$.
2020/05/30
[ "https://math.stackexchange.com/questions/3698252", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
For one thing, $\varphi(p)\equiv 2\pmod 4$ for all primes $p$ such that $p\equiv 3\pmod 4$. The set of such primes is infinite.
Excepting $2$ and $3$, primes are of the form $p=6k\pm1$. Since $\varphi(p)=p-1$ for a prime, we have $\varphi(p)=6k$ or $\varphi(p)=6k-2$ for such primes. For $p=6k+1$, we require $\varphi(p)=6k\equiv2\pmod{4}$ which is satisfied when $k$ is odd. As there are an infinite number of primes of the form $12j+7$ (equivale...
3,698,252
Let $p$ be a prime and $k$ be an integer greater or equal to $1$. Then $φ(p^k) = p^k - p^{k-1}$.
2020/05/30
[ "https://math.stackexchange.com/questions/3698252", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint**: For any prime $p\equiv 3\mod 4$, you have $\varphi(p)=p-1\equiv2\mod4$.
Excepting $2$ and $3$, primes are of the form $p=6k\pm1$. Since $\varphi(p)=p-1$ for a prime, we have $\varphi(p)=6k$ or $\varphi(p)=6k-2$ for such primes. For $p=6k+1$, we require $\varphi(p)=6k\equiv2\pmod{4}$ which is satisfied when $k$ is odd. As there are an infinite number of primes of the form $12j+7$ (equivale...
30,092,280
A similar question was posted previously (it never got an answer). That question was asked before Card.io decided to go open source. [Fetch a credit card number from the CardIO adding on the STPView (Stripe) - iOS](https://stackoverflow.com/questions/25062783/fetch-a-credit-card-number-from-the-cardio-adding-on-the-s...
2015/05/07
[ "https://Stackoverflow.com/questions/30092280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4873281/" ]
Dave from card.io here. card.io simply provides a way for you to collect credit card information from your customer, with that information being returned directly to your app. What your app then does with that information is entirely up to you. card.io runs entirely on the mobile device. No servers, PayPal or otherwi...
I have specifically used Card.io in my app on the App Store (Search Impulse Car on the app store if you want proof) with Stripe and did not implement PayPal. There is an PayPal image that comes default, but it's easily removed.
7,721,784
I got a cstring, originating from a call from gzread. I know the data is blocks, and each block is consisting of an unsigned int, char, int and unsigned short int. So I was wondering what the standard way of splitting this cstring into the appropriate variables is. Say the first 4 bytes, is a unsigned int, the next b...
2011/10/11
[ "https://Stackoverflow.com/questions/7721784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237472/" ]
If you pack the struct (read up on `__packed__` attribute), you can rely on the order and that the members are non-aligned. Hence, you could read into a struct directly. However, I'm not sure about the portability of this solution. Otherwise, use pointer magic and casting like so: ``` char *buffer; int a = *(reinterp...
You need to make sure that the byte order of the file matches the processor architecture you're running your code on. If, for instance, the integers are written to file with most significant byte first and your processor uses least significant byte first order, you're getting garbage for results. If you want to make y...
7,721,784
I got a cstring, originating from a call from gzread. I know the data is blocks, and each block is consisting of an unsigned int, char, int and unsigned short int. So I was wondering what the standard way of splitting this cstring into the appropriate variables is. Say the first 4 bytes, is a unsigned int, the next b...
2011/10/11
[ "https://Stackoverflow.com/questions/7721784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237472/" ]
If you pack the struct (read up on `__packed__` attribute), you can rely on the order and that the members are non-aligned. Hence, you could read into a struct directly. However, I'm not sure about the portability of this solution. Otherwise, use pointer magic and casting like so: ``` char *buffer; int a = *(reinterp...
It depends on how the input data is defined. If it's defined to be in host-endian order (that is, the endianness always matches the system on which your code is running), then the `memcpy()` you have shown is a good, portable method to use. Alternatively, if the input data is defined to have a particular endianness, t...
7,721,784
I got a cstring, originating from a call from gzread. I know the data is blocks, and each block is consisting of an unsigned int, char, int and unsigned short int. So I was wondering what the standard way of splitting this cstring into the appropriate variables is. Say the first 4 bytes, is a unsigned int, the next b...
2011/10/11
[ "https://Stackoverflow.com/questions/7721784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237472/" ]
If you pack the struct (read up on `__packed__` attribute), you can rely on the order and that the members are non-aligned. Hence, you could read into a struct directly. However, I'm not sure about the portability of this solution. Otherwise, use pointer magic and casting like so: ``` char *buffer; int a = *(reinterp...
You need a specification of the format before you can do anything. Is it text or binary (presumably binary from your description, but one never knows)? What is the representation used for signed values? What is the byte order? `memcpy` will only work if your machine architecture corresponds exactly to that of the input...
7,721,784
I got a cstring, originating from a call from gzread. I know the data is blocks, and each block is consisting of an unsigned int, char, int and unsigned short int. So I was wondering what the standard way of splitting this cstring into the appropriate variables is. Say the first 4 bytes, is a unsigned int, the next b...
2011/10/11
[ "https://Stackoverflow.com/questions/7721784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237472/" ]
You need to make sure that the byte order of the file matches the processor architecture you're running your code on. If, for instance, the integers are written to file with most significant byte first and your processor uses least significant byte first order, you're getting garbage for results. If you want to make y...
It depends on how the input data is defined. If it's defined to be in host-endian order (that is, the endianness always matches the system on which your code is running), then the `memcpy()` you have shown is a good, portable method to use. Alternatively, if the input data is defined to have a particular endianness, t...
7,721,784
I got a cstring, originating from a call from gzread. I know the data is blocks, and each block is consisting of an unsigned int, char, int and unsigned short int. So I was wondering what the standard way of splitting this cstring into the appropriate variables is. Say the first 4 bytes, is a unsigned int, the next b...
2011/10/11
[ "https://Stackoverflow.com/questions/7721784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237472/" ]
You need to make sure that the byte order of the file matches the processor architecture you're running your code on. If, for instance, the integers are written to file with most significant byte first and your processor uses least significant byte first order, you're getting garbage for results. If you want to make y...
You need a specification of the format before you can do anything. Is it text or binary (presumably binary from your description, but one never knows)? What is the representation used for signed values? What is the byte order? `memcpy` will only work if your machine architecture corresponds exactly to that of the input...
60,006,800
I have a table T with two columns. Column A is a varchar column and Column B is a XML column. Somewhere inside Column B there is always the following parent tag: `<Documents> ... </Documents>`. Inside there are some `<Document>...</Document>` children. I would like to get a result set with two columns: Column 1 shou...
2020/01/31
[ "https://Stackoverflow.com/questions/60006800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4551565/" ]
[`discord.File`](https://discordpy.readthedocs.io/en/latest/api.html#discord.File) supports passing [`io.BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase) as the `fp` parameter. [`io.BytesIO`](https://docs.python.org/3/library/io.html#io.BytesIO) inherits from `io.BufferedIOBase`. This...
It seems like @Harmon758 no longer work as expected using `discord.py` If you pass `io.BytesIO` to `discord.File` you need the parameter filename as well, otherwise the client will not send the image. So just add the name ```py arr = io.BytesIO() img.save(arr, format='PNG') arr.seek(0) file = discord.File(fp=arr, fi...
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
The simple solution is one I just found after reading your question. Define your `::resource` routes **after** any `::get` or `::post` routes. I just tested on 4.2 and it's working (after having the same issue).
I know this is an old question but if somebody is still having this problem in Laravel 8,this worth for me: ``` Route::resource('tags',TagController::class)->except(['show']); ```
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
The simple solution is one I just found after reading your question. Define your `::resource` routes **after** any `::get` or `::post` routes. I just tested on 4.2 and it's working (after having the same issue).
I was having same issue but it was weird one. In my routes file I had: ``` Route::controller('carts', 'CartsApiController'); ``` When I changed it to: ``` Route::controller('cart', 'CartsApiController'); ``` Everything was fine and I did not have the error again. I am not sure but seems like some naming issue.
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
Add the custom route before the resource routes in your routes file. As per Laravel documentation: > > If it becomes necessary to add additional routes to a resource controller beyond the default resource routes, you should define those routes before your call to Route::resource; otherwise, the routes defined by the...
I know this is an old question but if somebody is still having this problem in Laravel 8,this worth for me: ``` Route::resource('tags',TagController::class)->except(['show']); ```
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
I have experienced the same problem as you. The problem ends up with rearranging the resource code, i.e. ``` Route::get('masterprices/data', 'MasterPriceController@data'); Route::get( 'masterprices/upload', 'MasterPriceController@upload'); Route::post('masterprices/upload', 'MasterPriceController@do_upload'); Route::g...
I know this is an old question but if somebody is still having this problem in Laravel 8,this worth for me: ``` Route::resource('tags',TagController::class)->except(['show']); ```
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
This one: ``` Route::resource('users','UserController'); ``` defines following routes: ``` | GET|HEAD users | users.index | UsersController@index | GET|HEAD users/create | users.create | UsersController@create | POST users | users.store | UsersController@store | GET|...
Add the custom route before the resource routes in your routes file. As per Laravel documentation: > > If it becomes necessary to add additional routes to a resource controller beyond the default resource routes, you should define those routes before your call to Route::resource; otherwise, the routes defined by the...
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
The problem list with the `Route::resource` call. By including that statement, you're telling Laravel that you want to use a RESTful controller for paths that start with `users`. This means that when you hit the URL 'users/login', the RESTful controller interprets that as a "show" action for the `user` controller and f...
I also have faced the same problem but i found it very dumb and silly mistake one use route like this : - ``` Route::get('users/login', ['uses'=>'UserController@login', 'as'=> 'userLogin']); ``` and in your view or controller use route('userLogin'); for route to that particular function in your controller
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
The problem list with the `Route::resource` call. By including that statement, you're telling Laravel that you want to use a RESTful controller for paths that start with `users`. This means that when you hit the URL 'users/login', the RESTful controller interprets that as a "show" action for the `user` controller and f...
I know this is an old question but if somebody is still having this problem in Laravel 8,this worth for me: ``` Route::resource('tags',TagController::class)->except(['show']); ```
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
I have experienced the same problem as you. The problem ends up with rearranging the resource code, i.e. ``` Route::get('masterprices/data', 'MasterPriceController@data'); Route::get( 'masterprices/upload', 'MasterPriceController@upload'); Route::post('masterprices/upload', 'MasterPriceController@do_upload'); Route::g...
Add the custom route before the resource routes in your routes file. As per Laravel documentation: > > If it becomes necessary to add additional routes to a resource controller beyond the default resource routes, you should define those routes before your call to Route::resource; otherwise, the routes defined by the...
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
This one: ``` Route::resource('users','UserController'); ``` defines following routes: ``` | GET|HEAD users | users.index | UsersController@index | GET|HEAD users/create | users.create | UsersController@create | POST users | users.store | UsersController@store | GET|...
The simple solution is one I just found after reading your question. Define your `::resource` routes **after** any `::get` or `::post` routes. I just tested on 4.2 and it's working (after having the same issue).
22,943,570
When trying to access this URL 'users/login' I got that error, Here is my code : View users/login.blade.php : ``` <head>Sign in : </head> <body> {{ HTML::ul($errors->all()) }} <?php echo Form::open(array('url' => 'users')); echo '<div class="form-group">'; echo Form::label('username', 'User Name'); echo Fo...
2014/04/08
[ "https://Stackoverflow.com/questions/22943570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891623/" ]
This one: ``` Route::resource('users','UserController'); ``` defines following routes: ``` | GET|HEAD users | users.index | UsersController@index | GET|HEAD users/create | users.create | UsersController@create | POST users | users.store | UsersController@store | GET|...
I also have faced the same problem but i found it very dumb and silly mistake one use route like this : - ``` Route::get('users/login', ['uses'=>'UserController@login', 'as'=> 'userLogin']); ``` and in your view or controller use route('userLogin'); for route to that particular function in your controller
60,136,377
I've been trying this for some days but I can't seem to find a way to do it. I have a two dataframes. One named "df1" with two variables: date, price ``` date price 2019-12-21 140 2019-10-25 91 2019-10-24 91 2019-12-13 70 ``` Another one, named "df2"...
2020/02/09
[ "https://Stackoverflow.com/questions/60136377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12867050/" ]
It is a warning, [as explained here](https://stackoverflow.com/a/57237705/6309). Try a regenerate, for testing, a new set of keys, making sure [you do not use pageant/putty](https://winscp.net/eng/docs/ui_pageant), but [only openssh](https://stackoverflow.com/a/35111050/6309). And don't protect it with a passphrase...
``` find .git/objects/ -size 0 -exec rm -f {} \; ``` this fixed it for me, I had corrupt and empty objects
2,243,817
I created one web application in eclipse and successfully deployed it on google app engine. Then i do some modification in my program. How to do changes in the deployed application. Is their any option for redeployment?
2010/02/11
[ "https://Stackoverflow.com/questions/2243817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/302593/" ]
If you have the google app engine plugin just click on the deploy button and it will re-deploy the whole application.
1. Update the version number in [appengine-web.xml](http://code.google.com/appengine/docs/java/config/appconfig.html#About_appengine_web_xml). 2. [Re-deploy](http://code.google.com/appengine/docs/java/tools/uploadinganapp.html) using the Google App Engine [Eclipse plugin](http://code.google.com/appengine/docs/java/gett...
41,846,845
I need some help regarding a web application that I am doing. I need to copy the entire data from group A to group B that is in the same database table. However, there will be cases where the data are the same. Here is one example of my database table ``` id Name Age Group ----------------------- 1 Alpha 11...
2017/01/25
[ "https://Stackoverflow.com/questions/41846845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3966887/" ]
An example in PostgreSQL. With duplicate\_id\_list you have the ids which are duplicate. You can use this in a delete query to remove all except the first id in the list. ``` SELECT Name,Age,count(id),string_agg(id, ', ') AS duplicate_id_list FROM yourtable GROUP BY Name,Age having count(*) > 1 ```
You can use `group by` with `count` to get all the name-age combinations that exist in multiple groups, e.g: ``` SELECT name, age, COUNT(DISTINCT `group`) AS groups FROM test GROUP BY name, age HAVING groups > 1; ``` Here is the **[SQL Fiddle](http://sqlfiddle.com/#!9/94c2b2/4/0)**.
41,846,845
I need some help regarding a web application that I am doing. I need to copy the entire data from group A to group B that is in the same database table. However, there will be cases where the data are the same. Here is one example of my database table ``` id Name Age Group ----------------------- 1 Alpha 11...
2017/01/25
[ "https://Stackoverflow.com/questions/41846845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3966887/" ]
To find the duplicates IDs of group B, do a inner self-join like this: ``` SELECT tb.id FROM YourTable AS ta JOIN YourTable AS tb ON ta.name=tb.name AND ta.age=tb.age WHERE ta.group='A' AND tb.group='B' ``` You can the use this in a delete, which will remove the duplicated records from group B only a...
You can use `group by` with `count` to get all the name-age combinations that exist in multiple groups, e.g: ``` SELECT name, age, COUNT(DISTINCT `group`) AS groups FROM test GROUP BY name, age HAVING groups > 1; ``` Here is the **[SQL Fiddle](http://sqlfiddle.com/#!9/94c2b2/4/0)**.
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
Try ``` StackTraceElement[] stack = Thread.currentThread().getStackTrace(); ``` Then you can iterate over the collection to show the top x stack elements you're interested in.
Since Java 5 you have the getStackTrace() method of Thread class. For prior versions you can do: ``` Thread.currentThread().dumpStack(); ``` This will print the stack trace to System.out
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
In the console, press V rather than T: ``` t: dump thread list v: dump thread stack ``` This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: *Under Windows:* type ctrl-break in the Java console. *Under Un...
Try ``` StackTraceElement[] stack = Thread.currentThread().getStackTrace(); ``` Then you can iterate over the collection to show the top x stack elements you're interested in.
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
Recent JDKs (sadly not JREs) include tools like jstack which does such things. JVMs from version 5 include JMX extensions to get thread dumps, memory statistics, and much more. All java applications, including web start applications, have this functionality available. You would either need to have the JDK installed or...
Since Java 5 you have the getStackTrace() method of Thread class. For prior versions you can do: ``` Thread.currentThread().dumpStack(); ``` This will print the stack trace to System.out
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
In the console, press V rather than T: ``` t: dump thread list v: dump thread stack ``` This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: *Under Windows:* type ctrl-break in the Java console. *Under Un...
Recent JDKs (sadly not JREs) include tools like jstack which does such things. JVMs from version 5 include JMX extensions to get thread dumps, memory statistics, and much more. All java applications, including web start applications, have this functionality available. You would either need to have the JDK installed or...
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
Since 1.5 you can use `Thread.getAllStackTraces()` to get a `Map` to iterate over. The ideal output would be that produced from Ctrl-\ (or Ctrl-Break or similar), but there doesn't seem to be a documented way of producing this. If you are willing to limit yourself to sun's JVM (or use reflection I suppose) you could h...
Since Java 5 you have the getStackTrace() method of Thread class. For prior versions you can do: ``` Thread.currentThread().dumpStack(); ``` This will print the stack trace to System.out
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
In the console, press V rather than T: ``` t: dump thread list v: dump thread stack ``` This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: *Under Windows:* type ctrl-break in the Java console. *Under Un...
Since Java 5 you have the getStackTrace() method of Thread class. For prior versions you can do: ``` Thread.currentThread().dumpStack(); ``` This will print the stack trace to System.out
90,682
Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically? In the Java Web Start Console I can get ...
2008/09/18
[ "https://Stackoverflow.com/questions/90682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15646/" ]
In the console, press V rather than T: ``` t: dump thread list v: dump thread stack ``` This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: *Under Windows:* type ctrl-break in the Java console. *Under Un...
Since 1.5 you can use `Thread.getAllStackTraces()` to get a `Map` to iterate over. The ideal output would be that produced from Ctrl-\ (or Ctrl-Break or similar), but there doesn't seem to be a documented way of producing this. If you are willing to limit yourself to sun's JVM (or use reflection I suppose) you could h...
226,609
The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm: 1. First, find the base \$ b \$...
2021/06/01
[ "https://codegolf.stackexchange.com/questions/226609", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/96156/" ]
JavaScript (ES6), 44 bytes ========================== * -1 byte by applying a crazy bit-wise expression as suggested by [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld). ```javascript b=>g=(x,y)=>(s=~-x-~y)&&s*~-b%b+g(x/b,y/b)*b ``` [Try it online!](https://tio.run/##ZZBRb4IwEIDf@yvuZdpqgRYLczHlbb9...
[Pip](https://github.com/dloscutoff/pip), ~~29~~ 23 bytes ========================================================= ``` {Y-$+ay&y%b+b*(fa//bb)} ``` Stretching the input format a bit, this submission is function that takes two arguments: a two-element list containing \$x\$ and \$y\$, and an integer \$b\$. [Try it onl...
226,609
The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm: 1. First, find the base \$ b \$...
2021/06/01
[ "https://codegolf.stackexchange.com/questions/226609", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/96156/" ]
[Python 2](https://docs.python.org/2/), 45 bytes ================================================ ```python f=lambda b,x,y:x+y and-(x+y)%b+f(b,x/b,y/b)*b ``` [Try it online!](https://tio.run/##ZdDRaoMwGAXg@zzFQRhN1n9tYqPrCvZJdmOosoCzYsMwT@/@VL0YCxjid06UZIjh697n89xWXf3tbjUcTRQv0z6i7m9vkhfqxe1byX50FI9Ovbo5oEKWZSJ/NznB...
[Pip](https://github.com/dloscutoff/pip), ~~29~~ 23 bytes ========================================================= ``` {Y-$+ay&y%b+b*(fa//bb)} ``` Stretching the input format a bit, this submission is function that takes two arguments: a two-element list containing \$x\$ and \$y\$, and an integer \$b\$. [Try it onl...