Now I am doing Project Euler number 1:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
This is my code, which runs in 0 milliseconds:
static void...
I want my Python decorators to have optional arguments and not be called when not necessary.
The accepted answer in http://stackoverflow.com/questions/3888158/python-making-decorators-with-optional-arguments doesn't accept named arguments, and I don't want to add boilerplate code inside decorato...
hahah.. The problem is with the word sounding "Cho". Cho means upon happening which also sounds like Chob which means wood. not sure where that B comes to action for Google though :D
@rolfl I have made little changes to be a little bit more modern Persian then google can handle it.
Here's a userscript implementation: Timestamps with a day
Requires Greasemonkey/Tampermonkey.
Install the script from here.
If you prefer local time, simply remove the date.utc() line and change the format string as desired (remove the [Z]).
A small project I recently started.
#include <stdio.h>
int main(void)
{
unsigned short int num = 0;
while(num <= 0 || num >= 256)
{
printf("Enter number of values to sum: ");
scanf("%d", &num);
}
unsigned long long int arr[num];
unsigned long long int t...
@Phrancis looks good however, I am not a big fan of really bright colors like that Cyan you used for the main code. (hope my gf don't see this cus her name is Cyan. I love your name honey if you see this :P )
I got really tired of how ugly and inflexible Salesforce Reports are. So I made this Apex/Visualforce combo that searches long text fields, makes adding and removing fields a snap, has a customizable view, and is generally easy(er) to work with.
This basically does everything by shuttling JSON s...
The history:
- I created a class called QuickBitmap to quickly get/set pixels in a Bitmap object. Using intertops I'm able to safely lock/unlock the bits of the Bitmap and with the use of methods like SaveBits, LoadBits, UpdateUnderlayingBitmap, GetPixel and SetPixel I can quickly and easily mani...
I have written a code for basic array creation and printing it's values in C. I would appreciate comments on how it can be improved, and the industry standards.
One issue I'm encountering is having no way to tell printArr() what the size of the array is.
Some questions-
1) Can I use arr[i] any...
makes sense. The system should always prevent some nasty stuff anyways. I quite like that SE isn't like some forums which some just open their mouth and say things like nothing would happen(which doesn't)
> Stack Exchange Inc. reserves the right to terminate my privileges as a moderator at any time without warning.
That is not an idle threat.
But, in reality, I am an appointed moderator. At any time, someone in the community could request that I am removed, and if the SE folks share that concern, I am gone.
Well all like code, let's face it. And with Code Review's upcoming graduation "colors" I'm sure that many would like for the large amount of code that is posted daily in questions and answers to look top-notch.
Whether Stack Exchange would be able to get CR our own code formatting is a bit up i...
@Mehrad - just so you know, though, I can think of probably a dozen people on the site who would all do good jobs as moderators, and, in their way, already do. On top of that, there's a lot of people who do great that I'm not aware of.
If/when code review gets elections, and so on, it is going to be hard to choose the right candidates because there'll be so many good ones.
Compare that with sites like scifi, or ux, who recently went through elections, and they were struggling to find a few good options.
I have written the following Tampermonkey/Greasemonkey script. I am trying to obtain a list of all CSS rules for a page; across all stylesheets. As of now, I am just iterating over everything. Is there a faster way to obtain the rules? Also, I feel that there is a more efficient way of converting...
(and by 'qualify', I mean people with a reasonable activity in meta, and main site, with some flagging history that shows a good sense of what's expected, and without issues in their history that will derail a campaign).
Below is my BEAN :
public class Policy {
@Expose
@SerializedName("bluetooth")
public PolicyState mDisableBluetooth; // sort the field
@Expose
@SerializedName("wif") // sort the field
public PolicyState mDisableWifi;
....OTHER FIELDS
/**
* ...
That's the complicated one. On Code Review, Me, Myself, and I expect you to vote for any answers on questions you ask, to accept one of them, and to vote on any questions you answer. Those votes can be up or down.
Any vote, plus, or minus, and an accept, is feedback.