I had the same problem, found a good hint on it here.
This is how I solved the problem.
var theListView = sender as ListView;
var theGridView = theListView.View as GridView;
foreach (var column in theGridView.Columns)
{
// Set the Width. Then clear it to cause the autosize.
column.Width...
@Jamal not ignorance, it's one of my peeves of stackoverflow... I try to find a nice question to answer, and by the time I have written my answer, 3 people have already done so and nicer too
I have a function that averages a set of percentages (in column E) between certain importance levels (column A, in this case between 1000 and 2000, not inclusive because the #000s designate breaks, not values) in a separate spreadsheet ('To Do') and displays that as a percentage.
Is there any be...
From the close queue I can see that three people voted to close and three voted to leave open, meaning that the question is gone from the close queue. Even though it has four close votes, I consider it on-topic. Here's why:
Your question contains code
You wrote that code
It looks like actual co...
using that answer
it be code
op wrote that code
it is actual code, not just some random crap pulled from teh interwebs
I am writing an application that either mirrors a file/directory into another location or creates a zip file "snap shot" of a file or directory and stores it in another location. The user is able to create "rules" where they define the source file/directory, the destination file/directory and if...
@skiwi If you want another encoding feel free to suggest it and I might implement it in the server. The goal is to support various kinds of formats, such as JSON, my simple method, and more...
It is not meant for real-time communication, only for turn-based games, so I don't think a few bytes here and there are very important
@Mat'sMug I got a question... SQL Server - look at this and tell me if this would work (specifically the WHERE conditions)
(SELECT COUNT inc.InjuryType
FROM inc
WHERE incType = 'SenttoHospital'
AND injType.InjuryType <> 'None')
FROM Incidents AS inc
INNER JOIN IncidentTypes AS incType ON inc.IncidenTypeId = incType.IncidentTypeId
INNER JOIN InjuryTypes AS injType ON inc.InjuryTypeId = injType.InjuryTypeId
INNER JOIN Treatments AS treat ON inc.TreatmentTypeId = treat.TreatmentTypeId
there are no enums in SQL Server - you can hack it with a check constraint limiting the values which go into a column, or you can have an int column which normalizes to another table of acceptable values
I just want to know whether I've done transaction handling well. Also what about the other types of transactions available in .NET with regard to this code snippet?
Also are there any redundant things in this code?
public void InsertAttendance(BindingList<IAttendance> attendanceList)
{
...
So, I've completed the community challenge! I want recommendations on how to improve this code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf8">
<title>Let's play Tic Tac Toe!</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascr...
So, I've completed the community challenge! I want recommendations on how to improve this code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf8">
<title>Let's play Tic Tac Toe!</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascr...
The Ultimate Tic-Tac-Toetm
Tic-Tac-Toe is boring. Let's code The Ultimate Tic-Tac-Toe, a whole different story.
Uh, what?
Each turn, you mark one of the small squares.
When you get three in a row on a small board, you’ve won that board.
To win the game, you need to win three smal...
@HassanAlthaf "I'm a self-taught programmer, I can code in HTML, CSS, PHP, jQuery, JavaScript, C#, Python and Pascal. I am currently trying to learn Assembly Language." You might learn the syntax, but it does not seem like you're really learning how to program.
So, this question has been bothering me for a long time now. It is asking for a review of one line of "code" which is really a spreadsheet formula.
Actually, it's not even asking for a review in my opinion. It seems to be directly asking for an alternative, which makes me think that it's SO ter...
I know there are discussions from time to time here to teach others some things, but they're usually in the intermediate or advanced section of a language and/or technology.
HTTP 2.0 is the next planned version of the HTTP network protocol used by the World Wide Web. It is based on SPDY. HTTP 2.0 is being developed by the Hypertext Transfer Protocol bis (httpbis) working group of the Internet Engineering Task Force. HTTP 2.0 would be the first new version of the HTTP protocol since HTTP 1.1, which was standardized in RFC 2616 in 1999.
== Background of HTTP 2.0 ==
HTTP 2.0 provides an optimized transport for HTTP semantics. While still supporting all the core features of HTTP 1.1, HTTP 2.0 strives to be more efficient in several ways. It is not just HTTP 1.1 and HTTP...
I am rewriting an old vb.net app in c#. I will not subject you to the old vb.net code that I am wrtiting(the original method that I have already refactored was over 700 lines long). So some context.
The following are what we call On Demand Reports. There is a stored procedure that these objects...
Although the general impression that I have of LINQ is that it tries to be too many things at once, like taking all the other Microsoft languages and shoving them into a blender.
Native T-SQL
I don't know enough about linq to do a proper code review for that, however as far as performance is concerned I think the T-SQL would take care of the expensive part of your query more efficiently.
The following query will not get you all the information from your entire query, b...
I have the following method for opening a file:
void TankFile::OpenForReading(const std::string & filename)
{
assert(!filename.empty());
errno = 0;
file.exceptions(0); // Don't throw
file.open(filename, (std::fstream::in | std::fstream::binary));
if (!file.is_open() || !fil...
I am creating a blackjack simulator in java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long. Is there a better way to do this other than if/else statements? I know a switch might work but that wouldn't make it much shor...
I found a connected components algorithm posted here on SO and modified it for my own purposes. It runs well for small input sets, but doesn't scale as well as I would like.
The largest set I've been able to handle with it has just under 10,000 nodes and took 109 seconds to process. I threw in ...
No, we can't review spreadsheet formulas.
Earlier I would have said yes. Because when you look at your points, I'd answer them like this:
It's code, that's for sure.
Yes, but you just don't have a lot of material. It's akin to reviewing a single line of code (and often a review of a single lin...
the if statements look really messy to me, I would much rather put this into a Switch and use 2 ternary operator statements so that I am only performing if calculations when I absolutely need to.
using the switch I was also able to get rid of the boolean variable and the assignments to that va...
@Pimgd if someone actually wrote a decent review of that, would you still think it can't be reviewed? IOW is the real question here should we review it?
I'm working on this Objective C programming assignment I found online. Not sure if I have met all the requirements. Any help or suggestion will be appreciated.
Part 6
a) Implement class A with properties a1, a2, and a3 (int, string, int).
b) New objects are automatically initialized to 1, "hel...
@DaggNabbit You're welcome to try, but if your answer starts off with "rewrite it as a macro", then it's a wrong answer IMHO. Because then it just becomes "how to improve spreadsheet formula?" -> turn it into a macro!
Then before you start programming anything else, read nearly all basic documentation out there, because else you will not understand anything about Android.
I have not made an attempt to create a professional Android app, we as an university project group did slap an app together in a few weeks with little to no experience beforehand and it worked kind of sometimes.
Also do some real investigation when you are going to use the Google libraries (for specific services), as you do not want to re-implement them or find out there exist better versions of it :/
@DaggNabbit Looks like, yes. But then you try to make a change and it just.. fails. You can't use the common methods of improving a bit of code - adding, removing or renaming variables, moving statements around...
Need some advice to fix an issue that a former staff left me with. On my site, http://www.mooremedical.com there is a red fixed nav bar at the very top. I just noticed that on my Android phone when I zoom in, the red bar starts to expands and moves off screen. If I start at 100% and touch the sea...
Actually, it's not even asking for a review in my opinion. It seems to be directly asking for an alternative, which makes me think that it's SO territory.
It is actually asking for "Is there any better way to do this?" which to my eyes is nowhere near "gimme-the-codez".
Let's take a look at...
I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long.
Is there a better way to do this other than if/else statements? I know a switch might work but that wouldn't make it much shor...
If you have an Intel CPU, then you can upgrade the emulator (forgot the actual name, it's something in the bunch of libraries in android package manager), to increase the emulator speed massively
Aim
In C#, the following method will cause a StackOverFlowException if called with parameter 0:
int Recurse(int i)
{
return i<100000 ? Recurse(i+1) : i;
}
However, this method actually uses tail-call recursion, meaning that if it ever performs a recursive call, that is always the last ope...