BobTheBuilder

0

votes
1

answer
17

views

How to use if statements with pandas/ csv files

i want to check if the string data in a series is equal to a given string. but this returns: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). i know that to use and/or i use & / | but i don't understand how to do this with an if statement for i in range(...
BOBTHEBUILDER
0

votes
1

answer
20

views

why can't i open/ interact with files through python

i'm new to coding and have started to try out the OS module, it occasionally it will work on specific paths. example: but when i try to interact with an individual file this will happen: print(os.stat('my_file.txt')) >>>filenotfounderror: [errno 2] no such file or directory found. 'my_file.txt' or...
BOBTHEBUILDER
1

votes
1

answer
81

views

How to make a class run after two buttons are pressed

I am making my first game, and the last time I asked this question, I kinda didn't explain it very well. Basically, below is the opening screen of the game. I know, not very good, but it is just a rough draft. Then I also built the game. There are two buttons in the opening screen, for it is a 2 pla...
bobthebuilder
7

votes
2

answer
7.2k

views

What are the practical limit of threads per CPU?

I've been playing around with threading, attempting to push some limits to the extreme - for my own amusement. I know the threadpool defaults to 25 threads and can be pushed up to 1000 (according to MSDN). What though, is the practical limit of threads per CPU core? At some point, context switching...
BobTheBuilder
5

votes
10

answer
3.6k

views

How do I know if a branch has already been merged in SVN/Mercurial/Git?

Is there any way of easily deciphering (i.e. at a glance) whether or not a branch has already previously been merged with the another branch or the trunk? The nearest I've been able to figure out is by looking at the commit notes and displaying the merged commit notes. The disadvantage with this s...
BobTheBuilder
3

votes
1

answer
96

views

Can I change the razor <text></text> syntax?

Is there a way to include custom functionality in the razor engine to augment the functionality it has? For instance, if I wanted to use: $(This is my text) instead of This is my text Is there a way to do this?
BobTheBuilder
22

votes
12

answer
1.9k

views

Where to draw the line - is it possible to love LINQ too much? [closed]

I recently found LINQ and love it. I find lots of occasions where use of it is so much more expressive than the longhand version but a colleague passed a comment about me abusing this technology which now has me second guessing myself. It is my perspective that if a technology works efficiently an...
BobTheBuilder
2

votes
3

answer
1.5k

views

How can I provide a more robust link between SVN commits and tickets

I'm just trying to hook Trac/SVN together so that my SVN commits manage my Trac Tickets. I've read the documentation and understand (kind of) that the ticket updates rely on a dev using the correct syntax in the comments field which not to put to fine a point on it I think is um... lets use the wor...
BobTheBuilder
2

votes
4

answer
2.2k

views

How do I maintain state across multiple web servers?

Can I have multiple web servers hooked up to a SQL Server cluster and still maintain a user's session? I've thought of various approaches. The one suggested by the Microsoft site is to use response.redirect to the "correct" server. While I can understand the reasoning for this, it seems kind of sh...
BobTheBuilder
6

votes
2

answer
481

views

Where do I start with Aspect Oriented Programming?

So having read some of the PostSharp documentation presented as an answer to my previous question regarding passive logging (Is passive logging possible in .NET?), I am led to my next question: Where is a good place to start learning about Aspect Oriented Programming - I've done some searches on Goo...
BobTheBuilder
1

votes
1

answer
827

views

How do I implement a matching algorithm using predicates?

I understand how to use delegates and I am okay with lambda expressions to make use of predicates. I've come to a point where I want to implement a method that uses a predicate as an argument and can't figure out how to reference the predicate to find the matches in my collection: private static T...
BobTheBuilder
5

votes
3

answer
2.6k

views

How can I attach a custom membership provider in my ASP.NET MVC application?

How do I tie up my custom membership provider with my ASP.NET MVC [Authorize()] attribute? I've blasted through a number of tutorials for how to create a custom membership provider but all the information I've found about how to hook it up to an application seems to revolve around regular ASP.NET W...
BobTheBuilder
3

votes
4

answer
231

views

Are there any scalability best practices specifically for sites with huge audiences?

While this question has been asked in a variety of contexts before, I can't find any information pertaining specifically to sites targeting very large audiences - for example on the scale of hundreds of thousands or even millions of users. When writing sites that target smaller audiences (such as in...
BobTheBuilder
2

votes
3

answer
258

views

Why is in memory data persisted across multiple browser sessions in my MVC prototype?

I've got a basic MVC application - generated from the MVC application template. I've created a basic controller which contains the usual Index, Details, Edit and Create methods; I've got a couple of classes one to hold my object called Person: public class Person { public int Id { get; set; } publi...
BobTheBuilder
5

votes
2

answer
7k

views

SQL standard UPSERT call

I'm looking for a standard SQL "UPSERT" statement. A one call for insert and update if exists. I'm looking for a working, efficient and cross platform call. I've seen MERGE, UPSERT, REPLACE, INSERT .. ON DUPLICATE UPDATE but no statement meets the needs. BTW I use MYSQL and HSQLDB for unitests. I un...
BobTheBuilder
2

votes
1

answer
676

views

Hibernate mapping of map where key is a part of complex value

I have to create complex hibernate mapping. The following simplified example explains my problem. I have two entities: public class Work { private WorkType type; private Set; ... } public class Worker { private Map; ... } I have 3 tables: t_works columns: id, type,... t_workers columns: id,... t_wo...
BobTheBuilder
3

votes
6

answer
156

views

Is there an added cost of splitting code out to a separate library from your main application?

I can understand an added cost at application startup of loading a separate DLL, but is there an overhead when referencing code in a separate library? Say I have my application (be it ASP.NET WebForms, MVC or WinForms) and I decide for one reason or another that from a maintenance standpoint, it's...
BobTheBuilder
3

votes
7

answer
4.2k

views

How would you represent a MineSweeper grid in Python?

What datastructure would you use in Python to represent the internal state of a MineSweeper grid? Each x,y position will hold a numerical value which represents its current cell state (unexplored, mine, flag, ?). Should I use nested lists? This seems like the closest thing to a 2D array and it is w...
BobTheBuilder
3

votes
3

answer
131

views

Where should IsChanged functionality be handled?

I'm having an internal debate about where I should handle checking for changes to data and can't decide on the practice that makes the most sense: Handling IsChanged in the GUI - This requires persistence of data between page load and posting of data which is potentially a lot of bandwidth/page deli...
BobTheBuilder
6

votes
3

answer
2.8k

views

How can I unit test views and authorization attributes of my asp.net mvc application in nUnit?

I'm at a point where I'd like to start writing unit tests for my MVC application. I've already figured out how to unit test the controller and I can unit test my underlying business libraries without any problem. I'm coming unstuck on a couple of items though: How do I unit test my views? That is...
BobTheBuilder
4

votes
11

answer
2.7k

views

Are functional languages and programming models like MVC just the next big fad?

Of late, I've been hearing many good things about functional programming languages such as F#. Additionally [and unrelated], I'm also noticing MVC is starting to get a lot of exposure - perhaps since the introduction of Silverlight/WPF. I've never been one for jumping on a bandwagon without first d...
BobTheBuilder
2

votes
1

answer
1.2k

views

How do I authenticate the WindowsIdentity instance?

I'm trying to use Windows Identity Foundation for authorization in my WPF client/server (WCF) application that may or may not be run in the same trust environment as the active directory that provides authentication. For example, authentication may be provided by the active directory, but the applic...
BobTheBuilder
2

votes
1

answer
680

views

WPF, Active Directory and Custom Role Provider

I have a WPF client/server application using WCF on the server side. It is presently unsecured and I'm wishing to secure it for a userbase on my Active Directory. The application should host it's own Role/Permissions database which can be attached to the user's profile via a reference to their activ...
BobTheBuilder
4

votes
6

answer
1.1k

views

How can I design a class to receive a delegate having an unknown number of parameters?

I continuously find myself having to write timed windows services that poll outside queues or run timed processes. I consequently have a fairly robust template by which to do this, but I find that every time I write a service to do this, I start with the same template and then write the process ins...
BobTheBuilder
4

votes
1

answer
24

views

Slack - change week start day for message reminder

I'm using Slack reminders extensively. When reading a message I want to handle next week, I just use "Next Week" message reminder. However, my work week starts on Sunday, where this message would pop up on Monday as the default week start day. Is there a way to customise this?
BobTheBuilder
3

votes
1

answer
186

views

What is the best way to customize user authorization when basing user privilege on something other than specific accounts/roles?

I'm trying to write an ASP.NET MVC application where user privilege is based upon points rather than by a hard-coded role per se. I've tried researching authorization and membership providers but all the information I find points back to role based authentication which isn't really part of my model...
BobTheBuilder
3

votes
1

answer
119

views

Intellij wrong xsd validation for Spring versionless xsd

As far as I understand, it is better to use Spring versionless xsd. However, when using Intellij the validation is done based on a random xsd file. When adding the version to the xsd file everything works as expected. As you can see I use Spring 4.2.1 but Intellij chooses 3.1 version. Is it a bug (o...
BobTheBuilder
26

votes
7

answer
2.8k

views

Is there any definitive documentation on writing software installers?

I've read a bunch of documentation on installers and haven't come across anything good that explains the underlying concepts. Most of the installer software I've come across is based on the same "database" like structure that I just don't understand at all. All of the documentation that comes wit...
BobTheBuilder
1

votes
4

answer
1.1k

views

How do I redirect to a not-authorized page instead of the login page when the user is already logged in?

How do I set my Authorize(Roles="blah") token to redirect to a "You're not authorized to do this" when a user is already logged in but isn't in the correct role? Currently it redirects to the login page which isn't what we're after. We feel that it's confusing for the user to be redirected to this...
BobTheBuilder
1

votes
3

answer
757

views

Printing an HTML page on preprinted paper

I need to design a page for a web application that makes sense for user input. Sadly, the simplest and most logical manner for the user to interact with the data is completely unlike the form it needs to be printed in. I'm aware of the @media @print @screen styles that allow me to style up the page...
BobTheBuilder
8

votes
6

answer
780

views

Is passive logging possible in .NET?

I'm frequently frustrated by the amount of logging I have to include in my code and it leads me to wonder if there's a better way of doing things. I don't know if this has been done or if someone has come up with a better idea but I was wondering is there a way anyone knows of to "inject" a logger i...
BobTheBuilder
5

votes
4

answer
19.8k

views

How do I sum a named range of values that contains errors?

I have an Excel spreadsheet which imports data from another source that I need to run a calculation on. The data I need to work with is in a named range - it happens to be in the range C12:C36 - but it's called "SumData". The values in this range contain a number of errors currently including #NUM!...
BobTheBuilder
6

votes
2

answer
13.5k

views

How do I set an environment variable to a value with spaces in a batch file?

I don't know how to describe exactly what I'm trying to do but here's an example batch file that demonstrates what I can't figure out.: I've got a batch file. Inside that batch file I'm trying to create a directory: Set CopyFrom = %~dp0 if Exist "%ProgramFiles(x86)" ( Set TargetDir = %ProgramFiles(...
BobTheBuilder
7

votes
3

answer
3k

views

Spring 4 web - java.lang.IllegalArgumentException: No matching constant for [0]

I have some problems upgrading spring version (3.2.6 to 4.2.1). I get 500 Internal server error when trying to get css and js files related to login page. At the server side I see the exception: 'java.lang.IllegalArgumentException: No matching constant for [0]' After debugging it I saw that in 'Re...
BobTheBuilder
3

votes
1

answer
2.8k

views

Highcharts bar with non-stacked percent series

I want to create Highcharts bar chart with non-stacked percentage values. I use: plotOptions.bar.stacking = 'percent' But this stack all series on top another to get to 100%. I want each series to be rendered as different bar. I there any way doing it other than processing series data myself?
BobTheBuilder
46

votes
19

answer
4.9k

views

Does anyone have any recommendations for starting out in functional programming? [closed]

I'm looking for some eBooks that will assist in my learning of functional programming. I haven't yet decided which language I will go with, but I've noticed a fair amount of bias towards LISP, Haskell and F# amongst the community on StackOverflow. As yet, I'm unsure which direction I will take, bu...
BobTheBuilder