instruction
stringlengths
71
39k
So I am working on an x86 Assembly program for Linux using NASM. This program basically asks the user for their name and their favorite color. After doing this and storing the two strings in variables declared in the .bss section, the program prints "No way name of user, favorite color is my favorite color, too! The pr...
(Originally posted on Stack Overflow) Following my findings and suggestions in my other post How to exclude a list of full directory paths in find command on Solaris, I have decided to write a Perl version of this script and see how I could optimize it to run faster than a native find command. So far, the results are i...
I am a self taught programmer and, while I understand data structures at a theoretical level (as well as through optimizing my own code), I have never actually taken the time to write my own implementation of all the major ones. So, here is my linked list. I would appreciate any feedback you guys can offer to me, espe...
I just started playing with Python and was hoping to get some feedback regarding the quality of the following snippet. Does this look like proper Python? What would you change? Is this small script well structured? Quick description of functional goal: reorder list such that each element is followed by the value closes...
As an excercise to "Haskell: The Craft of Functional Programming", I created some code to convert an Integer to Roman numerals. This is the first version and I think I'm probably not doing it in the "Haskell way" since my background is in imperative programming. Any advice on how to improve this? Sometimes I think I'm ...
This is my architecture to EF4 using repository pattern and unit of work pattern with POCO. I believe I made some mistakes. I have a solution with 5 projects: MyApp.Common MyApp.Data.EF4 MyApp.Domain.Company MyApp.Domain.Transmission MyApp.Web In addition, I am using StructureMap in this application in order to injec...
I am just wondering if this is a correct way to execute multiple query from a text file. Connection conn = Utility.getConnection(); Statement stmt = null; try{ JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(chooser); if(returnVal == JFileChooser.APPROVE_OPTION) { St...
I know close to nothing about jQuery, but I swear I'm trying to learn. The thing is, I've got some code that works, but I know it's repetitive and probably not kosher for a real programmer, which is why I've turned to you all. What I want to do is show/hide (or toggle, whatever you think is best) some informational div...
I have a private field called individualProfile (camelCase) and I've created a public property called IndividualProfile (PascalCase) on it: private Profile individualProfile; public Profile IndividualProfile { get { if (individualProfile == null) { individualProfile = ProfileFacade.I...
I'm teaching myself JavaScript and jQuery at the same time by trying to complete little projects that I come up with or my friends come up with. I have no official JavaScript training and am pretty much just OJT (without the job). I created a function below and was hoping I could get some feedback from the experts and ...
I am aware of it being frowned upon to do something like write C# in JavaScript. (see this if you don't know what I'm talking about) But as a judgement call, I think we could stand to have a relatively simple check for values that are null or empty, so I'm looking for feedback on this implementation of String.isNullOrE...
Please review this simple code. When I review it I decide to rewrite so that it doesn't write to a template, but instead directly to output since the whole HTML is fetched from the data layer. I used the tool appengine_admin to get editable HTML for simple html capabilities to an appspot project: class Page(db.Mode...
I say this is right because X might happen and Y modification to the code is possible in the future. More senior guy says the sorta similar thing, except along the lines "I'm right, you're wrong." Then I back off, b/c he is more senior. Here I implement a method playMatingGameA(String). My more senior coworker provide...
What difference does this make: <script type="text/javascript"> //<![CDATA[ ...code Compared to this <script type="text/javascript"> ...code
I have created a really simple repository for some simple data retrieval and was wondering if i was going in the right direction. Has anyone got any thoughts on this? interface public interface IRepository<T> where T : class { IEnumerable<T> GetAll(); T GetById(int id); IEnumerable<T> Filter(Expression<Fun...
I'd like to know if i respect strlcat(3) behiour with my implementation, cause i'm not really sure to understand strlcat particular behaviour int my_strlcat(char *dest, char *src, int size) { int i; int src_len; int dest_len; i = 0; dest_len = strlen(dest); src_len = strlen(src); if (size <= 0) return...
I have simple code, that draw graph of my histogram. But code looks ugly, do you have idea, how can I make it looks better ? for (int i = 0; i < hueCount - 2; ++i) { if( i % 6 == 0) g.DrawLine(borderPen, margin+ (width - 2 * margin) * ((float)i ...
I have the following code (for Country and City classes key_name is numeric id with addition of 'i' at the beginning): def add_country(country, country_name): if country and country_namef and country_name != '': return Country.get_or_insert('i'+str(country), country_name=country_name) else: return None d...
I've coded a simple quiz game for Android, and currently Im having troubles with making questions not appear after they've been shown, i.o. I dont want it to ask me the same question twice.. This is the method Im using private void QBegin() { /* * Gets a random question */ question = (TextView) findView...
I need to compare some values of a Javascript object. If they fail to be identical, I want to pretty print to console.log the mismatch. The initial code I have written which I find fugly after a JS beautify looks like: function assert(a, b, message) { if (a != b) { console.log("Failed to match " + message + " " + a...
I'm attempting to implement a calculator-like application in C#. But the way I've currently implemented it seems a little messy and inefficient. It works, but it's just I'm pretty sure it can be achieved in a more elegant solution. I looked to see if I could factor out any repeating code, such as the switch statement -...
I've always wanted to come up with my own algorithm for encryption. Last evening I started writing "TreeShell" encryption algorithm that uses bit shifting and XOR operations on the bit level to do encryption. This algorithm allows arbitrary length of data and protection key. The key is not stored, but hashed together ...
I try to replace multiple occurrences of a character with a single character. Input: hhiii!!! hooowww aaareee yyyooou??? Output: hi! how are you? public class CharSingleOccurrence { public static void main(String... args){ charSingleOccurrence("hhiii!!! hooowww aaareee yyyooou???"); } ...
I'm running the below script on a WordPress powered site. It's very heavy on the animations and uses AJAX to fetch posts and load them into a div. Three things I wanted to address: Cleaning up the code so that it runs faster/better Sometimes the AJAX request doesn't get the next post and either keeps showing the same ...
In Test::Version I want to add configuration settings that allow one to toggle certain features. I'm thinking about passing an anonymous hash to a custom import like so. use Test::Version 1.2 qw( version_ok ), { is_strict => '1', has_version => '0' }; other options I've thought of include package variables (though mor...
So this is my first time going over a pretty big nested object, was posting this up to see how I can possibly cut this down. (Some fears I have would be, I currently know the extent of the nesting (4) but could be more in the future. Which I'm not accounting for. ) The code below sits within a function: if (itemLi.ite...
I'm using the Model View Presenter (MVP) pattern in MFC that's not hugely relevant to my question but I mention it for context. I have some code that is designed to populate a list control with data from a list. I have two list boxes which have almost the same code except the type of list is different and the function...
I'm a student and I've created this MySQL database schema for my Service Order Management academic project. I want to know if I need to improve it and, if so, how I could do that. /* * Table 'brands' */ CREATE TABLE `brands` ( `brand_id` INTEGER NOT NULL, `equipment_id` INTEGER NOT NULL, `brand` VARCHAR(...
Is there anything that can be done differently for this function? Any way to make it faster? public List<Channel> ChildrenOf(Channel startingChannel) { List<Channel> result = new List<Channel>(); foreach (Channel child in startingChannel.Children) { result.Add(child); result.AddRange(Child...
public List<Channel> Children { get { return myChannels.Where(c => c.ParentChannelId == this.Id).ToList(); } } is this the right way to get children ? it does work, the question is if its the only way. could give me an example for other methods of acheiving the sam...
I have a method to compare two byte arrays. The code is Java-style, and there are many if-elses. def assertArray(b1: Array[Byte], b2: Array[Byte]) { if (b1 == null && b2 == null) return; else if (b1 != null && b2 != null) { if (b1.length != b2.length) throw new AssertionError("b1.length != b2.length") else ...
We deliver content for different devices - web, smart tv, tablet and mobile - and I'm trying to provide a common JavaScript interface providing functions like play stream, alert, log etc without thinking of how the device actually do this. My question is: Is there a way to provide this like an interface, that the Devic...
After finishing this article : Lessons From A Review Of JavaScript Code I was wondering if my namespace /** * The primary namespace object * @type {Object} * @alias BDDS */ if(!window['BDDS']) { window['BDDS'] = {}; } if attached to the window, is this snippet invalid, according to the following? Problem 9 Pr...
Here is the problem: A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers...
I decided to try and implement (a version of) the simulated annealing algorithm using just LINQ, just to see if I could. I'd love it if anybody could see any ways to improve it, or give advice on any cool tricks for doing this kind of thing. var result = (from res in Enumerable.Range(0, 1) let R = new...
There are quite a few things I am considering: I will have to check for null values I will have serious trouble persisting it in the database. How do I improve this or re-factor this for better results? public class ErrorLog { public static void LogError(Exception e) { var exceptionLo...
I need some feedback here. Due to a weird issue on my server system, the network card disconnects from the network regularly. I'll fix this at a later date. But I wanted to know if the below script can be improved. It's comprised of two files. A python script (autoConnect.py), and a Bash script (checkOnline.sh). autoCo...
I want to make a form which looks like this: Column A Column B 1 Textbox AA Textbox BB 2 Textbox AA Textbox BB I've coded it like this: <form id="deps" name="deps" action="" method="POST"> <ul> <li> <span class="er">&nbsp;</spa...
I'm new to Ruby. I normally sling code in C#. What could I do to make this simple Soundex class more Rubyesque? class Surname attr_accessor :value def initialize(input) @value = input end def soundex result = '' @value.chars.drop(1).each do |s| number = soundex_value(s).to_s result &lt...
I created a simple function for swiftmailer to send two different messages for support and client. Not sure i did it the rigth way as I am using two different instances for message and one mailer instance. Everything works just fine but am I doing it the right way or I have to create separate mailer instance for each m...
I got this code working with the jQuery Countdown Plugin to take a string input and output a countdown in a div. Is there a better way of implementing this? JSFiddler HTML <div id="defaultCountdown" class="arg">Here</div> Script function stringToCountdown(element,str){ /* Parse the String */ var hh ...
I have a dynamic order page which has to update multiple elements when a value is changed. Here is the main function that does that. Note it only updates the values if they are different from what is already there. So for example it doesn't update with a checkmark, if there already is a check mark there. function re...
This is the first time I have written Unit Tests. I am testing code that I have already written and would like to move to TDD once I have managed to get units written for everything that is already in my application. Just wanted to be sure that the tests that I have written look good, or if there is a different approa...
I have this function that should merge two array of classes when id of array1 is equal to id of array2. For simplicity I converted one array into an ArrayList so I can remove the occurrence merged into the other one.. I'm looking a way to improve it, also in cpu-time, because the two arrays can have more then 20000rows...
well, as said in the title: We need to get a mac-address of a NIC that is providing the connection to a particular host. We use the mac-address during the login process using MSSQL and Entity Framework. technology: C#.NET 4.0, EF 4.1 private string _max_address; public string ConnectionString { get; }; public string M...
I have made a carousel with sections and animated background images. How can I make the code better and more reusable? It's now working with a width of only 3 sections. $(function () { var state = 0; var background = $(".selection-carousel .carousel-image"), buttonLeft = $(".selection-carousel .carousel...
This is my code. I am having a file, whose first line's second word contains a number. Let this number is $u. 2nd line is empty, and from third line, I am given with two numbers separated by a space in each line where let first number is $c and second is $w. Now I need to figure out the minimum $b where $b for a line i...
I am not so much used to OOP designing, So I took one of the very commonly used interview question , "Designing the Elevator System". Below is the prototype. I would like to get some feedback on the design like Best practices which will have a particular aspect Flexibility in the code Some important generic feature m...
TO DO exception handling merge with dynamic arrary *SO Bug here--remove this line and Control K will not work /* Added in comments from Jerry, Ed and Loki This code borrows from from http://cslibrary.stanford.edu/ C++ Version - lnode, lnode_reverse, lnode_push, lnode_print, lnode_count */ #include "c_arclib.cp...
Feel free to critique this database wrapper which is written as a code example for employers or clients. <?php class Database { static function getInstance() { if (self::$instance == NULL) { self::$instance = new Database(); } return self::$inst...
Here are the 3 files that make up my MVC. The two view files containing the HTML are not included. Any advice on how to improve this so it is usable by others. It is meant to be a light-weight alternative to heavier libraries. Thanks! <?php // index.php /* When the user hits reload button on browser */ include...
I'm experimenting with moving shapes in JavaScript with a canvas tag. I have one half circle (only stroked) which rotates on set intervals. I've written the code so many more can be added. I can give starting rotations and a lot of other handy parameters. I've tried this with twelve circles and it looks exactly like I ...
I'm an absolute beginner in PHP OOP in search of the "Holy Grail" of connecting to MySQL database once and reusing this connection for the whole site. classes/db.php <?php define('SERVER', 'localhost'); define('USERNAME', 'root'); define('PASSWORD', 'password'); define('DATABASE', 'cms'); class DB { function __con...
For the last few day I tried to figure out how to work with MySQL and PDO. Although I've tried to read a lot about the subject, there are still a lot of things I don't understand. Because of this lack of knowledge, I can't really judge this code (or other example code on-line) on its safety and logic, and therefore was...
In building any new application I end up using something similar to this data access type code. I know it well, and it works well. But in the act of wanting to try something new on a new project I thought I could review it again and maybe simplify it more, or move it into an ORM. I've been looking at Dapper, though I k...
This is primarily a container for quicksort and mergesort: #include "c_arclib.cpp" template <class T> class dynamic_array { private: T* array; T* scratch; public: int size; dynamic_array(int sizein) { size=sizein; array = new T[size](); } void print_array() { ...
class BencodeObject: def __init__(self,filename): with open(filename,'rb') as diskbytes: self.loads(diskbytes) def _isdictionary(self,bits): return(bits == b"d") def _isnumber(self,bits): return(bits > b"/" and bits < b":") def _iscolon(self,bits): return(bits == b":") def _isint(self,bits): return(bits =...
I know that there are many similar questions, but I don't understand most of those questions because I'm not sure if I know what a factory method pattern is. So, after reading many examples over the web, I came up with the following simple classes. Am I doing it correctly? If so...any improvements I can add? abstract c...
In a WPF application I have the following event handler for PreviewTextInput event in ComboBox control. The main purpose of this code is to select an item in ComboBox via pressing a letter key. There is duplicated logic in this code and I want it removed. private void OnTextComboBoxPreviewTextInput(object sender, TextC...
I needed to write a function which would 'error diffuse' floating values to integers: errorDiffuse :: Double -> Int -> Double -> [Int] errorDiffuse _ 0 _ = [] errorDiffuse v num err = tv : errorDiffuse v (num - 1) (err + v - fromIntegral tv) where tv = truncate (v + err) So that, for example: errorDiffuse 1.4 ...
I'm learning to Jinja2 and what's important in this case isn't speed but i18n translations and functionality. With Python 2.7, Jinja2 and not Django seems to preferred way to go, so I'm rewriting much of my project to use Jinja2 templates. We already had plenty of translations in .mo and .po files and wanted to keep us...
I'm creating a design database for an autoparts store (this is a project school). For the moment, I'm not sure if the relationship model especially in MODEL, MAKE, BRAND is correct (I really have no experience about this area). I'm not an expert in this area, so I need some help. create database AutoParts2 use AutoPar...
This is the result of the code it has extra option tags no idea why. I have no idea why It produces the extra option box. Below is the result of the query. Correct number of rows correct response... ParentID Parent 1 Pipe 2 Valve 3 Control Valve 4 Pump 5 Chamber 6 Meter 7...
CustomDialog is the parent abstract class for OkExclamationDialog and ExclamationDialog with abstract method displayDialog() being overriden. Does this fall into a design pattern? Can this design be improved upon? JudgeButton controls the other classes. public class JudgeButton { private int typeCode; private...
I wrote this without much thought: (defn- tail-cmd "Construct a tail cmd" [file n & ignore-patterns] (clojure.string/join " | " (flatten [(format "tail -n %s -f %s" (or n 200) file) (map #(format "grep --line-buffered -v \"%s\"" %) ignore-patterns)]))) On further thought, I'm...
It's my first stab at TCP/IP and honestly I'm just starting out on C# also, so any comments on the design, method, etc are more than welcome. Basically I wanted to create a listening thread and someday a sending thread, that can handle listen/send heartbeat message and also other messages. Once it retrieve the message,...
I have fair concept in a programming (learner) but not an expert to refactor code at the highest level. I am trying to read a huge (100MB-2GB) XML file and parse necessary element (attributes) from a file into MySQLdb. The code is working perfectly as I have tested in small file sizes. But, unfortunately when I got big...
How does this look for basic image rotation? What is there to be improved here? <p> <img src='images/rotation/dsc_0052.jpg' id='rotateImg0' alt='image rotation' /> <img src='images/rotation/bilde1.jpg' id='rotateImg1' style='display:none;' alt='image rotation' /> <img src='images/rotation/bilde2.jpg' id='ro...
I am starting to learn Ruby. This is pretty much the first thing I have coded. It's very simple; it's a prime number calculator. Since this is my first Ruby code, I would like some review on the following: Adherence to Ruby standards Is it done in the Ruby way (the way a Rubyist would have coded it)? Adherence to Rub...
I'm looking for the most concise regex that matches one or two 4-digit years in any the following setups: year year- -year year-year I can't think of anything slicker than this: [\\-]?\d{4}|\d{4}\[\\-](\d{4})?
What can I do better? $(function () { "use strict"; /* * Header text. Vergroot de tekst door op lees meer te klikken */ var heading = $(".header .text h2").height(), firstP = $(".header p:first").height(), areaSmall = heading + firstP, areaBig = $(".header .text").height(...
I have been developing Javascript for few months, and, as a former Java developer, needed a simple way to perform class inheritance. My needs are: having private members not accessible (encapsulation), to make inheritance simple, to avoid 'new' keywords bugs, to let the superclass methods accessible using the this.sup...
I want to review the URL routing for my appengine webapp: routes = [ (r'/', CyberFazeHandler), (r'/vi/(eyes|mouth|nose)', CyberFazeHandler), (r'/realtime', RealtimeHandler), (r'/task/refresh-user/(.*)', RefreshUserHandler), ('/ai', FileUploadFormHandler), ('/serve/([^/]+)...
I have the following code which works but seems like it could be improved. I'm not sure if I'm using event.stopPropagation() correctly or if it is the best solution. The elements are loaded via AJAX and so need to have .on() (previously .live(), which is now deprecated in jQuery 1.7). I've used the example given here a...
I have multiple form validation checks around my site so I decided to write them as functions to simplify the process of creating the validation pages, here is a snippet for an understanding of what I'm doing. // Declare regex variables $regex_email = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/"; $regex_p...
This is a switch statement in JavaScript. I have a feeling that it can be done in a shorter way. switch(n.length){ case 1: n = '00000' + n; break; case 2: n = '0000' + n; break; case 3: n = '000' + n; break; case 4: n = '00' + n; break; case 5: n = '0' + n; break; }
How can I write this shorter? $('#pietra_svg #p1_4 polygon#p1').click(function() { $('#apla_p1').fadeIn("slow"); return false; }); $('#pietra_svg #p1_4 polygon#p2').click(function() { $('#apla_p2').fadeIn("slow"); return false; }); $('#pietra_svg #p1_4 polygon#p3').click(function() { $('#apla_p3').fadeIn("slo...
This is a sample exercise tutorial that would be used to test understanding of how simple classes communicate/message and are designed. Tester class public class GuessingGameTester { public static void main(String[] args){ //create a new game GuessingGame g1 = new GuessingGame(); //call th...
This is my first attempt ever to build a Vector2 class. I scoured the net for anything that might make this class more efficient but know I'm to the point where I'm ready to share. This way I can get advice on how I can improve it further. I wanted to do this before I make my Vector3 and Vector4 class. Vector2.h //VE...
Should take an array such as ['dog', 'cat', 'bird', 'monkey'] and return 'dog, cat, bird and monkey'. Looking for a more elegant solution. def self.english_join(array) return nil if array.nil? return array[0] if array.length == 1 return array[0..-2].join(', ') + " and " + array[-1] if array.length > 1 end
After taking into account answers for my questions here and here I created (well may-be) improved version of my wrapper. The key issue was what if an attacker is knowing what is encoded - he might then find the key and encode another messages. So I added XOR before encryption. I also in this version prepend IV to the d...
I learned here that it is unsafe to design encryption algorithms from scratch. Given that advice, I made a pair of encryption functions based on mcrypt: function aes128ctr_en($data,$key,$hmac = false) { $key = ($hmac===false) ? hash('sha256',$key,true) : hash_hmac('sha256',$key,$hmac,true); $data .= hash('md5',...
I am having trouble with the random number generator. For week 0 only, I want to set the starting number of roaches in House A (totalRoachesInHouseA) to 97 and the number of roaches in House B (totalRoachesInHouseB) to 79. Then, for weeks 1 to 10, I want to generate random numbers for both houses. I am trying to get th...
Windows console windows do unfortunately not support stream I/O of international characters. For instance, in Windows 7, you can still do "chcp 65001" (sets the active code page to UTF-8), type "more", and get a crash. This means that it's practically impossible for a novice to write a "Hello, world!" program that: ha...
//parses the text path vector into the engine void Level::PopulatePathVectors(string pathTable) { // Read the file line by line. ifstream myFile(pathTable); for (unsigned int i = 0; i < nodes.size(); i++) { pathLookupVectors.push_back(vector<vector<int>>()); for (unsign...
I was wondering if you could review the following code I've written as a polyfill for the placeholder attribute in HTML5? The object of the polyfill is to replicate the functionality of the placeholder attribute. In effect, the polyfill is supposed to do the following: Default text to be shown. On Focus: Erase the def...
There are two keys: the main is aes128 and the second is XTEA, used just for randomization of data inside the AES. Randomization is done with secret random key that is not know even if someone knows exactly what is encrypted. Also the key is produced by doing hash many number of times and this hash is salted with the i...
I am developing a multilingual site, so i needed some sort of a function to detect user locale, as well as not to scare away search engines, so I wrote this kind of a method to detect locale. The priority is as following: We look if user has active language in $_SESSION; If not, we look in the database to detect user...
In this case I have an array that is parsed from a JSON file. Normally I use all the elements in the array, but for AJAX crawling I only show the parts the search engine asked for: <?php $fitstyles = json_decode(file_get_contents(DATA_FILE), true); ?> … <?php if ($base == "fits" || $base == "gallery") { /* For frag...
I have the following code as part of an sqlCommand which is calling a stored procedure: Dim groupObj If groupId = 0 Then groupObj = DBNull.Value Else groupObj = groupId End If Dim siteObj If siteId = 0 Then siteObj = DBNull.Value Else siteObj = siteId End If sqlCommand.Parameters.Add(New SqlClient.S...
Does anyone know of a better / cleaner way to write the following: GetSafeTagName(txtUserInput.text); public static string GetSafeTagName(string tag) { tag = tag.ToUpper() .Replace("'","`") .Replace('"','`') .Replace("&", "and") .Replace(",",":") .Replace(@"\","/"); //Do not allow escaped chara...
This is a simple form validation script. I'd like to: improve the jQuery validation simplify the jQuery code Questions: Should I be exporting pure JS validation to avoid potential conflicts with other libraries that users might have installed? Is it worth the effort or should I stick with my jQuery code? Is there a ...
I've created a small method to test the connection to a database: public bool TestConnection(string provider, string serverName, string initialCatalog, string userId, string password, bool integratedSecurity) { var canConnect = false; var connectionString = integratedSecurity ? string.Format("Provider={0};Data...
I'm working on a small project with dBase files from a 3rd party. Realizing that most of the code to fetch tables and form objects is the same, I made this function: public static IEnumerable<T> OleDbFetch<T>(Func<OleDbDataReader, T> formator, string connectionString, string query) { var conn = new OleDbConnection(...
EDIT - 0 - Still need to fix markup language to make more unique so escaping is not needed: This will be a JSON / JQuery Alternative. /******************** group:ajax ********************/ /* - ajax_object() - creates a browser dependent ajax_object for the ajax method call - good place to add mysql logging to trac...
I am working on a fifteen puzzle, and just got it working finally. My next step is to implement an Iterative Deepening search on the puzzle to solve it. I assume you go column by column, row by row with a loop until the checkwin function is complete? I would really love any pointers or guidance that can be given. Does ...
I just started working in a project that wasn't developed by me, I'm worried about some of the functionalities and I would like some suggestions. After the login validations, the login procedure is made like this: var _ticket = new FormsAuthenticationTicket(1, user.ID, DateTime.Now, DateTime.Now.AddDays(30), true, user...
First of all: I am a total javascript beginner and therefore I am asking you to rate my script and tell me whether its okay or just a big mess. Note: it does work, but I guess it could be improved. My main goal was to create a script, than can be used multiple times and does not depend on any class or id name (thats wh...
I was wondering if there was a more efficient way of taking strings that represent dates with the pattern being mmddyy or mmd yy or m d yy and converting them into a DateTime object? 111110 would be 11 11 10 111 10 would be 11 1 10 1 1 10 would be 1 1 10 The spaces are either ' ' or '\0' (the input I am given is not ve...
How can I improve this? GitHub import os, platform, logging, logging.handlers, glob from time import * import tarfile import zipfile, zlib class backup: source_s = '' destination_d = '' def __init__(self): if strftime("%p") == 'AM': if strftime("%I") in ['12', '01', '02', '03', '04',...