instruction
stringlengths
71
39k
This piece of code basically just asks for a word and sees if it exists in a file. If not, the user is asked if it should be added to the file. I am new to C programming and I want to know what you think about my code: things to change, things to remove, what not to do. #include <stdlib.h> #include <stdio.h> #include <...
I'm trying to optimize a python string that works on big data sets, the way it works is by taking in a with a list of keywords and scores and taking in a file loaded with data from the twitter api. The program does a keyword match against tweet text. At the end of the program I want to produce an average for each term ...
What are your thoughts on the fallowing immutable stack implementation? It is implemented having as a basis a C# immutable stack (where garbage collector assistance does not impose using a reference counted implementation like here). namespace immutable { template<typename T> class stack: public std::enable_sha...
I recently started learning Haskell and as my first project I decided to port a particle simulation I had written in C. The simulation is pretty simple. We have a cubic box with particles (spheres) inside it. Then we choose to either move a particle or to change the volume of the box and check for any collisions betwee...
The requirement is to skip a line beginning from # sign. Basically, we need to treat it as a comment line. The input is given by the user from the keyboard. I will not be reading it from a file. I have a link to the code that i have written so far. In this code, I have used multiple lines to skip a commented line whic...
I wrote this simple function in CoffeeScript to see if elements are found in an array: isFoundIn = (searchTerm, arrayToSearch) -> returnVal = false for a in arrayToSearch returnVal = true if searchTerm is a returnVal Usage: isFoundIn('james', ['robert', 'michael', 'james'])` would return true. I know in Rub...
I have recently had a whole load of help trying to roll my own loosely-coupled Observable/Observer paradigm, here: https://stackoverflow.com/questions/16498315/loosely-coupled-observer-pattern To keep things simple and to aid in my understanding of the basic concepts, I asked about a specific implementation of Dog (Obs...
I couldn't find a good example, so after some fighting with writing non-serializable object to file in Android, I decided to show you my solution. Could you tell me if it is OK or how could it be improved? This class is used to store information in a file. writeObject and readObject methods were created, because androi...
I have the following code that allows easy creation, pulling, and deletion of Tickets in a CakePHP application. App::uses('Component', 'Controller'); App::uses('Ticket', 'Model'); App::import(array('Security')); class TicketComponent extends Component { public $name = 'Ticket'; // Create a new ticket by provi...
I have written the following Javascript class function InScroll( container, options ) { "use strict"; var isRunning = false; // utilities var noop = function() {}; var inter = null; if(!container) { alert('container element not provided'); return; } if(!options.interva...
When I need to get maximum value of A, B, and C, then I would write like: val = A; val = max(val, B); val = max(val, C); But, in this case, I need to write two "val" in the one line. And, it is cumbersome if the "val" is more complex like "val[0][1][2].element"... If it is adding value, I can write like "val += B" wit...
I have the following mockup that I need some feedback on how I might improve the url_decode function to make it faster and use less memory. There are a couple of requirements. I have to use the StringArg and StringReturn structs. I also need to completely decode the string. I am aware of double encoded attacks, but t...
I am using this code for my responsive layout mobile sidebar hide/show. I am not an expert in jQuery and just wonder if I can optimize this code with the same functionality. $(function() { var a = $("#sidepanelpull"); var l = $("#sidepanelclose"); side = $(".qa-sidepanel"); sideHeight = side.height(); ...
I have this small Haskell script that I wrote some time ago to parse a set of financial CSV files to produce other CSV files. I've recently had a problem with large input files (around 300Mb) that I solved with RTS options. Still, I'd like to make it more lazy and efficient. For example, I noted that it loads the whol...
I want to make a container which manages big objects. which performs deep copies on copy construction and copy assignment. I also like the interface of the std containers, so I wanted to implement it using public inheritance: template <class TBigObject> class Container : public std::vector< std::shared_ptr<TBigObject> ...
ETC = "Estimated Time of Completion" I'm counting the time it takes to run through a loop and showing the user some numbers that tells him/her how much time, approximately, the full process will take. I feel like this is a common thing that everyone does on occasion and I would like to know if you have any guidelines t...
Can I do something better with this code? It's just a snippet of a library I wrote. <?php /* * Variable.class.php * (c) 2013 sinan eker`enter code here` * */ class Variable extends Config { protected static $vars = array(); final public static function variables(){ return static::$vars; } ...
In the ZF2 model mapper, mappings are quite often duplicated in the original mapping class & other mapping classes. I am using a static mapping methods (mapToInternal, mapToExternal) to remove this duplication. Could this be done any better? <?php //... /** * Class ItemTable * * @package Job\Model\Mapper\Item */...
I try to intercept some OpenGL calls for testing my rendering classes. Reflection is used for replacing the OpenGL backend. I feel this class is badly written and I need advices for refactoring it. package fr.meuns.opengl; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java...
I am looking for a starting point to code plugins, primarily for Zepto.js (with fall back for jQuery). These will provide reusable functions for Tumblr theming. However, I can't seem to find anything in depth about writing a plugin (with Zepto) as the example, apart from a small snippet on the Zepto site: http://zepto...
I need to get the numbers in a string like "1,2,5-9", the function should return a list with these values ​​[1,2,5,6,7,8,9] Here's what I did. Is this the best way or there's something simpler/better? function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function getNumbers(stringNumbers) { var num...
I wrote a class with this function. Can I improve my code performance in the bottom of the function? I don't like the while loops! public function loadFields(array $fields, $as_object = Config::FIELDS_AS_OBJECT) { $connection = $this->connection; $sql = "SELECT ".implode(",", $fields)." FROM ".$this->ta...
I'm working on a web application using Bottle, and it is, at this point, functional. The gist of it is that I have a database of drinks, with associated IDs, and associated sets of ingredients. the name and ID of the drink are passed to the client, which displays them. Currently, when the program loads up, all drinks ...
I want to play around with the Powerball lotto drawing history. What other probability theories could I try or what other probability class libraries exist. The code parses the file very quickly but is there a better way to go about it? I am working on a multiple regression analysis with the first white_ball as a dep...
I am validating two IP addresses. I simply wrote a peice of code like if(string.IsNullOrEmpty(ip1) && string.IsNullOrEmpty(ip2) return true; But is this logically correct? What should we done with empty strings? If both are empty strings, is it okay to return true? May be a complete code snipet can give better ins...
I was curious about trying to write my own simple Database Connection Pool, where all the responsibility for freeing resources belongs to objects which use those connections. There are: 3 classes - ConnectionPool, RecoverableConnection and ConnectionFactory 1 interface - IrresponsibleConnectionManager Is my code (my th...
I have this repetitive block of code and I'm looking for ways to make it reusable and as flat as possible. Here it is: Controller.showKeyboardRegion = function() { logger.info('Controller.showKeyboardRegion => CreateAccountLayoutController'); var view = new CreateAccountKeyboardView(); Controller.layout.cre...
I have written a small batch job which will collect data from db and send mail to user. Can you please do a review of the code with design prinicples in mind and also with best practices for Db and file writer. I am writing to file in this code and sending it in mail. The user will call the class with report type to be...
I have made this function that should take a set of price data and calculate a set of monthly returns. The idea is that is should be able to cope with irregular time intervals. For example I have daily data for the S&P 500 but many hedge funds only release price data monthly. Here is what I have come up with: //Turns a...
In my project I am using 10-15 SQL queries, for that I have a common class for database connectivity and using that I have executed the queries by passing the connection, command and dataReader. With some reference in SO, I learned that my code is not properly structured. I would like to learn and write high perform...
Just a little thing I made to load 20 random images from imgur. I looked at the way that imgur references images on its site, and I felt like I could probably generate a random string of letters and numbers that would, on occasion, produce a valid image URL. So I threw this together in PHP, because I am trying to learn...
I know that this is a complete mess and does not even come close to fitting PEP8. That's why I'm posting it here. I need help making it better. bookName = None authorName = None bookStartLine = None bookEndLine = None def New_book(object): def __init__(self, currentBookName, currentAuthorName, currentB...
I just posted a small open source CFML project here db.cfc is a standalone CFC with 472 lines of code. Here is the execute function in db.cfc. This is just a partial example pulled from the 400+ lines of the code in db.cfc. If you have any suggestions for the rest of the CFC, feel free to post them. This code is curre...
I have just written an API framework which I am hoping to implement into one of my large sites very soon. However, before I do so, I want to be sure that the script is well written and there are no obvious mistakes that I have missed. As with most projects, the key here is automation and speed... I have tried to automa...
Please help me restructure this Java code to allow for sometime have 4 items in packagePriceList. public static HTMLSelectOptionsElement listPremiumPackageTermsWithPrice(String[] packagePriceList, int cyberSourceBillingMode) { HTMLSelectOptionsElement optionsElement = new HTMLSelectOptionsElement(); // Testing...
I'm sort of at a loss for what to do with webapps and whether what I'm doing is actually allowed or not. Here is a sample of the type of thing I'm doing at the moment. I need a list that is accessible by essentially everything. global_list = [] @bottle.route('/') def index(): global_list.append(4) @bottle.route('...
The rules for this program are to: Generate n X n grid. Arbitrarily pick a point and grow a 'shape' based off that initial point. Must have at least 3 points. Strongly biased to not completely fill grid. using System; using System.Collections.Generic; using System.Linq; using System.Drawing; namespace ShapeTestInCo...
I am developing a script that will act as a surrogate of sorts for a web portal and an email blast program. The web portal is used to create web-to-print files and is very good at creating print-ready PDF files, but currently lacks any email blast or HTML output options for the end user. In order to circumvent this lim...
I have an image which is a black ring: black ring http://imageshack.us/a/img51/2029/blackcb.png In my view, I need to display it as a white ring. So, to tint the image, I have written the below method: - (UIImage *)getRingImage { UIImage *ringImage = [UIImage imageNamed:@"ring"]; CGFloat scale = [[UIScreen mai...
I created a library/npm module to handle the signaling process for RTCPeerConnection. There is still a good bit of work that needs done (error handling, dealing with users disconnecting during the signaling process, etc.), but at the moment I am mostly looking for suggestions/ideas about the overall architecture. Here ...
I couldn't quickly find Java code with googling to make serialized Json easier to read (this is a debugging library, obviously implementation code wouldn't use this as it's just more characters). This is not intended to be viewed in a web browser, this is intended for console output mostly. I'm fairly new to Json (tha...
For my models for a certain section I thought it would be better to have a base class model for both "view" and "edit" models, like so: public abstract class Setting { [Required] public int SettingId { get; set; } public string Name { get; set; } [Required] [MaxLength(255)] public string Value...
I have this Board class: import java.awt.Color; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Random; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.T...
Can someone please review my code: # dup/ish -> //github.com/rails/rails/issues/5449 class Form include Mongoid::Document attr_accessor :source def self.ish(prefix, suffix, &block) klass_name = prefix.classify + suffix dup.tap do |klass| klass.class_eval do define_singleton_method(:name)...
SELECT BR.IDObject AS IDObject, B.imgName AS imgName, BK.imgPath AS imgPath, BR.imgType AS imgType FROM ImageReferences BR INNER JOIN BDB_WebImages B ON BR.IDWebImage = B.ID INNER JOIN BDB_WebImageCategory BK ON BR.IDImageCategory = BK.ID ...
I'm trying to come up with a simple router class. I considered using a Request class, but I think that will turn something simple into something overly complex. That is why I did not consider creating one for my framework. class Router { private $uri; private $controller; private $action; private $para...
How can I eliminate repetition from this code? std::vector<std::wstring> vec; bool descending; if (descending) { std::sort(vec.begin(), vec.end(), std::greater<std::wstring>()); } else { std::sort(vec.begin(), vec.end(), std::less<std...
I'm pretty excited to have coded my first JavaScript file which now works, and I've spent my evening trying to improve it. It takes a location in the #loc input box and geocodes it (gets coordinates from a location) when the search button is pressed, or when the autosuggestion is clicked, then submits the form. I've wo...
With the inclusion of <random> into C++11, we can finally chuck out std::rand and start using generator with much better properties. Still, it's easy to get things wrong (uniform sampling where 0 occurs more than it should due to usage of % size comes to mind). To that end, I've written some wrapper libraries to ease u...
The goal is to have fields in a class which are optional and can be determined if they are set in order to be able to leave them out of serialization. template<typename T> class Nullable { public: Nullable() : m_value(), m_isSet(false) {} Nullable(T value) : m_value(value), m_isSet(true) {} Nullable(cons...
I'm learning to work in GAE. I'm so used to SQL, but transform my way of think the last 20 years to NoSQL is a little hard for me. I have the next simple structure: BOOKS than can have CHAPTERS CHAPTERS that can have VOTES In a traditional SQL I just make foreign keys from VOTES to CHAPTERS, and from it to BOOKS. I d...
I am solving a problem on calculation of factorial and the challenge is as follows! You are asked to calculate factorials of some small positive integers. Input An integer t, 1<=t<=100, denoting the number of testcases, followed by t lines, each containing a single integer n, 1<=n<=100. Output For each integer n g...
I am hiding and fading in different content on the same page using jQuery to hide() and fadeIn() the content depending on which link is clicked. It works how I want it to, but the way I've written the jQuery looks like it could be simplified. $("#navItem1").on('click', function(){ $('#content-wrap1').hide(); $(...
I just wrote my first Java database program for the purpose of getting feedback on the implementation and coding. It has 1 table and 2 buttons and prompts the user to select a folder, lists the contents of the folder in the table and lists the hash of the files in the table and writes it to a database. It works fine, b...
At this moment I'm reading an XmlNodeList into a ListItemCollection one node at a time using a foreach: foreach (XmlNode node in authCompXml.SelectNodes("//Code")) { CompaniesList.Items.Add(new ListItem(node.InnerText)); } How can this be improved, such as without the aforementioned foreach?
InstaSlider is a lightweight jQuery image slider / carousel plugin that populates content from an Instagram hashtag. After searching for a similar solution for one of my own projects with no luck I decided there might be others who would benefit from this. It is the bare minimum function at the moment so there will be ...
This is on a job listing site and it has a Linkedin apply button plugin - this provides for a callback the someone has applied for a job. I've written the callback function which extracts the Job ID (a primary key in my database) and makes an AJX call to indcate that this Job ID has been applied for. The Linkedin plug...
I am relatively new to Ruby and am trying to get a handle on making my code more Ruby-esque. At the same time I am experimenting with the branch and bound algorithm to solve a problem that I outline in this blog post. I would also welcome any feedback on the quality of my implementation. The full source code is on my g...
I would appreciate some feedback regarding best practices on the following code for a college project. What should go in the controller and what in the views? How to attach and remove the views to the single main frame? Change the Controller after successful login? Studentenverwaltung.java package com.studentenverwaltu...
I am working on a java swing project that looks like a Terminal (but with less functionality). The GUI contains a jTextArea to display output and a jTextField for user input. Here is an application of the my GUI to perform a simple task. Ask the user to enter a number. If successful, ask the user to enter a smaller I...
I have this view that populates an unordered list from values in a JSON file, which I am doing in Node. Is there a better way to do this, or a more 'node-like' way? Can I load the JSON file without an Ajax call? <!DOCTYPE html> <html> <head> <title>4&middot;pli -- news</title> <link rel='stylesheet' href='/styl...
I am trying to show the 6 most popular products on my homepage from left to right, in two rows. My code actually works... but I have the feeling I am making things way too complicated. Is there a simpler way to do this? Here is my code: $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY popularity D...
I've created a singleton by means of an interface. I don't want to make a thing with getInstance() etc because I don't care about inheritance, and it's redundant and non-declarative. Are there downsides of doing it this way? Any redundancy I can remove? Is there a cleaner/more consise way to do this? I like doing it th...
I have a WPF application that needs to get a XML document using a web request. The request is based on an id that the user enters. If the user enters a second id, before the first returns, I would like to cancel the first request, and start over with the second id. The following works, but I'm not sure if there is an e...
I like the way Zend Framework works it's views and I make extensive use of partials but every partial include results in it's own file system hit. As I'm building my own framework I thought I could do better so this is what I came up with. What I'm looking for is any potential problems that I should watch out for and j...
I am working on page titles to be responsive. The code I have works and gets the job done, but I know that this is verbose. I decided upon the widths by trial and error based on how the words were stacking on each other Desktop Tablet Mobile This is the what I currently have as code HTML <div class="row"> <d...
A common idiom that I use for Python2-Python3 compatibility is: try: from itertools import izip except ImportError: #python3.x izip = zip However, a comment on one of my Stack Overflow answers implies that there may be a better way. Is there a more clean way to accomplish this?
Let's say we need to create a store for selling prime numbers. Users enter the store and ask to buy a number. If the number asked is a prime number, 1.1. then it's either available for sale 1.2. or was purchased earlier, hence not available for sale. If the number asked is not a prime number, then it doesn't exist. ...
I am creating a game, with Ruby scripting. Sprite and Label objects can be drawn on the screen. Depending on the order you draw them, one will overlap the other. To make things easier, I want to implement a property in my drawable objects: Z order. So the higher the Z order of one object, the closer it will be to the p...
try{save.Username = usernamedetails.Rows[0].ItemArray[0].ToString(); } catch{ save.Username = ""; } try { save.Firstname = dtdetails.Rows[0].ItemArray[1].ToString(); } catch { save.Firstname = ""; } try { save.LastName = dtdetails.Rows[0].ItemArray[2].ToString(); } catch { save.LastName = ""; } try { save.Address1 = dt...
A while ago I started working on a project, which does things mostly with jQuery and PHP. I had some problems with my structure and started using CodeIgniter which uses an MVC pattern. So the PHP part is all good now. I am just a little worried about my jQuery code. It looks bloated and I feel like there is room for im...
I am currently working on a project that involves Lua. For convenience, I created a wrapper class for the Lua state structure. However, I also added some methods for getting globals and table fields. Since these methods are very similar, I decided do turn them into macros. Do you consider this a good solution? Would yo...
This question is about the best way to declare functions in Javascript. The app is a small 2 player board game I'm working on as part of a bigger web page. Basically I have a socket which receives and send messages and the game acts according to the content of the message. $(function () { var board = document.getEl...
I have overrode Rails' ActionDispatch::Routing::RouteSet::Dispatcher.controller_reference method to check if a controller exists by checking for the required constants and then creating them based upon a controller with the same name in the Generic namespace. The problem w/ my code is that it is using begin/rescue, it...
2 months ago, I wrote a chrome extension called hotfix. I recently went back to look over the code and it made me cringe a bit. I refactored it a little, but before I get knee deep in it, I would like to ask for suggestions on the best way to proceed. I'm not expecting anyone to completely rewrite it, just to give me s...
I understand .NET very well until Principles of OOP come into view, so I guess we can say very little. So to work on this, I am making a console app that will catalog my digital media to a MySQL database. I've been working on this for a few days. It's not done but I also don't want to get to far ahead and find out that...
I am creating an "explosion" of circle sprites from the character with this code, and I was wondering if there is a more effective way to do such things, because this just seems too stupid. (This is cocos2d) int tileSize = 29; explosionLenght += 1; if (explosionLenght >= 7) { explosionLenght = 1; } CCSprite *circ...
I have been trying to figure out a way to optimize the solving of ODEs in Python but haven't been able to achieve this goal. I tried getting help via a bounty on SO using Cython but nothing came of that. The code below isn't too slow but it is an example of code I tend to run a lot. Some of the code I use can take ...
I recently came across a lecture on DFA. I tried to use it to determine whether a given 'search string' is found in the 'input string'. Please tell me if there is a better way. (display "Enter input string") (define input-str (read-line (current-input-port))) (display "Enter Search String") (define search-str (read-li...
I am new to PHP and put this contact page together using the w3Schools.com example as a guide along with a couple other sources. As far as I can tell, it works fine, but before I put it up on my page I would like to know if there is any potential for abuse. Any feedback is appreciated. <!DOCTYPE html> <html> <head> <?p...
My site consists of a lot of asynchronous calls, and because of this a lot of content is dynamically added to the page. For this section of code I've dynamically added tabs to a page and need to create the selected tab section. This function is fired when a tab is clicked (note that $devices_page is a pre-existing divi...
I'm writing a bash script to manage multiple JDKs, the script is very simple, you have to choose a directory when you store all the jdk's, and the script maintain a symlink to the current jdk'. TheJAVA_HOMEis always pointing to thesymlink`. In order to use the script you have to source the jdk-manager.bash in .bash_pr...
I wrote a C++ PEG packrat parser generator and would love to get some feedback on the code and/or syntax. I currently use the << operator for defining grammar expressions and linking the handler functions that are called when a rule is matched. These functions can then store a value of an arbitrary C++ type in the corr...
I have written this code to sort a list of numbers, in increasing order. It is a combination of quick sort, insertion sort, and merge sort. I make the first element of the list a pivot, then I go through the list. If a number is less than or equal to the pivot, I "insert" the number in its appropriate position in the ...
Depending on your directory structure you may have name spaced class files in different directories (that isn't really part of the structure, i.e. lib/ or core/). Symfony ClassLoader is awesome, but I wanted something lightweight. That just solves the problem above, so inspired by other frameworks implementations I did...
I'm trying to solve a SPOJ problem, which is code SAMER08A at this link. The problem is that when I ran my code in my IDE with all the examples given in the problem, the code works perfectly. But when running it in SPOJ, it exceeds the time limit of 2 seconds. I am frustrated because I have worked so hard on it. I wo...
I am in the process of rewriting in C all the data structures that I learned about a few years ago to increase my understanding of data structures and the C language. The first one I'm doing is singly-linked-lists, and so I'm designing an API for them. I haven't written any of the implementation yet, but I want to get ...
I am extracting data from a text file. Some of the lines from which I want to extract the data consist of a text description with single spaces, followed by a multiple-space gap preceding four fields containing the data, each separated by multiple spaces. A field might either contain the indicator "N/A" or else it will...
Every Account has its owner who is Person The bank has list of owners. I am not sure if my destructors are right and delete bank will delete all elements of list<Account*>* v nad the list itself. Please help. #include <iostream> #include <vector> #include <list> using namespace std; class Person{ public: char* name...
I'm making a WordPress plugin that obfuscates the real file URL and forces the download of one of this 3 types of URL: Local: http://example.com/wp-content/custom/filename.zip Dropbox: https://www.dropbox.com/s/DBOX-KEY/filename.zip?dl=1 Google Drive: https://docs.google.com/uc?export=download&id=GDOCS-KEY The final...
I wrote some piece of code which reads and write multiple data structures on a file using C++. I would be grateful to get your feedback on what you think about the code (it works at least when I tested). Thanks. #include "stdafx.h" #include <iostream> #include <fstream> #include <sstream> using namespace std; // data...
Note #2: This was a post from a while back. Although the top rated answer is useful (generally), I'm looking for something more specific to this issue including routing / architecture. I've even tried a bounty, which failed. As I don't have enough rep to keep adding bounties, I'll leave it open until someone decides t...
Project Euler problem 5 asks: What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I'm learning Ruby by going through Project Euler problems, and though I got the following code right (as in the answer given by it), I'm not sure if I'm doing things quite the "Ruby way". He...
The idea behind this is mainly educational but I might even consider using it in reality if turns out to be good. Here's my first try at implementing smart pointers: template<typename T> class smart_pointer{ T* pointer; std::size_t *refs; void clear(){ if (!--*refs){ delete pointer; ...
I'm relatively new to jQuery and am trying to learn best practices/design patterns with JavaScript. Came across this link and decided to try and put it to something useful. So far I've made a notifications menu dropdown using TinyScrollBar where the user can remove an individual notification. Once removed, the height o...
I have a producer consumer that simulates the interaction of threads controlling a hardware device. I have 1 thread controlling the device, 1 thread reading, and 1 thread outputting. The read is synchronous on the thread while the controlling is asynchronous. My producer is the thread controlling the device and my c...
I have a simple task: Given a sequence of real numbers, replace all of its members larger than Z by Z and count the number of replacements. I solved this task using Scala, but my code looks like imperative-style code. I want to make my code more functional. How can I rewrite my program so it becomes functional-sty...
To generate faces of a Minecraft-like world from a three dimensional array, I developed the following meshing algorithm. The faces are given vertices and indices. A vertex consists of a position in space, a normal vector and a texture coordinate. Indices point to vertices to consecutively define faces. Those variables ...
I'm using sql server and I'm trying to update certain columns in a table but before it updates the data, I want to insert the data into another table. This is my code declare @table1 table (Id int, Name varchar(100)) declare @temp table (Id int, Name varchar(100), CreatedOn datetime default getdate()) insert into @ta...
I wrote the following code to read a config file line by line and split each line into 2 parts and store them separately. The split is done on the basis of a delimiter =: std::ifstream configfile(path_string.c_str()); std::string line; std::vector<std::string> linesOfConfigFile; while (std::getline(configfile, line))...