instruction
stringlengths
71
95.1k
This is my solution to a question I asked on stackoverflow. The scenario is as follows: I got my X509 certificate and a pool of other X509 certificates. Now I want to calculate the chain of trust, starting from my certificate based on the pool. I realized that I can use openSSL in addition to Qt in the project, after d...
In this react component I'm trying to display one message on the screen at a time. This message has a 'bold' substring in it which should be accounted for. There's 2 endpoints here, message to retrieve a message, and bold which retrieves what is bold (with start and end keys to a substring) about the message passed i...
Goal I needed to interact with microcontrollers (ESP8266 & ESP32) via the Serial interface, so I wrote a small interactive shell with the command pattern. The defined commands can either accept no parameter or one int32 parameter. The API should be clear and easy to use, the code should only rely on Arduino.h, and data...
I'm new to Haskell, and this is one of the more interesting programs I've made with it so far. I understand there are already solutions to this problem that use much less code, but to me this one seems fairly intuitive. Are there any ways I can improve this code to be more readable or efficient? fib :: Int -> [Integer]...
I am trying to build a class similar to std::shared_ptr just to learn and improve my way of thinking. I am hoping that you can tell me if this implementation is correct? If so, how can I improve it? Here is the code: #include <iostream> #include <map> template<typename dataType> class shared_ptr { public: shared_p...
Given the classical problem to find triplets that sum to zero in an array. Is my Scala implementation correct and executed in O(N^2)? If yes, why? Can someone make a running time analysis. What other ways could we solve this issue? With duplicated elements and not using the two pointer technique? def tripletsFromArrayT...
I have some problems with code for my classes. Even though it works correctly, I run out of time for half of the examples. Here's the task (I really did my best trying to translate it): You have a permutation of numbers 1,2,...,n for some n. All consecutive numbers of permutations together create sequence a₁, a₂, a₊. Y...
I'm trying to solve a problem of how to group name objects. A name has firstName and lastName properties. Need to group the name objects that have identical lastnames and a similar firstName(aka Tom Smith and Thomas Smith should be grouped together). Case doesn't matter. The firstName equivalency is provided by a strin...
As a part of my bash routine I am printing some message in terminal regarding status of the workflow. The message in splited into two parts (part 1: begining of the task, part 2: status of its finishing) echo -n "Dataset is being processed ! "; execution of some AWK script; echo " Processing has been COMPLETED!" Here ...
I'm currently working on a grade calculator for a university (professionally), and I am wondering if anyone can suggest an improvement to the following query? Here is my database: The query returns the following table: SELECT `course`.`title` AS `course_title`, `yearGroup`.`id` AS `year_group_id`, ...
As part of a text buffer implemented as a piece table, there is an often called procedure to flatten a nested list of character lists. The function is part of constructing substrings of the buffer for display, copying, and cutting. I have been using a procedure based on Dan D.'s StackOverflow answer here: https://stack...
This is my custom function to join strings from an array into one string. We can provide normal separator and the last one. JoinStringsIntoArray(", ", " and ", words...) func JoinStringsIntoArray(sep string, lastSep string, words ...string) string { lastElementIndex := len(words) - 1 var joinedString string for index,...
I am new in C and I have to do a project which reads data from a .txt file and created linked list of structures to different operation on that structures (CRUD). The file contains data of rooms in a hotel and its guests with below pattern: --- 203 1 103.52 # Michal Novak Malinova 97, Bratislava 20210114 20210119 --- 1...
The point is to get the serial number of one of the hard drives on Windows. My code is based on an example from MSDN. I tried to make it an exception-safe, self-contained function. It works, to the best of my knowledge. All comments are welcome, especially about correctness, exception safety and performance issues. #de...
I frequently need to find then remove something from some Vec<> type struct field. Does the following represent an idiomatic approach to doing this? struct Roster{ names: Vec<String> //.. } impl Roster{ pub fn remove_name(&mut self, name: &str){ //are both of these lines necessary or could they be ...
Where I have, let us say an object, that I will only use once, what is considered general best practice in terms of declaring it as var vs. simply putting the object directly into the method it will be used in? I'm thinking this is going to come down to "which do you think is more readable", but given my lack of experi...
This is a follow up question to Encryption/Decryption algorithm #2 and Encryption/Decryption algorithm. In my last question, in @Reinderien's answer, he added this line from typing import List, and stuff like this m: List[List[int]]. Is that just for type hints? Would it be faster to use numpy arrays instead of python ...
This a small project for a beginner, it basically generate symbols digits letters depending on the user input I want to make the code better and learn from my mistakes. import string import random asklenght = 0 asku = int(input("Please choose a method:\n 1)Digits \n 2)Letters \n 3) Symbols \n 4) All \n ")) asklenght ...
I was thinking about this problem where you should make a function that takes an array and a target value and then it will find all the pair values that sums up to that target value. Of course there is the naive way using nested loops, but I want to avoid the O(n²) time complexity so I have came up with this solution. ...
So I am pretty new to JavaScript and I thought I might make an animation demonstrating a planet orbiting a sun in an elliptical orbit using Kepler's laws. I am struggling to get the speed right. So I want the speed of the planet to be slower further away from the sun, and faster closer to the sun. Within this method I...
I got a question: Design a parking system. There are 3 types of parking spaces: big, medium and small. Implement ParkingSystem class(int big, int medium, int small). Constructor takes a number of places of types. So ParkingSystem(1,2,3) means there are 1 big place, 2 medium and 3 small. Add method addCar(int carType) -...
I'm hoping to get feedback on my current code from someone more experienced in Django, and in the concepts I'm trying to implement. Let me preface by saying that I am a novice to Django. This is my first time using the framework. Here's the gist of my goals in my project: Create a web application that displays reddit ...
From searching online I have identified two ways to get the user email, but I don't know if either has pro's/con's beyond Option.1 being a larger number of lines of code? Option.1 I have a dedicated ClaimsPrincipalExtension.cs class, which I can call from anywhere in my app using var email = ClaimsPrincipalExtensions.G...
Small project i made to practice my c++, im a beginner and want to know all about optimizing code. Enemy starts off with 10 HP and we can damage them for 1 HP by pressing F1, If their HP is below their max they regenerate 1 point each second. #include <time.h> #include <Windows.h> #include <iostream> using namespace st...
I have a dataset which I divided into two sections horizontally. Column A of first section is the input variable and Column A of second section is the target variable. I am trying to build a Denoising Autoencoder that is trained using the target variable. Column A consists of string values which are one-hot encoded bef...
I have class structure to read the data from resource bundle (property files). import java.util.Locale; import java.util.Objects; import java.util.ResourceBundle; /** * The class will be used to read the resource bundle to achieve localization * and internationalization * */ public class ResourceBundleReader { ...
Similar to Microsoft's HCCB before its discontinuation near 2015, Im trying to make a 2D barcode that uses RGB pixels to encode more than two possible states (Black/White). Theoretically, at 100% data capacity, you could hold 16,777,216 different integers in a single pixel. However, this level of storage is not feasibl...
My requirement is to format the input values to a particular format as "##.###/##.###" Example - My input value can have alphabets, alphanumeric, numeric Expired -- > if alphabet, output as three space 2 --> only numeric, add "/" + "0" to format as "##.###/##.###" 3/2 --> "##.###/##.###" 0.2/3.4 --- "##.###/##...
I wrote a N-dim matrix (tensor) class, based on my previous 2D matrix implementation(2D Matrix in C++20 and Strassen's algorithm), accepting many helpful reviews from here. MatrixBase.h #ifndef FROZENCA_MATRIXBASE_H #define FROZENCA_MATRIXBASE_H #include <algorithm> #include <array> #include <cassert> #include <cstdde...
I wrote a program to convert float to it's binary IEEE754 representation in C. Any improvements to this is appreciated #include <stdio.h> #include <stdlib.h> void binary(float num) { int n = *(int *) &num; //Evil bit hack from Quake3 Q_sqrt function int size = sizeof(n) * 8; char *s = malloc(1 + size); //A...
I am trying to implement 3D Discrete Cosine Transformation calculation in Matlab with parallel computing parfor. The formula of 3D Discrete Cosine Transformation is as follows. The experimental implementation The experimental implementation of 3D Discrete Cosine Transformation function is DCT3D. function X=DCT3D(x) [...
This code returns a string of binary in 4-digit forms for a given hex in the form of string def str_bin_in_4digits(aString): retStr = '' for i in aString: retStr = retStr+"{0:04b}".format(int(i, 16))+" " return retStr.strip() for example, >>> str_bin_in_4digits("20AC") 0010 0000 1010 1100 The code...
I have written the below method to replace some of the email domains like @gmail.com and @yahoo.com with a given text. public static string RemovePersonalInfo(string input) { string[] tokens = input.Split(new char[] { ' ', '\t', '\r', '\n' }); string output = string.Empty; foreach (string token in tokens) ...
I am writing a Go package that handles communication with BoltDB as a part of some larger project. I have 2 methods for interacting with DB. func Lookup(path string) (string, bool) {} func RegisterUrl(path, url string) error {} Lookup makes a request to database to retrieve corresponding url, whereas RegisterUrl write...
I have these 2 version of code. Both are looking for all primes under a certain ceiling value. The first is testing against the set of all odd numbers. The second in testing against the set of all 6k-1 and 6k+1. In theory, the second version should be faster than the first. However the result states otherwise. For unde...
I got my code working with vanilla JavaScript, however I'm new to JS, so I don't know if the code is robust or not. Any advice to improve the code is welcome. Note: I just noticed a bug. The code removes the image from the DOM (is it the right term?) but it still submits the images that I deleted. Any idea how can I fi...
I'm practicing saving and reading serializable objects when a friend told me serializable objects have no use in real life, that I'd better focus on JSON or XML to serialize my objects when I came across this situation: I want to preload some FileFilters to use them in a JFileChooser dialog and I want these Filefilters...
I am new to c# and decided to write a classic todo app. The implementation of my application now is like this: there is a Task class that describes the task. The List class acts simultaneously as a storage and has methods for creating, deleting, and displaying tasks. How good is this approach, how can you do better (if...
In order to help with learning C++, I have been re-implementing games from old ZX80 books in C++. Here' the description of one I'm currently working on: You are a starship captain. You have crashed your ship on a strange planet and must take off again quickly in the alien ship you have captured. The ship's computer te...
Is there a way to simplify my code underneath? Basically I'm drawing a series of rectangles against each other on a mouse dragged event. The negative numbers are read from a 2D array in an other class (Board). I'm using positive numbers for dots (you need to connect dots with beams/blocks) also in an other class. That'...
I am building an application that needs to load 100-200 images (really only limited by performance) and display them to the user in a sort of gallery. A good analogy would simply be Google Images. In a linear implementation loading 100 images takes roughly 3-6 seconds, during which the GUI is frozen. I tried offloading...
public (List<Order>, Dictionary<int, string>, Dictionary<int, string>) GetOrders(int RestaurantID, int StartID) { List<Order> Orders = null; Dictionary<int, string> MenuItemsXml = null; Dictionary<int, string> OrderHistoryXml = null; string sql = "SELECT ev.ID, ev.RestaurantID, ev.Us...
I was trying to attempt below given challenge. I tried multiple ways to solve the problem but none of them were good enough to pass the time limit. Please advise if you have any idea to improve on this. Problem: You are visiting a building of N floors. On every floor, only one ladder of specified length is present. If ...
I wrote a brute-force attack on passwords using video cards for any algorithms with a 32-bit block and a 64-bit key, the password is only in BCD format, in the kernel source code the TEA algorithm, the project is written in c ++ builder 10.4, on a Radeon RX560 video card, a full brute-force attack from 0000000000000000...
I made a simple simulation of a falling ball. Is it possible to somehow improve or optimize this code? What tips can you give for development? #include <iostream> #include <cstdlib> #include <cmath> using namespace std; int timeFallingBall() { static int time(0); return ++time; } void fallingBall() { cout ...
I tried to add Dijkstra's algorithm to a js game. First when I got it working it was very very Laggy (5-10 fps) and the browser would crash.. After adding a lot more improvements I got it to like 50-60 fps with 200 tiles (see GRID_SPREADING in script bellow). When I turn off this algorithm I have 120-144 fps, but I am ...
Given an array arr[] of integers of size N that might contain duplicates, the task is to find all possible unique subsets. Link to the judge: LINK Note: Each subset should be sorted. Example 1: Input: N = 3, arr[] = {2,1,2} Output:(),(1),(1 2),(1 2 2),(2),(2 2) Explanation: All possible subsets = (),(2),(1),(1,2),(2),...
To get some practice with the Windows API and ctypes, I decided to write a program capable of injecting and running shellcode inside of another specified process. An example: C:\Users\Admin\Desktop>python inject.py -n explorer.exe -s shellcode.txt Remote memory address: 0x40a0000 Remote thread created. Thread ID: 7960 ...
Is there any room for improvements in this code. I am new to programming (python3), learning and practicing functions related to arguments recently. def make_pizza(*toppings, **pizza_info): """Creating a dictionary for pizza information""" pizza = {} pizza_toppings = [topping for topping in toppings] ...
I've started learning Clojure a few days ago and I wrote this code that factorises numbers. How do I make it better? Is there any way to avoid doing it with a loop? Is that how I am supposed to code in Clojure? (defn classify [n] (loop [n n i 2 f []] (cond (= n i) (conj f i) (= (mod ...
Hey Guys, I'm in the process of building a console program in C ++ that allows users to: sort a sequence of numbers loaded from a TXT file save sorted sequence in a new TXT file measure the sorting time for individual algorithm I decided to write such a program because I want to learn algorithms, how different sortin...
I have some python scripts to run on different computers. To avoid struggles with different paths and filenames I made specific config-files (DConfig, AConfig and MConfig) and another script that decides which config to use. It works, but I guess, there are better ways to do this. Any ideas? import os import socket ho...
My bash script mounts two VeraCrypt volumes, rsyncs their contents, and dismounts them. The script takes two parameters, the path for both the source and backup veracrypt volumes. I wrote this script so rsync wouldn't have to copy an entire volume if there was a single change in it. This is my second time with bash scr...
I'm learning sorting algorithms and wrote my own implementation of Insertion Sort. Is it optimal? Is there anything that can be done better? #include <iostream> #include <vector> #include <algorithm> #include <vector> void display(std::vector<int> arr) { for (int i = 0; i < arr.size(); ++i) { std::cout << ...
The previous question was not clear enough so I will try to clarify it more in this follow-up question. I tried the multiple pointers technique to solve the problem that find pair of values that sums up to a target value. We are assuming that: the array is already sorted. we are working with a static array of size 16...
I want to optimize this for loop for correcting coordinates of an image, it takes too long which is not suited for my system. I have done some profiling, the numpy roots is taking most of the time (near to 90%). Could someone suggest some optimization or vectorization of the code? Or a better alternative? src = cv2.imr...
I decided to not use heap in my program and create a custom memory manager to retrieve memory chunks from a big global array of uint8_t(u8). I chose u8 since 8 bits is a byte. The very big MEMORY_BLOCK_SIZE is not a problem since in Release builds the compiler will remove the unused bytes. I keep track of free memory c...
Background: This is supposed to be the sole worker thread to carry out long-lasting jobs in a GUI application. The GUI thread should be able to schedule tasks in a non-blocking manner and the tasks should que-up until the thread gets around executing them. I tried my best to make it exception safe. Code: #include <cond...
I am using psycopg2 & sqlalchemy to connect to a database and extract information from a table as follows: def db_connection(): eng = db.create_engine('my_URI') conn = eng.connect() return eng, conn def table_conn(): engine, connection = db_connection() metadata = db.MetaData() adm...
The following code generates a report showing performance of clan members in a game called Clash Royale. Everything is pretty self-explanatory, we are working with a lot of https requests, arrays and sorting. const https = require("https"); const clanTag = "L2P8GRJR"; const token = "TOKEN_HERE" let rawData = ''; let t...
This is a fairly standard project based on Jekyll/Liquid. I'm trying to iterate over data object to include pages with different variables. And since {% include %} and %{ include_relative }% tags are not permissive in terms of different symbols. This approach doesn't work: {% include_relative _components/ranking.html ...
from itertools import permutations def next_bigger(n): nlist = list(str(n)) perm = permutations(nlist,len(str(n))) perm = set(perm) listofperm = [] nlist = int("".join(nlist)) for x in perm: form = int("".join(x)) if form < nlist: continue else: li...
My question arises from this post on MSE where I have provided an answer to solve the question : There are multiple lists given. The number of lists is arbitrary. Each list contains numbers and is sorted descendingly. We shall take exactly \$1\$ element from each list and calculate the sum of elements.How would you go...
I've been teaching myself Python and decided to make a Tic Tac Toe game for a bit of practice. Any criticisms or pointers are welcome! class TicTacToe: """A class for playing tic tac toe""" def __init__(self): self.values = ["-", "-", "-", "-", "-", "-", "-", "-", "-"] ...
Given an array of unique numbers find the combinations Doing a shallow copy in the code to avoid changes to the passed obj by reference This has a run time of \$O(n \times \text{#ofcombinations})\$ - can this be done better -- iteratively and easy to understand import copy def gen_combinations(arr): # res = [[]]...
The Problem I am trying to determine numerically how many possible ways a number of books can be arranged on a shelf. Specifically, there are x3 categories "physics", "sci-fi", and "travel". Each contains N_phys, N_scifi, and N_travel numbers of books respectively. Within their category, the books can be placed in any ...
I am relearning data structures while trying to implement them on my own while also trying to get better at C++ as although I have knowledge of C, OOP is still non-inituitive to me. In this simple Vector implementation, I double the array size if it becomes equal to the capacity and half it when it becomes less than a ...
In this source code, i have writena program, using for loops, to print an english ruler whose length is given by the user. So what i want to know is that is it possible to modify this program, to print the ruler in a more logical way And if so, how can it be done, without applying reculsions ? This is the program to pr...
I have some code that populate EventfulConcurrentQueue which is ConcurrentQueue. So I need to save all data from EventfulConcurrentQueue to a database. I think to use sort of multithreading model in order to dequeue items. So EventfulConcurrentQueue should be depopulated from different threads that grab the part of i...
I am learning Python and I wrote a functional breadth-first search algorithm which I wanted to be as general as possible. I wrote some code to draw a grid and visually show the path found. My code will tell you about my coding abilities so please bear that in mind when providing any feedback; either way I will hear wha...
My question is have i gotten the three-layered architecture right with error handling etc. I have a webpage containing different resources. The code works but I am not sure if have structured it correct. This is a function located in the BLL createPost: function (accountId, title, body, callback) { postValidator.va...
I'm learning competitive programming and came across this question on LeetCode : 688. Knight Probability in Chessboard On an n x n chessboard, a knight starts at the cell (row, column) and attempts to make exactly k moves. The rows and columns are 0-indexed, so the top-left cell is (0, 0), and the bottom-right cell is...
I made this over the course of a week and a half, to use it for some Project Euler problems. My goal was to make something relatively efficient that could be used as easily as a builtin type. I also tried to make the code fully portable. I used c++20 because of the spaceship operator, implicit comparisons and the const...
The situation is, I have two fields in a database (or that can be derived) - when the message was received (Received, of type DateTime), and the day of the month (but not the month itself) that the message was supposed to be received (DayOfRun of type Integer, which is the last two digits of an ID column that doesn't o...
Is there a way to unify or refactor two methods that do basically the same but the difference being of handling a type of object or a collection of the same type of object? The following is an implementation of two methods that have very similar behavior. They handle a cache for an API, so when someone asks for a value...
I am not very familiar with Swing but am attempting to make a Reddit GUI. I've finally got everything to work as expected but I must admit, it's quite mundane and not very nice to look at. I want to add some visually appealing things to it but as I said I am very new to Swing. I got help making the components and such ...
I have ~40,000 JPEG images from the Kaggle melanoma classification competition. I created the following functions to denoise the images: # Denoising functions def denoise_single_image(img_path): img = cv2.imread(f'../data/jpeg/{img_path}') dst = cv2.fastNlMeansDenoising(img, 10,10,7,21) cv2.imwrite(f'../pro...
I've improved my N-dimensional C++20 matrix project (C++20 : N-dimensional minimal Matrix class). Implemented general matrix addition/subtraction, elementwise multiplication/division, dot product, matrix product, reshape, transpose. There's a lot of code: ObjectBase.h #ifndef FROZENCA_OBJECTBASE_H #define FROZENCA_OBJE...
I have to find the sum of number after performing square operation in the given input the negative numbers need to be ignored. The input Format is, first line is number of test cases followed by N as number of test inputs in new line followed by N space seperated numbers. The task need to be done using golang without u...
Exactly what the title says, this is a C++ class that attempts to read a file into a null-terminated string as efficiently as possible, using POSIX APIs. Obviously this is not intended to be portable code (other than between POSIX-compliant operating systems and GCC or clang), and the Slurp class would have a more exte...
I've written a method that is going to set a bit array by passing bool parameters to be able send correct command private byte _mode; public void SetConfiguration( bool mode1, bool mode2, bool mode3, bool mode4, bool mode5, bool mode6, ...
I've got this algorithm that's "complex". The comments in code give examples of how large the various data types could be. My CPU usage is less than 10% when running this and RAM usage is good. No leakage or anything. I have a list of arrays, where each array is x coordinates. We are storing a list of several x coordin...
I've recently found myself in need of several numpy functions in C++. I've decided to write my own header-only implementation of the numpy.array, including functions that I most commonly use in my projects. The biggest piece of advice I'm looking for is memory management. I create a lot of temporary arrays to swap axes...
I am trying to solve this InterviewBit problem. Problem Statement: You are given an array A consisting of strings made up of the letters ‘a’ and ‘b’ only. Each string goes through a number of operations, where: At time 1, you circularly rotate each string by 1 letter. At time 2, you circularly rotate the new rotated ...
The problem is to ask the user to guess a number between 1 to 100 and compare it with a random number of that range. If user guessed number is lesser/greater than the random number print "too low" or "too high" accordingly. Take new input asking the user to guess the correct number again. When the guessed number matche...
I have been reading through the rust book. I have made it to chapter 13, at the end of the section called (Storing Closures Using Generic Parameters and the Fn Traits) a couple of improvements are described and left as kind of an exercise. The task at hand is to change the cache implementation to support not only u32 b...
I have finished our first version of bin-packing-problem script, but would like to ask you, if there's a better way to organize boxes? Boxes should be organized to save as much space as possible, to make the "main" (blue) box as small as possible. But in some cases boxes do not organize well. let GrowingPacker = func...
For context, the whole of the project code can be found here. This question was created specifically for the progress.py file. The goal behind it is to allow progress of long-running tasks to be reported to a tty terminal. This helps you quickly figure out if your jobs are progressing or stalled. I have not tested this...
I just finished creating my first bash script that helps me to launch documents from terminal using a pdf viewer. This is very helpful and fast (at least I think so) for people who don't use any files manager (and have lots of documents of course); therefore they launch their pdf viewer and documents from terminal. I w...
So this is my task: You are given an irregular shape on a bitmap. How do you determine if a point is inside or ousdie of the shape? We are allowed to assume that helper functions are already available for us and we don't need to write them as well. So I decided that I can use a function that returns me the status of ...
#include <vector> std::vector<int> Range(int from, int to, int step = 1) { std::vector<int> range; if (step > 0) { for(int i = from; i < to; i += step) { range.push_back(i); } } else if (step < 0) { for(int i = from; i > to; i += step) { range.push_back(i); ...
I want to use TIdTCPClient to connect to Redis from a web server application made with Delphi and TWebModule. Currently on WebModule creation I create a new TIdTCPClient and on web module destroy, I disconnect and free the resource. All works... But this way I create a new connection on every new request and after a lo...
I am thinking about the following problem: Consider a 3-numbers lock, i.e. a lock which has three little number wheels that opens whenever the sum of these three numbers equals 75. I know, this doesn't make sense for a lock, but just imagine this. The number wheels have numbers 3, 15, 17, 35, 40, 25, 5, 13. I am allowe...
I have made a function which takes a string which can be any of "triangle", "square" or "rectangle". Depending on the string I return a pointer to an instance of class Form. My class Form has subclasses Triangle, Square and Rectangle. My constraints were: use C++98 no STL library (no map, vector etc) no friend, and no...
Is there any way to reduce this code? It repeats itself, but I cannot find any way to reduce it because it is only repeating inside one elif. Sorry I'm a beginner my code is quite bad It repeats here: onze(joueurs) print("joueur", a + 1, "a", joueurs[a]) time.sleep(1) while s...
Apologies for the cryptic title, but the problem really is rather simple. I have a 64 bit integer which I interpret as 16 4 bit nibbles, or a nibble array if you wish, and I needed generate a mask covering the nibbles which are zero, or the inverse. I have already come up with a solution, but it seems to me that there ...
Standard code review, tell me what's good, what's bad, and how to improve. Critical suggestions welcomed. This is a content aggregator using bs4 and requests. I did not use any tutorials or help. import requests from bs4 import BeautifulSoup as bs topic = input('Enter the topic: ').lower() print() def getdata(url, hea...
I wrote a fileupload function for my application. Basically the application is a web based folder structure, which has files included. I don't know, but I am not happy with it. Is it too long? Can I do some parts easier? Is the logging ok? So many questions... The FileModel is inerhiting from ParentModel. public Act...
Just want you guys to review my python 3 IRC bot code, it is actually a fork of https://github.com/Orderchaos/LinuxAcademy-IRC-Bot You can see the source code at github I also have questions: I really can't find out how to change the ident for the bot, can I change the ident? Can I change the ident by modifying the us...
I originally wrote a rough C++ wrapper of the sqlite3 c library which did not use prepared statements. This code is my attempt at using prepared statements. I have attempted to make the wrapper as generic as possible so can be used in a wide range of applications. How easy to use do you think this C++ class is? Any b...