« first day (1619 days earlier)      last day (2697 days later) » 

00:00
RELOAD! There are 4473 unanswered questions (90.6729% answered)
0
Q: Annotating custom tkinter objects

Geoffrey SametzI'm adding/editing the docstrings to my custom tkinter modules. These contain classes that are subclassing tkinter objects as well as each other. I'm trying to follow PEP 257, but applying to this case feels forced and awkward. Any criticism of how I'm going about this is welcome, but these items...

00:17
0
Q: Renaming functions that Explicitly Throws exceptions

user113531According to the zen of python Explicit is better than implicit. I am thinking of naming any of my functions that may explicitly throw en exception with a prefix try. For example def try_something(): # do something if some_condition: raise Exception() What are the pros and c...

01:08
I've read the question. It's not clear what implementation you want fixed (you don't seem to have provided it) and what's wrong with it. If you have a working implementation you want reviewed, you might want to try codereview.stackexchange.com which deals with more subjective stylistic issues. I don't think asking you to review the docs is 'giving you a hard time'. — pvg 19 secs ago
02:03
0
Q: Session generator/checker utility for a server

AcontzI wrote a utility for generating and saving sessions in a MongoDB database as well as checking the session to make sure it's valid. I'm a beginner when it comes to promises and I have a feeling that either I'm using them improperly or I'm not taking full advantage of them. Here's the session ut...

02:18
@CaptainObvious The practice of documenting every line of code truly needs to go away.
    // Determine if session is not defined
    if (!session) {
      // Reject
      reject();
    } else {
      // Resolve with the session ID
      resolve(session._id);
    }
02:56
0
Q: Project Euler 23 in Scala, performance bottlenecks and functional style

Chase G.I recently overhauled my problem 23 solution to move it from an imperative style to a functional style and tried to increase its speed. However, the performance is still slow. I have clocked this solution at 58 seconds, and the older imperative solution at 64 seconds. I am mainly hoping for feed...

03:34
0
Q: Bit Stream read/write methods can they be improved?

SirI have a basic bit stream which uses a byte array and a index position to read and write bits. My write method takes an int value only and the number of bits and applies this to a byte array in the bit stream. My read method takes the number of bits i wish to read and an reference to an int to ...

04:32
Monking
05:23
0
Q: Parsing Function into another Function Parameter (General Code Cleanup)

Hacksaurus_BabuI created a program that measures the time for the Bubble Sort Algorithm to sort a list of numbers. This is my code here: #include <iostream> #include <fstream> #include <vector> #include <time.h> std::vector<int> FiletoVector() { std::ifstream SortFile("Number_Sort.input"); std::vector<...

0
Q: power loss notifier

Jordan SzubertMy laptop is old, so i decided it would be good if my laptop would scream at me if i kick power brick, so i would make the brick work again, and not notice only when battery runs out and i loss all the data (battery meter is not to be trusted). namespace POWER { class Program { priva...

05:41
0
Q: Read text and return lists of different parts of speech

jss367This function reads through text and returns lists of all the different parts of speech (nouns, verbs, proper nouns, etc.). My sense is that there is a more elegant and probably more efficient way to accomplish the same thing. The code feels really repetitive so I'm hoping there is a better way. ...

 
1 hour later…
06:45
perhaps codereview.stackoverflow.com is best suited for this question — bradbury9 31 secs ago
 
1 hour later…
07:58
@bradbury9 It's not about getting code reviewed, but about getting the concepts cleared by experts. :) — Saurav Sahu 10 secs ago
0
Q: Efficient stable priority queue in Java

coderoddeI have this stable priority queue. It runs all the operations within \$\mathcal{O}(\log P)\$, where \$P\$ is the number of distinct priority keys (which may be smaller than the number of elements stored). StablePriorityQueue.java package net.coderodde.util; import java.util.Comparator; import ...

Kaz
Kaz
08:14
Monking @All
09:07
If your code be already working without error and you just want to tune it, your question might be better suited for Code Review. — Tim Biegeleisen 23 secs ago
I'm voting to close this question as off-topic because it would better fit Code Review. — lexicore 33 secs ago
09:48
I'm voting to close this question as off-topic because has morphed into a question that is a better fit on Code Review — Yvette Colomb 22 secs ago
10:01
Your question is off-topic. But you maybe try it at code reviewB001 57 secs ago
Meeting for code review?Digital content ,ecr latest file sent — Vikrant Choudhary 57 secs ago
10:15
why not post your code on codereview — BugFinder 10 secs ago
10:35
0
Q: Memory issue in Mapping code

Savithacreated NSObject extension for Mapping key values from API service but this has memory leaking. Can anyone help me in identifying issue? extension NSObject { func setValuesWithMapping(_ mapping:[String:String],info:NSDictionary!,clasMapping:[String:AnyObject])->Void { ...

A better community for code review would be: codereview.stackexchange.comC14L 57 secs ago
0
Q: How can I reduce code size for double loops to minimal

Leo B JacobSo what I am trying to do is to find count of alternating numbers such that it alternates with -ve and positive sign for eg: 1 -2 3 -4 would get me 4 3 2 1 as from 1 to -4 including the two numbers there are 4 numbers. Simillarly for 1 1 -3 2 would get me 1 3 2 1 Now I have the code but I cannot ...

11:21
Monking
Greetings, Programs.
Greetings, User
11:35
0
Q: changin from function based view to class based view - Django

ThisThis is my function based view def reset(request): return password_reset(request, template_name='login/reset.html', email_template_name='login/reset_email.html', subject_template_name='login/reset_subject.txt', post_reset_redirect=reverse('success')) TO change this ...

There're multiple issues with this code and, I'm afraid, it's too broad for StackOverflow. Probably, you can get a better response on Code Review, but you'll need to clarify the types of db, table, and MinifiedSiteEvent to do that. — default locale 15 secs ago
11:48
0
Q: Entities with many optional properties

Albert BosI am working on a database migration tool, which should be database agnostic: https://github.com/adhesivee/database-migrator When creating/updating a database the columns can have some optional parameters. This is how the API look like: public interface Database { void createTable(String ta...

12:04
1
Q: nginx serve static - images, js, css and proxy node.js server

Igor KomarI'm build server for serving static, and uploading images there everything working now, but I'm not expert in nginx and server configuring, maybe someone sees some improvments for this. Here is my nginx config: server { listen 80; server_name localhost; location / { proxy_...

12:18
1
Q: Correct modularization and array usage

J. TateI am trying to brush up on Java after not programming for a few years. The idea behind this code is simply to get used to object oriented programming, modularization techniques, and basic arrays. Any comments and critiques are obviously welcome! Here is my code: /* * This code is meant to ask...

I'm voting to close this question as off-topic because it is too broad. Questions about how to improve programs that work may be a better fit on codereview.stackexchange.com, but first please read their help pages on what is on-topic and on how to write a good question there. — AdrianHHH just now
I'm not sure this is opinion based. Method 2 is a clear code review failure. — Bathsheba 46 secs ago
12:36
0
Q: Converting local currencies into one target currency using the exchange rate table

peprThe solution is to be used on MS-SQL server. The presented code was tested on MS-SQL 2012. I was given the exchange_rate table that reflects the human interface (for INSERT and UPDATE). Because of that, the exchange rate is expressed as two coefficient. Here is the table definition with the init...

13:07
For the last several weeks, I've been typing "appropriate" as "apporpriate", and it's been really frustrating, I just found "apporpriate" in several documentation files. >.<
possible answer invalidation by Simon on question by Simon: codereview.stackexchange.com/posts/177457/revisions
@Duga rolled back
13:39
0
Q: Simple OOP blackjack game in Python

HanzyI made a simple text based blackjack game in Python 3 to help me implement OOP concepts. I only made one function outside of my classes which takes the user's name at the beginning and then establishes a table with the player/dealer. I'm mostly interested in improving my OOP, so I would appreci...

0
Q: Scrape a reddit post submission for comments and save comments to JSON file (revised)

SimonThis is the revised code after incorporating the suggestions from user Roman Susi. Link to the previous post here. Notable edits: I have factored out the bigger functions into smaller tasks. The functions and variables have(hopefully) less ambiguous names, and the JSON object is now deepcop[ie...

13:53
0
Q: C# Async Socket Wrapper

Walter ByersI'd like to get a little feedback on this async socket wrapper. My goal is to merge socket Begin/End methods into a single async call. I also wanted to wrap exceptions so they are easier to handle in others areas of my program. Any red flags? Any potential problems? I know its not doing much but ...

14:12
0
Q: insert the result of the function into the sql server table(python)

tim_frostI have a function that prints result of counting word pairs I want to write result to a table using sql server database, but an error is displayed NameError: name 'ngram' is not defined from collections import Counter from itertools import chain data = [ ['22574999', 'your message communica...

14:26
-4
Q: Where can I learn black hat hacking?

user18602Preferably books or online courses both free and paid.

It look like it could be polish to a code review to me. — Drag and Drop 19 secs ago
15:09
Hi @Ludwig, this question seems pretty broad, open-ended for Stack Overflow. if you have code that is working, but you need to make it more performant, consider asking on Code Review, instead. However, don't just copy and paste... be sure to take their tour and make sure your question fits their rules! — TylerH 56 secs ago
this isn't codereview ;) — pruntlar 41 secs ago
That said, the movsx eax, [ebp+8] is already ambiguous. That can be assembled into two different instructions, either movsx eax, word ptr [ebp+8] using 16 bits of memory as source value for sign-extension into 32b value or movsx eax, byte ptr [ebp+8], using only 8 bits of memory as source value. That's another thing which would not pass through source code review, and would have to be fixed by using explicit syntax. Obscure source code depending on implementation/implicit behaviour is IMO "code smell", and shouldn't be taught at all (or only as example of how-to-not-do-it). — Ped7g 45 secs ago
As written, your question is rather unclear. In general "How can this be improved" is an ambiguous question, and will likely get closed as opinion based (those kinds of questions are typically for the code review SE). What is the "unintended case"? What isn't working as you expect? — jkeuhlen 27 secs ago
result <- ...; return result is equivalent to not binding result at all; Regarding your question about code review - there exists a separate se-site exactly for that purpose - codereview.stackexchange.com - I would propose migrating this question — epsilonhalbe 36 secs ago
15:30
0
Q: Golang Opengl OBJ Loader

TotallyGamerJetI'm trying to get better in go by make a 3D game. (Yes, I know that's a lot of work but I'm doing it for experience and not to make a profit.) And I want to improve the loading of the OBJ Files as this slows down the game quite a lot. As you might notice I tried to remove all transient objects fr...

0
Q: Exception handling calculate power

user2769790I've to create a class MyCalculator which consists of a single method long power(int, int). This method takes two integers, and, as parameters and finds Math.pow(n,p). - If either n or p is negative, then the method must throw an exception which says "n or p should not be negative.". - If both n...

15:49
-1
Q: Significant level in arithmetic R operations

Falcon-StatGuyWhy R operation giving me different significant level why they applying the same operations. I wrote the R code below and I am not sure why after a certain significant i got different value. rm(list=ls()) set.seed(pi) beta <- matrix(rnorm(10), nrow=5, ncol=2) X <- cbind(X0=1,X1=c(0,0,1,0,1,0,0...

1
Q: Sending calls to a RESTful API with jQuery and returning JSON objects to front end

sommerjjI am a part of a student project to build a website that offers users a way to search for items in an online library catalog that are all part of some collection. The details of the project are not super important. I am responsible for writing the "backend", which in this case is just writing a...

i'd recommend the codereview SE site if your code works — depperm 16 secs ago
And maybe Code Review is what you are looking for, but please put some effort into your questions. — Paco H. 51 secs ago
16:10
@CaptainObvious one more vote
16:25
I'm voting to close this question as off-topic because working code is off topic, and the SE site for reviewing / suggesting changes to working code is codereview.stackexchange.comTessellatingHeckler just now
16:40
@Heslacher Done.
Thanks @Donald.McLean
17:23
Monking
17:36
0
Q: Converting between bases (2 to 221) with optional seeds and padding

PeterIt's been a while since I had a bit of fun getting something useless working, so I thought I might as well ask if there's anything to improve about how I do things. The original idea was to convert uuid4().hex to a higher base for more efficient storage, before I realised I was hashing the value...

17:56
I'm voting to close this question as off-topic because this is asking for a code review, opinions and discussion which is off-topic. This belongs on codereview.stackexchange.comJarrod Roberson 47 secs ago
0
Q: Choice Decision Maker (Random string from ArrayList)

cody.codesI'm learning about inheritance and polymorphism in my CS class and thought it'd be a good idea to find something I could apply myself to. I have a lot of ideas, and sometimes there's things I want to do and things I don't want to do. Why not leave the decision-making up to Java? I'm looking for ...

0
Q: Uncaught SyntaxError: Unexpected string in Slicksilder

Brandon PowellCan someone review my code really quick getting an error message that just popup cannot find all breaks are here? Uncaught SyntaxError: Unexpected string $(document).ready(function({ $('.carousel').slick({ dots: false, infinite: true, speed: 500, fade:...

I get Announcer badges for the weirdest questions, not remembering ever having shared to them...
Also on the strangest sites, none on CR.
18:19
0
Q: Optimising string compare in swift

kanadenipunI'm solving this problem on hacker earth. Just for practise. Except for thisone test case, which is having 100 very long strings to compare, all other test cases are fine. but this one is taking too long to execute. what are possible optimisations that can be done. Also it would be great if you ...

18:36
If I understood the question correct, in order to get the answer it should be moved/posted on codereview.stackexchange.comAntK 5 secs ago
0
Q: asyncio with live update and abort capabilities

magu_This is my first shot at asyncio. I'm looking for any pointers you might have. Especially: Are there any race conditions? This code doesn't scale as expected. In my project I need to call foo 4k times. As a background thread I need to make 4k network calls (foo, which is a third party func...

18:51
Welcome to stackoverflow! =) Stackoverflow is a unique site in that it is only about questions and answers. It seems like you've got the beginnings of a good program here, but it's unclear what you're asking. When you post a question it should contain a very clear question, which yours does not currently. People may mis-interpret this as you asking the community to write code for you: which is definitely frowned upon. If you're simply looking for some feedback on your program you might want to try codereview.stackexchange.com . Welcome again! — 0112 19 secs ago
Monking!
0
Q: Function that returns words in string not exceeding specified number of characters

SamI'm trying to create a robust function that receives a string -- typically a paragraph or two -- and the max number of characters in the output. One condition is to make sure that we return full words and never cut on in half. Here's the code I have and I feel it needs to be improved. export co...

19:05
Thanks all for suggestions. I do feel that this is a question for StackOverflow and not a code review request. I'll edit my question text to clarify that and make it more obvious. Sorry for not being clear about this in the first attempt. — Chetan Bhasin 23 secs ago
19:21
0
Q: Print largest/smallest no (even, odd) from user defined list of given size

Ram chandra GiriAfter reviews of my previous codes 1st, 2nd learned many new things. So with those in mind, this is my solution for another question. Question: Write a program that ask user for list size and values and find largest and smallest no, even no, odd no? Expected output: For user defined lis...

0
Q: Excel VBA: ActiveWorkbook.SaveAs Suddenly Not Functioning

rachaelsI am having an issue with some code in my master workbook. I have two pieces of code. Code A Works fine. Code B does not work fine. The first piece of code (Code A), which works fine, creates a directory and saves the Excel Workbook in it, with the name of both the directory and the file being p...

19:39
0
Q: Read file real time with while loop and trigger action on change

AhNuAbI want to read a file real time with a while loop that is being fed by the stdout of a process (inotifywait). The output could be multiple lines, but I as soon as I've found name of a specific file in a line, I want to discard all the other lines. How can you do that without breaking the while lo...

19:58
@CaptainObvious Uh, don't know if this is on-topic, any thoughts?
20:09
0
Q: Mandelbrot Render Speed With Arbritary Precision vs Double Precision

Byte11The Problem: My C# code that renders the mandelbrot set does so in ~450ms, while my c++ code using MPFR and MPIR takes ~10,800ms at 5 iterations. Both of these times are fairly slow, but 10 seconds is glacial for rendering the set. I am aware that this question, this question, and a slew of othe...

@Phrancis Why?
It appears he has a workaround which works.
It's awful, but works.
Nothing out of the ordinary, right?
Yes, it's phrased a bit odd.
Appears to be asking for code. Then again, workarounds are no mistery when writing code lol.
Maybe it's fine, just wanted a 2nd opinion which you provided
0
Q: Get users that are presidents and compute their name

AdamI have a user table like this id | firstname | surname | title 1 | Bob | Batman | Dr. 2 | Alice | Grimley | Prof. 3 | Clara | Caprio | In the user model class I have a function that computes the name class User extends Authenticatable { //... public function c...

20:26
I'm voting to close this question as off-topic because it belongs in codereview.stackexchange.comXorifelse 14 secs ago
@Phrancis It could've been phrased better and it's kind of in a grey area, but I think it's on the proper side of it.
0
Q: Best Stackexchange for Programming self study

RedThere are a 2 or 3 stackexchanges, one of the them I believe is Code Review, that have to do with programming. Can anyone tell me which is most appropriate for someone who wants to learn programming languages like C at an undergraduate level to ask questions? I am looking for something like the M...

@Feeds Nononononono!
21:00
possible answer invalidation by Martin R on question by kanadenipun: codereview.stackexchange.com/posts/177544/revisions
This question is better suited to codereview.stackexchange.com — Nick A 18 secs ago
Please read Why is “Can someone help me?” not an actual question? TL;DR: It isn't likely to be searched by someone else. Masking your need for a private tutor by asking ever specific hints to a concrete programming task will not increase the value of the knowledge base that is StackOverflow. You may try your luck at codereview.stackexchange.comSimon Shine 13 secs ago
Twice? I don't get what's up with badges lately...
21:20
0
Q: How to accelerate SQL query generation using C#?

Marko PetričevićIm trying to optimize my code and in the process of doing that I made a class Query_builder that handles SQL queries. That class has couple of methods: ExecuteScalar (execute scalar queries that mainly return int as a type), FillDataTable(used to fill Datatable with data from SQL tables) and the ...

10
Q: Documentation badge awarded twice?

MureinikI guess sunsetting documentation is going into the final stretch, as I was just awarded the Documentation badge for "Earned at least one badge for contributing to Stack Overflow Documentation", as per Documentation is read-only. What’s next?. Strangely enough, I seem to have two of them (see her...

What would be the point of making the code hard to understand? Also if this code works it may be better suited for CodeReviewUnholySheep 49 secs ago
21:44
There are so many things wrong with the design and implementation of this method it is hard to know where to start. If you want good advice on how to improve this, get it working fully, improve it as much as you possibly can, and then post it on the code review site. — Eric Lippert just now
@202_accepted Thanks, appears to be fixed by now.
The award for mentioning the most programming languages in a book title goes to:
> Web Standards Programmer’s Reference: HTML, CSS, JavaScript, Perl, Python, and PHP
0
Q: SML changing the string value in list of tuples

Quacking_DuckI would like to change the string value once there is a match between the first element of tuples of the gamma list with numbers in ex list. The below code only work for the first value in ex list. Please advise how can I iterate through the ex list. val gamma = [(5,"a",20, [12]),(0,"b",30, [8])...

0
Q: Is this good C++11 code?

user2108462The following is a code snippet taken from a pong game. My main concern is the number of if statements. It looks inelegant and there is duplicated code in many places. Furthermore, everything is in the main function. But I'm not sure how or even if it should be refactored. Should there be a sep...

@CaptainObvious Nope.
22:14
168 + 1 != 170
Something's going wrong with my iteration...
@Mast Off by one. ;)
Grmbl, found it.
for file in os.listdir("Books"):
    if file.endswith(".pdf"):
Guess what that doesn't catch? Exactly. .PDF
Capitalisation strikes again.
Turns out one out of 170 books had the 'wrong' extension.
And that's why I .ToLower() everything I work with lol
    for file in os.listdir("Books"):
        if file.lower().endswith(".pdf"):
There. Fixed it.
@202_accepted Yea, I used to do that. Haven't fallen for this crap in a while though, so I kind of forgot.
@Mast TFW the API is ambiguous. ;)
22:23
I thought I had sanitized my input...
HAHAHA sanitization
It's never sanitized enough.
2
Users will always find a way to mess it up.
0
Q: Sending data from UART to microcontroller via AT89C2051 functioning as a UART/SPI bridge.

MikeI have an unusual setup. I have an AT89S52 microcontroller in which its UART is used by the PC. I needed a way to make a second UART based device work with it, so what I decided to do was make a UART to SPI converter using an AT89C2051 due to its smaller size and smaller cost. Now I have some tro...

0
Q: Bisection Method - C# - Code Reviewing

Ahmad AdelI have a simple bisection Method solver that I was told it has some problems in design and I need my code to be reviewed, so I was hoping for someone to give me guideline how to improve my code, it starts with a delegate public delegate double MyFun (double x) ; and a class to add function...

The try/catch was a level to low to catch this crap. I should probably wrap it in another one a level higher.
That could get out of hand quickly...
I work with spreadsheets that go through 7-12 sanitization methods (depends on who sends us the sheet as to how many methods it gets) including at least one person, I still end up with unsanitized input.
And you know what else never fails to show up? NRE's.
All I wanted is a list of PDF files in a folder.
How hard could it be.
22:25
Hard enough to confuse you. :P
@202_accepted Of-course. You'll write a shiny nice catch for it and nobody will ever do it wrong again.
Do that a couple of times and your code is bogged down for nothing.
I got permission to just reject it on submission.
lol
I kind of do that already.
So now I tell the user (literally) "Sorry, something's wrong in that spreadsheet. Please follow the <link>rules</link> and try again."
I don't tell them what's wrong, because that would make it too easy.
Basically, it gets parsed and if the parsing fails it raises a ValueError. You'll get warned for the entry and the entry won't be taken into account.
22:28
Oh no, I just burn the whole thing.
lmao
The best part is it takes 1-5 minutes to submit, depending on how big the sheet is, and it could fail on literally the last line.
I wrote a testscript like that a while back. Either the DUT was working or it wasn't. Turns out they wanted to know which parts weren't working.
Well, I knew. I just didn't know they wanted to know as well.
@202_accepted FWIW you should at least attempt to give users something to work with other than "something bork.."
I offered to make it more usable, and the department head who's department is using it said "Please!", but my boss said "no."
22:29
@202_accepted Your boss is being an ass?
@Vogel612 At this point it's become a 'principle' thing, we had to do the work manually for years and now it's partially automated and we're on purpose punishing users for not following the rules because they cannot be decided blindly. (There's no rule to encode in the business domain.)
And believe me, this is already a huge time improvement. Before the items were being submitted to our department, we did the processing when we got time, but the other department had to do manual changes based on what the spreadsheets would have been were they entered in the system.
I don't quite follow in what way this is concerning usability tho...
It's...complicated.
There's some politics involved, department heads that hate each other.
IME it's usually not
@202_accepted office politics are like such a great thing /s
Hey, I just build the stuff, I let them tell me what to build.
22:32
generally "humaning" is an "Unsitte"
sometimes I miss German's expressivity a lot
and then there's times where I just forget the German word and only remember the English, Japanese or possibly French word :/
> I WEAR MY SUNGLASSES AT NIGHT
Sorry, had to share that with someone.
> SO I CAN, SO I CAN
Ik draag mijn zonnebril 's nachts.
> WATCH YOU WEAVE THEN BREATHE YOUR STORY LINES
Watch you weave?
22:36
It's a song, "Sunglasses at Night" by Corey Hart.
You're listening to Corey Hart, now I get it.
Bloody ninja'd.
Hah, I wasn't even paying attention when I wrote that lmao
Who needs attention when you got whisky.
Cognac as of now...
I should grab a whisky somewhen again
22:55
0
Q: Cows and Bulls (with GUI) game in python 2.7

Reid OlsonI am writing a cows and bulls game for my introduction to programming course. I created a file with all the functions used and a separate file where I call the functions and the game is played. Functions import random from random import randint def GenSecretNumber(): r = random.randint(10...

I hope your code review also raised the point that this code uses Java naming conventions rather than those of C#. — Enigmativity 47 secs ago
23:16
1406 (22001): Data too long for column 'publishing_year' at row 1
Another thing my sanitizing should've picked up.
TIL
Ah, it's not exactly data too long, it's just splitting wrong because there's an extra space in it.
23:44
    'Use cmd_query_iter for statements with multiple queries.')
mysql.connector.errors.InterfaceError: Use cmd_query_iter for statements with multiple queries.
Just when you think you've fixed it all....
WTF did I do wrong this time, it worked just fine for the other query.
Guess the other should've been done differently as well.
Apparently the following isn't a good idea at all:
    for result in self.cursor.execute(query, multi=True):
        self.connection.commit()
@Phrancis Opinion?
The following executes just fine:
    def create_table_books(self):
        query = """DROP TABLE IF EXISTS `books`;

        CREATE TABLE `books` (
          `id` int(8) NOT NULL AUTO_INCREMENT,
          `title` varchar(255) NOT NULL,
          `publishing_year` varchar(4) NOT NULL,
          PRIMARY KEY (`id`),
          UNIQUE KEY `id` (`id`)
        ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;"""
        for result in self.cursor.execute(query, multi=True):
            self.connection.commit()
While this doesn't:
    def create_table_authors(self):
        query = """DROP TABLE IF EXISTS `authors`;

        CREATE TABLE `authors` (
          `id` int(8) NOT NULL AUTO_INCREMENT,
          `author_name` varchar(255) NOT NULL,
          PRIMARY KEY (`id`),
          UNIQUE KEY `id` (`id`)
        ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;"""
        for result in self.cursor.execute(query, multi=True):
            self.connection.commit()
Which, IMO, is just about the same.
0
Q: Writting an computationally and storage efficient class in c++

WolfyI am writing a c++ class of "A simple least squares approach" by Longstaff and Schwartz. I have only finished writing a function for creating the stock price paths using geometric brownian motion. I am still a bit of a novice when it comes to writing classes in c++ and I just want to see if there...


« first day (1619 days earlier)      last day (2697 days later) »