I don't know how much of this is proprietary, so I'll keep it pretty basic.
Basically, they used to have their PK's be "tickers", so an email template for "Contact Us" would have the ticker "CONTACTUS" or "Contact_Us" (it varies...). They switched to uniqueidentifier's since then, and I'm going to make the fields reference it direct foreign keys that store the Guid's (C# terminology).
The next two are a little more tricky. There can be many fields of one type mapped to the widget.
So, these two fields are like "guid,guid,guid,..." and "name,name,name,..."
I'm going to make those into tables that store a map between the widget ID and the guid (the second has to be converted from the name to the guid too).
Should be a big improvement once it's done, especially if they are currently having to parse out those strings every time they need to reference the mappings
Not too bad. I have the up migration finished. The down migration appears to work correctly, but I'm having a wee bit of trouble with it. Although TBH, I'm not 100% sure at what point it is failing right now--I have all this in one migration, plus a bunch of other stuff too.
I'm renaming two fields, dropping about 5, creating 5 tables to replace the dropped fields, and then creating a bunch of other fields for a different section of the widget unrelated to the schema/data change.
The worst part is we are displaying this data in an HTML select as options.
So we have the value for the option as "guid,guid".
So one tab is loaded from the server the first call, but with AJAX whenever a control on another tab is changed.
Function already exists, but it has a bug. I need to talk to the author about it on Monday.
The other bit loads all the data from the server and I build a JS function that runs whenever the other control changes that clears its content and replaces it with the new content client-side.
So, ideally, the client shouldn't even notice any lag at all--the AJAX call is so fast that it is done by the time I switch to the other tab.
Of course, I'm on the local network right with the DB...
I'm trying to get teach myself c++, and I'm working on a project that will read in an image from a file, do some image processing, and output it. I'm currently only using the ppm format because it's dead simple and I want to do as much of the work with code that I wrote. You can read the file for...
I believe HP was on the list. I can't tell you our latest client because we just won them from another company, and they don't know yet, or didn't as of Wednesday.
I am trying to find a solution for association relationships to find largest item association group. If two groups have same number of items then select the group which contains the item that appears first in lexicographic order.
Can someone help me to get the expected output.Thank You and appre...
I was trying to emulate a piece of code made in Haskell, to pure Ruby.
This is, to find the sides in a rectangle triangle where the addition of its sides are equal to 24.
The Haskell code creates a "permutation" of elements between 1 and 10 (maybe I'm omitting something here), this gives an arr...
Code that is working but needs optimizations are off-topic for Stack Overflow. Please consider submitting in codereview.stackexchange.com. Also, there are many questions there about Project Euler so you might be able to find some nice tips! — Alexander Reynolds29 secs ago
how would I go about making this code "cleaner"? Right now it's a pain to look at and try to understand.
from msvcrt import getwch, kbhit
from os import system
from time import sleep
from random import randint
def check_type(num, type):
# Check if int, if not return 0
if type == int:
...
I'm coding for a project euler question and every now and then, the question will demand a program that is efficient even when doing brute force. Which I struggle with.
Below is a piece of code for problem 35 which I'm fairly certain works correctly so far with numbers under 10000 however when I...
My program receives as input a list of members of the royal family and print the succession line of the current monarch, in order of succession.
The first line of the entry is an integer n, greater than 0 and less than or equal to 100, which represents the number of members in the family tree of...
I got a help from one of the StackOverflow users to correct my logic on an algorithmic problem related to removing the duplicates from the unsorted linked list. I was doing it wrong at the first time.
The code which I have put here works fine but I did not understand what would previ...
See source code here: Github
To install: npm install once-api --save
I am a full stack developer, lots of my time was spent on connecting my web app's frontend and backend. So I develop once-api to save my time. Now I only need to write my logic in the back end once, then I can use the generate...
Welcome to Stack Overflow! It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — FrankerZ40 secs ago
I've developed an application and I'd like to know if I've done it well. But my main concerns are not really about the code itself, which is quite simple, but more about the design and architecture, present and future.
So... It's a review... Of the design... What's the best place to ask my quest...
I'm sill experimenting with different designa patterns for full integration tests for Console applications (and later also Windows Services) and I wasn't quite happy with the result of the refactoring of my last question. I've changed a few things again and this is what I've come up this time.
T...
I have a list of strings to search along with a list of words and want to produce boolean feature vectors indicating presence of each word within the strings. What is the fastest way to build these feature vectors in Python?
In the example below the first string would output [1, 0, 1, 1] for exa...
This is the question i am facing at level 3 of google foobar. So the question is as follows.
There are two types: Mach bombs (M) and Facula bombs (F). The bombs, once released into the LAMBCHOP's inner workings, will automatically deploy to all the strategic points you've identified and destroy ...
I just want to ask you guys if the database design that i made for my asp.net website is correct or not. So basically, I created a database for the brands of my guitar products, which is like this:
Database for Brands
and i also have another database for the guitar models within that brand.
...
first time poster here.
I'm creating a session cookie which should expire after 30 minutes of user inactivity. I've added the following code to the base controllers OnActionExecuted method.
protected override void OnActionExecuted(ActionExecutedContext filterContext)
{
var sessionCo...
I'm trying to solve the 8-puzzle game using BFS, DFS and A* algorithms implemented using Python 2.7. For now, I have managed to solve a couple of test cases using BFS and I want to know how I can improve the implementation of the algorithm as well as the structure of my program. The program curre...
https://stackoverflow.com/a/44745975/6517383
Here is my answer to the question,which I think is quiet inefficient considering it's length:
$('document').ready(function() {
function makeEqual(blocks,dash) {
var n =blocks;
var widthSize = dash *10;
var i=0;
var equal = "";
var conte...
I have Python Algorithm class with calculate method that takes the list of tuples where every tuple have 2 integers (coordinates of the dots) and goal argument and returns integer - a number of lines that have more than int(goal) - 1 dots on it.
For example, if we have four dots on one line (lik...
@RubberDuck I just started working in Toledo again, no terminal here though I find I spend a lot of time switching between many different environments.
I sometimes don't like to look at images in chat. When they're just a URL then I'm fine, as then I have the choice to look at the image or not, and blends in with the other text. Therefore, I decided to make a onebox hider for chat. It hides the onebox, and adds onebox: <link> before the onebox, ...
Please check my website code which I am posting. It is now complete as the last time I posted it was incomplete and I have tried to correct it based on the same advice I was given here. The website should look like this website. Please check the CSS like the way I moved/placed the elements, if it...
I am wondering if anyone can help me I am trying to read every file in every directory and create a hash of the file. The code works fine but is extremely slow, I wondering what I can do increase the speed and the performance of the below
public static void main(String[] args) throws IOExcep...
I am using this code and the constrained maximum likelihood function from Gauss to estimate the parameters in an ARMA-GARCH model however my results do not seem to be working. Anyone have any idea what I did wrong?
The formulas I am using are from : http://perso.univ-lille3.fr/~cfrancq/Christian-...
@RubberDuck Talking about firewalls, did your firewall let my email through?
Also, how's it going these days?
You might be interested to know, Rubberduck got me a job as a backend webdev, although I'm doing mostly frontend work. I use ASP.NET, Knockout, jQuery, JS, C#, and a few others.
Contract-to-hire, so if they like me, they'll hire me permanently after 90 days. They seem to like me so far, and I've apparently been performing above their expectations.
If you are asking how to find the divisor of a number (say 2048) see: codereview.stackexchange.com/a/111636/141451 . Get all divisors and choose the pair with the difference between them to make it as squarish as possible. — c0der18 secs ago
@RubberDuck Over here unlimited time periods have a 2-month period at the start where any party can stop without consequences, for shorter contracts it's a 1-month period
I want to simplify aiohttp routes/resources configuration (see this paragraphs). For this task I have written this _resources.py file:
from aiohttp.web import Application
def _function(): pass
def _check_handler_types(*objects):
names = ['endpoint', 'method', 'controller', 'args_cont']
...
It depends... most employment is at will. It gets funny with the contract-to-hire stuff though. I've seen some bad contracts (that I refused) if you didn't finish the 6 months or whatever.
@janos @Peilonrayz (and other interested Pythonistas): What's the recommended method of transforming a couple of one-off scripts used for hardware tests into a library? Got the green light at work to fix the current mess into something maintainable and in VCS.
At the moment, each test has it's own file. I suspect modules per group-of-products may be a good idea, but I could also be going exactly the wrong way with that.
@Hosch250 That's always good to hear. What age is he?
I'm having him start with Stroustrup's Principles and Practices book because it is so much of a programming book rather than a language book, and then I'm going to switch him to C# once he gets to GUI's and pointers.
@Mast I unfortunately don't have that large an exposure to that. Personally I'd start by splitting tests into a /tests directory and have everything else in a folder with a __init__.py file. And copy the rest of the structure from like requests or something
@Peilonrayz I may have phrased that poorly. Everything in those files is a test. It just tests hardware, not software. Basically it's sending commands to a secondary device (which may or may not send commands to a tertiary device) and validates the response.
So a /test directory would contain everything.
Most commands can't properly be put into closures to make it all worse.
@RubberDuck That's how my current job found me. Apparently they were looking for someone for the position I'm in for 18 months, and had a lot of candidates apply. They did a very basic technical interview (write a basic VB.NET program that does some simple ListView stuff) and that ruled out a lot of the "highly qualified" candidates, or so their resume said.
@RubberDuck Yeah, it's sad, man. I'm not the best, hell, I'm not even great, I'm mediocre at best, but I still know mostly what I'm doing when it comes to putting something together.
So, you have found your way to the Code Review main chat room, The 2nd Monitor, perhaps for one of these reasons:
You were invited or "pinged" by a site moderator or other user to discuss a post on the main Code Review site;
You visited Code Review for the 1st or Nth time, and noticed the chat ...
Well, the easy way out would be making this someone else's problem and assigning this question to one of the available C# experts. But that would make me sound like a manager.
Honestly, it looks like a pretty good question. So it's not that.
@Mast Hey that's what I do with internal tickets, solve the ones I think are reasonable and can solve, redirect the others to the person that knows most about them
Being new is interesting though, as first you almost get no tickets assigned, then you start making some stuff and you suddenly need to deal with the issues about them too :P
@Nox You did the right thing by bringing a good, inactive question to our attention. Now give it 24 hours and see if it helped. If it didn't, there's other options.
@Nox My first review on this site was in a language that I didn't even know. I had just started learning it. I think I learned more about C# from reviewing (and therefore understanding) other people's code than I did getting mine reviewed.
@Nox I was very much an amateur when I started reviewing code. And so I wrote answers where I'd say anything I'd change, I got upvotes and so stayed around...
I'm developing scrapy project fo scraping news from sites and saving them to GoogleSheets. Source repository is here.
I want to ask about my class that must be used as a parent for Scrapy spiders: what can be improved to make it the universal parent of spiders for any news-like web-sites? Also, ...
Bounty Up. Insta Rep Cap for anyone who can get the green checky from @Nox. https://codereview.stackexchange.com/questions/166024/mapper-made-specifically-to-work-with-dapper
@RubberDuck @Peilonrayz I understand your point, I just fear to lead to a mistake, or simply to something not efficient enough, by answer something I'd have not enough knowledge about
The worst case tho, is you get no votes or comments, if that happens I'm sure someone here may be happy to say what's wrong / good with your answer, :)
Hello my fellow humans,
I am implementing a litte generic math library. What i have done is to write my generic matrix and vector class. I'm curious if i have it done right so far( implementation wise not totally mathematical correctness wise ). Reason: I'm relatively new to template programming...
I'm a C beginner. I'm studying and implementing some data structures. I'd like to get feedback about my style and decisions I made.
This is a Doubly Linked List. I decided to keep things as simple as possible writing just the basic operations for the list.
In main there is some test code along ...
@Nox I'm not sure how familiar you are with bounties, but I'll say it anyway: The bounty on your question will expire in 7 days. That means the user who put up the bounty has 7 days to award it to an answer. It's usually a good idea to make use of the full 7 days and with with accepting an answer as 'accepted' as long as possible (so, 5-6 days). You never know what your question may attract until you get it, and accepted questions have a tendency of not attracting answers anymore.
Is it okay to edit the question to include the improved code?
I would like to do so for the following reasons:
To share the improved code with others
To show the answering persons that I take their feedback seriously
To make sure that I understood (and implement) the feedback in the right mann...
I have written a small desktop program nabeelomer/BingWallpapers in Haskell. This is my first time writing Haskell.
I am looking for tips on how I can make the code use more functional programming features/idioms.
Any other suggestions on how to improve the code are also welcome.
-- Copyright ...
@RubberDuck I know that feeling. If my life had gone slightly different 6 years ago, I'd have a 1st in Maths from Oxford right now. And probably an extra zero on the end of my salary.
@Mast Mostly I just bugged @mat's mug and @RubberDuck until they took pity on me ^^
After my Brainfuck Interpreter written in x86 Assembly I decided that it was time to get to the next step, writing a Brainfuck Compiler in Java that generates x86 Assembly and compiles that to an executable.
Currently it only supports Windows and it still uses NASM and GCC as dependencies to tra...
I am working through the UPenn CIS194 lectures and homework assignments in an effort to learn more about Haskell.
The first part of the first homework is focused on validating credit card numbers.
To validate each credit card number (passed in as an Integer), the Integer should be converted to ...
@JavaDevil Honestly, because I wrote this answer on my phone, and the thought of writing up a class wasn't that appealing on a predicative keyboard that tries to auto-correct every second thing I write. Also, his main problem is the redundancy from having a ridiculous amount of loose variables. While encapsulating everything into a class would also help, I didn't think it was as necessary to point out since this isn't a code review. — Carcigenicate59 secs ago