@BlackMouse that's what you should do. But better you post what you have tried here. So people can decide where you need help. If you want a better way, your question should go to codereview. — Mritunjay1 min ago
write a program that is able to load and read the contents of a data (text) file containing weather information of a particular city, compute and show useful statistics, and search for information. The sample data file provided (weather.txt) contains information spanning 4 years (2012-2015) from ...
I'm in the process of (hopefully) finishing up my first Dockerfile, and I was wondering if I'd be able to post it here, and see if I'm using Docker right, if the commands (it's based on Ubuntu so they're bash) could be improved etc.
@Zak I have an OpenOffice Calc file to manually convert from XML into CSV. 14MB of bad XML. It has around 365 tables. I need to convert around 24 tables. 2 tables took me 3 hours
This small utility class is my solution for a more convenient way for checking against null. I also wanted to have more invormative NullReferenceExceptions but I didn't want to polute my code with null checks everywhere.
static class NullGuard
{
public static T Check<T>(Expression<Func<T>> e...
it needs a literal upgrade to everything, so I'd rather just cry every time I pretend I can play a quarter of my steam library, and wait a few weeks to buy a good rig and new macbook
@Vogel612 I'm planning on building a rig soon that I'll have Windows and Linux (probably ubuntu caus im linux n00b) installed on, so yeah, but most of the big games support both, even Arma 3 these days. It's the indie games that get ya
Optimization is not really a suitable SO topic. Code Review is more suited to that, but even there you would need to, as a minimum, include the definition of the getFields method, and clarify what you mean by optimize - faster to execute? Easier to read? simply less lines/chars? — Steve59 secs ago
@Vogel612 ArchLinux is a great one. You start with ... a kernel? And nothing else. Then you install what you want. That is a good idea!!! ... If you know what you are doing...
SpaghettiOs is an American brand of canned spaghetti featuring circular pasta shapes in a cheese and tomato sauce — and marketed to parents as "less messy" than regular spaghetti. More than 150 million cans of SpaghettiOs are sold each year.
In addition to the original variety, variations have included SpaghettiOs Meatballs (with miniature meatballs), SpaghettiOs Sliced Franks (with pieces of processed meat resembling hot dog slices), SpaghettiOs RavioliOs (with round, beef-filled ravioli), SpaghettiOs with Calcium, and other theme-shaped varieties.
Similar products are sold in the United Kingdom...
@Quill The only one that isn't weird from that list is "Caixa Mágica", which means "Magic Box". It is, basically, based with the idea that you are working in a "box". It's great for kids
I am implementing a smart pointer class template and I want to overload operator ->* (even if it’s rarely done). I came across Scott Meyer’s article Implementing operator ->* for Smart Pointers. The article is from 1999 so I decided to try to adapt the code for C++ 14 (using parameter packs and p...
Given a complex object (with nested objects at any depth) I need to be able to quickly retrieve a value for a given property name.
I have designed the following code, I would like to know:
How to tune my code for maximum performance considering passing a big object?
Am I missing some case in d...
I have the following enum extension method:
public static IList<SelectListItem> SelectListFor<T>()
{
Type enumType = typeof(T);
if (enumType.IsEnum)
{
return Enum.GetValues(enumType)
.Cast<int>()
.Where(i => !i.Equals(0))
.Select(e => new SelectListItem()
{
...
please help me. I'am using mingw as my compiler. how to compile it C source in my compiler ?. and would you explain me about gmp ? how to use it well ??
and one thing, I have a task to calculate pi number in 1 millions digits, I have 2 days to submit my task. Thanks.
You can transform this:
public static IList<SelectListItem> SelectListFor<T>()
{
Type enumType = typeof(T);
if (enumType.IsEnum)
{
return Enum.GetValues(enumType)
.Cast<int>()
.Where(i => !i.Equals(0))
.Select(e => new SelectListItem()
...
Although, asking for helping fixing broke or not-working-as-expected code, or resolving warnings is off-topic for Code Review. In future, you would have better luck on Stack Overflow. Once your code is working as expected, however, we would love to review it! — Quill1 min ago
@Quill I did read the msdn article but don't want to pass in a type otherwise I could have just made an extension method onto the enum itself. Also The code works - just fails review and if you can't ask about a code review failure on a code review site then what is this site for? — Pete17 secs ago
> if you can't ask about a code review failure on a code review site then what is this site for?
Your code failed code review because your code doesn't actually compile. Not because it needs a code review on this site. We only review working code. — Dan Pantry15 secs ago
I would be inclined to say if you code is failing Code Review then that is a problem, an issue. We are not here to say, here's how to fix your issue. We're here to review your working, complete code.
Code Review, like all Stack Exchange sites, limits questions to a certain topic. As stated on our tour and on-topic pages, the goal of Code Review is to take working code and make it better. Your question was asking about how to fix broken code, and was thus off-topic. There is a link in the o...
@JeroenVannevel The discussion is not irrelevant. It is a meta discussion about a misunderstanding. Whether you like the discussion or not is another question, but it is a question about a question. That's entirely what this chat room's primary purpose is.
How can I pyhtonmize/djangoize/dry my viws.py?
class AccountDetail(DetailView):
model = BankAccount
template_name = 'bank/account_detail.html'
def get(self, *args, **kwargs):
self.object = self.get_object()
if self.object.is_owner(self.request.user.citizen):
...
It's not about a misunderstanding, asking to fix an issue or problem is not what we do. We review, we don't provide a fix, saying "You can resolve this issue by doing Y" is what SO does
A warning about passing a char* to an int indicates potentially broken code. A warning saying "hey, try to prefer not doing this?" does not indicate antyhing broken at all.
Sometimes you need context to be able to make rules.
This is one of those times.
And the code in that specific example doesn't compile under gcc -Wall (which is the standard method of compiling C++).
C#, however, does not place such strictness on warnings
The warnings in the example you've linked are considerably more dangerous than the ones in the C# question and also the context of the questions are different. In C++, it's common to treat all warnings as errors. In C#, not so much (hello Stylecop).
I would like to have the code for one of my VBA functions reviewed. It takes in an array of data built from a source workbook, builds a set of "flags" based on the data in each row of the array. Then it creates a new finalRng array that will, based on a set of logic from the business, create ne...
Around the time of writing this post, this question was asked: Extension method to list enum values. The OP is asking how to "fix" their code so a specific warning doesn't pop up:
However, when I compile the code, I get the following warning:
CA1004 Consider a design where 'EnumExte...