BobTheBuilder

1

votes
0

answer
31

views

SQL Server deadlock condition not being reported back to client

We recently converted an app from OLEDB to ODBC for security reasons. As of the conversion, however, a deadlock condition easily observed in SQL Trace is not being reported back to the client. I observe the call to SQLExecute returning NO_DATA instead. There is an insert trigger involved in the t...
BobTheBuilder
1

votes
0

answer
29

views

sass-lint restrict partial BEM rule

Let's say I have a class: myclass__button-create--success. I want to limit the usage of -create part in: .myclass__button { &-create { } } As it's not a new block, element or modifier. Allowed structures: .myclass__button-create { &--success { } } .myclass { &__button-create { } } .myclass__button-...
BobTheBuilder
1

votes
0

answer
27

views

shapes don't show up on window

shapes in pygame don't show up on my window. i have tried updating the display and writing the code for the object in different ways but no progress. #COLOURS red = 255, 0, 0 green = (0, 255, 0) blue = (0, 0, 255) black = (0, 0, 0) white = (255, 255, 255) pygame.draw.circle(win, black , (200, 200),5...
BOBTHEBUILDER
1

votes
1

answer
84

views

Python/Tkinter - How can I create infinite copies of a window?

I want to make a window that is constantly created making many copies of its-self. I have tried making an infinite loop that calls the function every time but that doesn't work. I also tried making one within the function but it just recreates the window after I close the old one. Does this mean tha...
BOBTHEBUILDER
1

votes
1

answer
61

views

skipping ssl-verification for quandl in python

the problem is that i can't access quandl data with quandl.get() because it throws an SSLError. i have tried setting verify = False, and some other things. this is the code: data = quandl.get('EOD/MSFT', authtoken='gyX6Yqxx3xT3hsdSmPva', verify=False) Exception has occurred: requests.exceptions....
BOBTHEBUILDER
1

votes
2

answer
96

views

How can I remodel a data table to allow lookup via dynamically addable/removable factors?

I'm having a brain freeze this morning and am hoping to bounce some ideas off the community. I have a lookup table in my database which I need to remodel - basic example of which is: Factor1 Factor2 Factor3 Value This has worked fine to this point but the business has now decided that the factors th...
BobTheBuilder
1

votes
1

answer
1.4k

views

How do I convert a ComboBox to use a bound CompositeCollection?

I have a ComboBox that has a bound items source... I've stripped my example down to the key pieces: ... This works, but I now want to add a single manual item to my combobox that will trigger alternate functionality called 'Other...' so I'm having to move to using the CompositeCollection... like so:
BobTheBuilder
1

votes
2

answer
1.3k

views

How can I pass an msbuild condition from the command line?

I have a target as part of my build that I wish to skip upon evaluation of some command line check: .... I want to pass the skip verification in from the console such that: msbuild mybuild.dev.proj /p:SkipVerification My build script complains that the 'SkipVerification' property is not defined. I'v...
BobTheBuilder
0

votes
1

answer
23

views

Passing pointer to multidimensional array as arguments

I'm a beginner and am trying to understand how multidimensional arrays work Please look at this code: #include void getData(int c;int *a,int r,int c) { for(int i=0;i
bobthebuilder
1

votes
3

answer
0

views

how do i convert format of current time in python

i have been trying to use 'strftime()' with '%j' to get the current day's number of the year (0-365): daynow = ('%d'% (datetime.day)) daynum = (time.strftime('%j', time.gmtime(daynow))) print (daynum) but returns: Exception has occurred: TypeError %d format: a number is required, not getset_descrip...
BOBTHEBUILDER
1

votes
1

answer
0

views

my pip doesn't download packages properly

I am trying to install numpy in the command prompt and it is returning an error I have tried pip install numpy but it doesn't work. I have python 3.7.2 and pip 18.1. The problem also occurs with other downloads and such things. I have tried upgrading python, with no success. C:\Users\riley>pip insta...
BOBTHEBUILDER
1

votes
1

answer
0

views

installing packages with pip returns error [duplicate]

This question already has an answer here: Python Requests throwing SSLError 20 answers pip install fail with SSL certificate verify failed (_ssl.c:833) 2 answers a while ago i downloaded pip from https://pip.pypa.io/en/stable/installing/ before i realised my version of python allready comes with p...
BOBTHEBUILDER
1

votes
3

answer
0

views

How should I mock out my data connectivity

I'm trying to unit test my Data Access Layer and I'm in the process of trying to mock my data connectivity to unit test my DAL and I'm coming unstuck trying to mock out the creation of the commands. I thought about using a queue of IDbParameters for the creation of the parameters, but the unit test...
BobTheBuilder
1

votes
2

answer
56

views

How can I change between versions of python 3

I am trying to use tensorflow but my python is to recent. I have python3.7.2 and I need py3.6 in order to install and use tensorflow. I have installed py3.6.8 but I still can't install it with pip. Is there a way of interchanging between versions of python to install/use tensorflow. Or is it to do...
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

View additional