This program is eventually going to be a screen recorder, but right now I just want it to capture screen images.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.W...
I wrote a transition table which allows the client to:
Create States
Create a TransitionTable or some kind of StateManager
Create StateNodes using that table
A StateNode is what I use to link one state to other states. It has the mainState and an ArrayList<State> full of states it can jump to...
I am trying to add "if, then logic" to the opencv face detection code such that if and when a face is detected through a camera or webcam, an image of the detected face is saved to a pre-determined file path on the controller or computer such as C:\Users\Public\Desktop.
I have looked everywhere ...
I have to do multiplication of two billion by billion sparse matrices (on a cpu), hence any help or hints in optimizing the below given code would be extremely useful. Note: I am only showing the code to compute number of non-zeros in the output matrix. Buffer based adjustment of memory is not an...
Input : String : Title; List Tags
Problem statement : need to map title to tags, e.g. title is "china man japan beijing bell" and tags are ["china man" "beijing bell"], output should be ["china man" "japan" "beijing bell"]
What i am doing is :
List<String> getTitleSplits(String title, List<String
this is my first post so be gentle. I am trying to create an instance of a class with specific variables in Form 2 when I click a button in Form 1. Then take the values that are now in the instance(test) of the class and change the text readout and progress lifebar based on those numbers. However...
I recently applied for a job where the company gave me the following prompt for a code challenge. They have since told me "yeah, no thanks" but provided me no feedback about why they came to that decision.
Would you people be so kind as to review my code, you can even be harsh, it's ok, I'd just...
I'd like to know if there is a standard way of creating a matrix like the one shown below using the R programming language.
$$
\begin{bmatrix}
1 & \rho & \rho^2 & \cdots & \rho^{T-1}\\
\rho & 1 & \rho & \cdots & \rho^{T-2}\\
\rho^2 & \rho & 1 & \cdots & \rho^{T-...
I'm new to GNU Smalltalk. I'd like to port a script I've written in Ruby, Scala, CoffeeScript, and several others. It's the one I use to try to learn the classic OOP concepts of abstract classes, abstract methods, overriding, dispatch, etc. It goes like this:
Define an abstract class Animal wit...
I'm new to GNU Smalltalk. I'd like to port a script I've written in Ruby, Scala, CoffeeScript, and several others. It's the one I use to try to learn the classic OOP concepts of abstract classes, abstract methods, overriding, dispatch, etc. It goes like this:
Define an abstract class Animal wit...
I wrote a simple jquery code but i want suggestions if i can do more better and short way.
Basically the following code are used to change the menu icon on each click evet and also hide and display menu accordingly. If i did it correctly then fine but if is there any way to make the code more sh...
The PHPSESSID is stored in the clients cookie so I don't consider it as secure. Someone might bruteforce it and perform some action (like a Facebook status post) whenever a session was successfully hijacked.
I was wondering how I can protect against attacks like that. Maybe by locking out suspec...
I wrote my first WPF UserControl today, and I would like you to review it. Its purpose is to have images by default resize with the page, but expand to full size with a double-click:
<UserControl
x:Class="MyApp.ImageDisplay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presenta...
I originally was asking about why some Christians feel obligated to proselytize to known non-believers, and it turned into What is the basis for the idea that God is highly involved in human lives?
@rolfl To be fair, I only posted on Meta once revision #5 rolled out (there have been 2 more since). So I got an answer to a question I never really posted to begin with. Guess I should just get over it and move on to something more important.
I have a search box for searching for people in a list of names.
Here is the code that runs every time the query changes. I could not find anything open-sourced for this, so I wanted to make sure this looks good and efficient.
How does it look?
private final List<String> mTotalNames = ...........
> Fine, ill take it somewhere else. Don’t want to offend your royal princesses with my easy questions. – Imran Nazir 2 days ago deleted by Imran Nazir yesterday
@Hosch250 I totally agree about your reasoning, but; may I suggest perhaps wording it a little "nicer"? Like, I try to word it as "I'm sorry you made a mistake" rather than "I noticed you made a mistake"
The question had a number of issues with it, and your comment, @Hosch250 - happened to hit on the one aspect which seems to have triggered a defensive response.
Today I wrote a javascript module(with module pattern) which generate gradient texts using canvas tags.
This is my first javascript "program"(I don't know how to call it) created for a real need.
I would like to receive opinions about:
The performance factor: Is creating canvas slow? Or is it a...
I once saw a Dairy Queen in Montreal, before I immigrated down here. I had no idea what it was.
Granted it was a little odd to me to see a business name completely in English... I would have expect "La reine des produits laitiers" (Dairy Queen) ... or "La deuxieme tasse de cafe" (Second Cup Coffee)
Robert Bruce Ford (born May 28, 1969) is a Canadian politician and businessperson and is currently a Toronto City Councillor. He was Mayor of Toronto, Ontario from 2010 to 2014. Prior to being mayor, Ford was a city councillor. He was first elected to City Council in the 2000 Toronto municipal election, and was re-elected to his council seat twice. At first discounted as a potential mayor, Ford was elected mayor in the 2010 mayoral election on a platform of reducing the "gravy train" of government expenses and taxes.
During his political career, Ford has been the subject of a number of personal...
(so much for keeping politics out of Code Review chat, but it is more comedy than politics).
Over the course of the past month I've worked on a little visualizer to show how different algorithms are sorted. I'm pretty happy with how it turned out but would be interested in any feedback pertaining to the design of it or the coding.
I'm still a bit of a novice to Swing and Listeners, so I...
Find the last element of a list from codewars.com
I completed this kata several times tonight. My current answer is a mashup of several other peoples solutions.
I do not understand why I cant change .respond_to?(:index) into .is_a? Array
Should I use ternary operators in Ruby?
Other suggesti...
Find the last element of a list from codewars.com
I completed this kata several times tonight. My current answer is a mashup of several other peoples solutions.
I do not understand why I cant change .respond_to?(:index) into .is_a? Array
Should I use ternary operators in Ruby?
Other suggesti...
I am creating styles for the comment posts for a projects using BootStrap. I am wondering if this is good HTML markup and the extending of BootStrap's CSS.
I have include a Bootply link to the example.
comment post example on Bootply
I'm somewhat new to SQL (only had to use it in Database classes). I have a simple table of stylesheets, from which I want to select specific ones in a specific order (e.g. reset, then layout, then colors). Below is an example selector that my current algorithm might generate. Is there a better (m...
I am working with very large datasets in a distributed environment. In particular, I am writing some code in Python for analyzing web logs in Spark. Because of the nature of Map-Reduce computing and the size of the logs I am working with, I would like to restrict the amount of data being passed a...
I am quite new to python .......and I am interested to follow a textbook...I am looking for a textbook which contains the big Oh complexities of all python functions ...any references to the same will also be helpful
Over the course of the past month I've worked on a little visualizer to show how different algorithms are sorted. I'm pretty happy with how it turned out but would be interested in any feedback pertaining to the design of it or the coding.
I'm still a bit of a novice to Swing, so I'd love some f...
@Phrancis Funny, I had a comment in my answer about the fact that closing doesn't always happen immediately, especially on a "smaller" site like this. And editing closed questions to make them better is something SE strongly encourages. — Ward15 hours ago
I would think that the core of the question (at CR: the code) should only be changed by the OP itself
This code is used to get the users location and deliver it as a resource to the controller. The aim have this data shared across multiple controllers in the application. So far this does deliver the data as a parameter of the then method on the promise. I would like to be able to deliver outcome ...
This isn't too complicated but I usually code in C++ instead of C. Doing memory management and IO in C always makes me feel like I'm doing everything wrong and making a mess. This is a small sample that has both which I think came out reasonable. I don't have C people to talk to so any critiques ...
@RubberDuck I do agree at this point it feels like vandalism. Do you know a good online text comparison so I can see/show how much of the original question is left?
(prefer not to have to install a new program, if it can be helped)
I'm writing a WPF application and I have several ReadOnlyObservableCollection fields in my models.
Suppose that I wanted to create a FooViewModel instance for each FooModel instance.
FooModel has an observable collection of BarModel, and FooViewModel should contain a (read-only) observable colle...
Right now I have a file with a couple of functions that take an argument of type DataService (custom type).
The file doesn't import the DataService.
I was going to add a bit of defensive programming and assert the type of the argument.
assert isinstance(data_service, DataService)
I know being d...
'Force the script to finish on an error.
On Error Resume Next
'Declare variables
Dim objRequest
Dim URL
'The URL link.
URL = "http://www.chatteris.biz/forecast-compare-include.php?log&config=am"
> James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991.
> Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript.
@rolfl I retract my post (metaphorically) I should have spent a bit more time reading the details
Regardless, his answer makes assertions that I disagree with, and pulls from other answers on the same question.... not sure waht I think of it. There is a bunch of original stuff in there too, and ... well, I think I am overly-sensitive to it.
I, not unlike other people, are trying to learn Swift. I have read several books, and am now trying to put my knowledge to use.
This piece of code is working - It gives me a lot of JSON back, which I have yet to parse, but I'd like to show my code here to get tips on how to improve my code:
V...
> (It's a pitty that the guys of WhatWG are so ignorant towards XML and its capabilities. It's a pitty that the guys of WhatWG had to reinvent the wheel and declare HTML5 as a markup language of its own right besides SGML and XML. That was completely unnecessary and it only confuses people, as we can see with this discussion about the <!DOCTYPE>.)
I'm on a boat!
I appear to have received the secret I'm on a boat! hat:
This happened after I had replaced my avatar with a picture of American singer-songwriter T-Pain whilst wearing the Hairboat hat under my avatar, making it appear as if I was sailing on the boat.
@Phrancis I wish I could answer that question on Christianity I know of lots of verses about God touching lives
It does not matter where you are when you post the 'discovery' of a secret hat feature.... the hat gets awarded there... So, if Mike Miller posted on Mathematics that the recipe for a hat is XYZ, then the hat would have been awarded there.
And he said to them, “Go into all the world and proclaim the gospel to the whole creation. Whoever believes and is baptized will be saved, but whoever does not believe will be condemned.
I have modified my code as per the suggestion given by some of the developers. Let me know if there are any further concerns, scope for improvements.
Original Version
#include"iostream"
template <class T>
class Mystack
{
private:
T *input;
int top;
int capacity;
public:
Mystac...