I have a table (csv file) with three columns:
Wood [m2] Polygon Area [m2]
15 A 50
10 A 50
12 B 30
10 C 30
05 D 50
10 D 50
My Aim is to calculate the percentage of wood for each Polygon. I want to print...
I made a little python3 script to grab clips from pornhost.com and would like your critique, advice, tips&tricks and/or learning resources to create better code.
Thank you!
#!/usr/bin/env python3
''' phgrab.py: pornhost.com clip downloader. '''
import os
import sys
import argparse
import urlli...
There has been primarily two questions that have been severely down-voted because of the code being childish / immature / possible "trolling".
How could I optimize this script?
Gay-o-meter (deleted)
How to handle such questions where the code in the question is just.... silly / childish / imm...
@rolfl I honestly thing that the system is wrong there, not that we did the wrong thing. We want it removed ASAP, if we are faster than the system, then the system is wrong.
@Pimgd believe it or not, I am too. But if I was a moderator, that is what I would do.
Yeah, this one was my fault.
Part of the problem is that, if a post gets -3 votes or more and gets dimmed by the "your answer sucks" CSS, the spam links are obscured. I may file that as a bug.
In the absence of spam links, it's just gibberish. Removable with extreme prejudice, but not spam.
OK, final verdict, @SimonAndréForsberg - I think I agree with you, that deleting it is more important than waiting for the spam/offensive flags to roll in.
But, in the event that the post gets deleted by votes before the spam flags accumulate enough, please flag it manually for mod attention so we can deal with the account
> Subscriber represents, warrants and agrees that it will not contribute any Subscriber Content that (...) (e) contains a virus, trojan horse, worm, time bomb or other computer programming routine or engine that is intended to damage, detrimentally interfere with, surreptitiously intercept or expropriate any system, data or information, or (f) remains posted after Subscriber has been notified that such Subscriber Content violates any of sections (a) to (e) of this sentence.
The question in it's current state is now 'clean'.
We try on Code Review not to judge why people use their code, whether it's password crackers, scanners, etc.
there was not an actual link to any porn, though anyone using the code would have run in to it....
So, I agree with your edits, It is now a decent question.
I don't believe there's a reason now, or even before, to suspend the account, but it is pushing that line about as close as you can go without crossing it.
Here is the query in the Rails console:
database=application_database collection=posts selector={"merchant_id"=>"51c3a84b9727911738000003", "status"=>{"$nin"=>["10", "8"]}, "admin_id"=>{"$nin"=>[nil, "0"]}, "start_date"=>{:$gte=>2014-12-26 06:00:00 UTC}, "end_date"=>{:$lte=>2015-01-02 06:00:00 U...
I would like to ask community to evaluate my solution in OpenERP. I am using Odoo v8.
I have created a popup window with two fields, original_code and replacement_code, and the button with caption "Replace". The popup is launched from parent page "More" button dropdown option.
Use case is tha...
In favour of the actual user (using private mod-only info), the user has a registered account... but, it's brand new, and has some suspicious properties....
While the post may be acceptable, I am suspicious that it may be a troll.
on the other hand, the hoops the user has jumped through to create the account in the way he did, is probably just because he may be otherwise embarassed about the content.
private function isModVariable(v:String):Boolean {
var modVariables:Array = ["bellysize", "bellysize2", A LOT OF CENSORED THINGS /* END OF CENSORED variables */ "background", "loadCharCode", "loadDialogue", CENSORED THINGS /*End of DialogueActions variables*/ "atv_position"/*End of AnimTools variables*/, CENSORED THINGS /*end of DAv2.04 vars*/];
return modVariables.indexOf(v) != -1;
}
I have a database with 4 tables filled with millions of rows. I have my program run on several computers computing data and then returning it to the database. The huge bottleneck in my program design is that for each calculation, it has to download the data and then perform calculations on it and...
This is code I wrote for calculating bezier curves as quickly and RAM efficiently as possible.
I would like to know if there are faster ways to optimize anything, because I am very new to C++ and efficiency methods.
Lastly, if there is a variable that could be more explicitly named, also let me...
yeah, i suppose..... or they're just stupid!. don't change stuff without telling the people that it could affect!
I have a test site, and everything worked on it the last time I was in there. now I cannot log in when I access the site from the web server I have it hosted on, but I can if I debug it from my machine (run it from localhost). I can ping the SQL Server from the Web Server
so for some reason it's not connecting to the Membership provider Database when it's run from the webserver. but how do I troubleshoot that?
> Available to Try: Live Preview Support for Multiple Browsers
This is disabled by default and needs to be enabled with `livedev.multibrowser` preference. Live Preview will open in default browser. You can copy/paste url to any other browser. All browsers will be updated simultaneously.
Guess the IDE assumes you would have Chrome already. I'll go and submit a feature request on their github but I guess for now you might be stuck having to get Chrome... Sorry I did not foresee that
I'm voting to close this question as example code, because it has been stripped down of its context and wouldn't compile as is (var context = new XContext isn't valid C#). That said, you're using two contexts, that doesn't mean you're using two connections - you may want to read up on connection pooling and how EF is handling that. — Mat's Mug10 secs ago
I wrote this jquery plugin to do remote validations on the server. The code self explanatory. When the field blurs (event is customisable), the plugin checks to see if there is a value and sends the request.
Nothing fancy, but since I'm relatively new to JavaScript I'm sure I might have missed a...
This is not code!!! This is an attempt to be pointed toward a putative solution. I am a beginner. I am nothing. I have no skills. I will read read read.
#can use arrays/lists/sets...whichever is more efficient
set1 = {id1 , id2 , id3 , id4...}
set2 = {location1 , location2 , location3 , location...
This is not code!!! This is an attempt to be pointed toward a putative solution. I am a beginner. I am nothing. I have no skills. I will read read read.
#can use arrays/lists/sets...whichever is more efficient
set1 = {id1 , id2 , id3 , id4...}
set2 = {location1 , location2 , location3 , location...
I'm creating an event hub object in for a large project I am building in Javascript. The project will have modules in charge of the UI, commands, and rendering. Each module will use this hub for broadcasting events to each other.
This is my Javascript library (I cut out RequireJS for conciseness...
I wrote this jquery plugin to do remote validations on the server. The code self explanatory. When the field blurs (event is customisable), the plugin checks to see if there is a value and sends the request.
Nothing fancy, but since I'm relatively new to JavaScript I'm sure I might have missed a...
I am looking to make this macro run faster and more efficiently (less code).
I have a weekly report of control charts that was handed down to me and I am looking to automate it. Pulling in the data is a manual task but changing the ranges for each Chart Series is the part I am automating. I ha...
This question has not stabilized in a way that's on-topic. The revisions that have been made have left the code in a way that's no longer working as intended, because all the data comes from the first tab. This is progress, but it's not ready for review. When the code performs the intended task without errors, that's when you should edit/update this question, and when the code will be ready for review. — rolfl ♦24 secs ago
The following code will add to each code block a 'Select Code' button that will select the code belonging to that block. Please review for maintainability.
In order to use this, visit http://codereviewcommunity.github.io/CodeReviewBookmarklet/
javascript: if ($('button').length === 0) {
/*...
How can i improve it?
#include <iostream>
#include <deque>
#include <string>
#include <stdexcept>
#include <Windows.h>
namespace ms
{
typedef signed char Int8;
typedef unsigned char Uint8;
typedef signed short Int16;
typedef unsigned short Uint16;
typedef signed int...
To find answers where users expressed their gratitude (by mentioning "thank" in comments),
I put together this SEDE query (latest):
DECLARE @username AS NVARCHAR(60) = ##DisplayName:string? ##;
DECLARE @userId AS INT = ##UserId:int?-1##;
-- SpecialThanks: Special thanks only "Enter 1 for YES, 0...
I was trying to make Tic Tac toe project but I'm getting many errors. I fixed some errors but I still need help. I tried many times to fix the errors but I can't. I'm going to represent the Tic Tac Toe board as a list of strings letting the Player be X or O. Then ask him if he wants to go first. ...
@A.J. Even if it would be on-topic for Code Review (which it definitely is not), it would still not be off-topic for Stack Overflow. — Simon André Forsberg1 min ago
Instances like this, I mean. If a user mentions us, the OP will almost always cross-post here. It is a problem when the question is already on-topic on SO.
Code Review is becoming well-known on Stack Overflow.
The folks over on Code Review are happy about that.
The only problem is that there are a lot of questions redirected to CR which don't belong there.
So I want to ask that the users who direct askers to CR (or request migration of questions...
I understand it a lot better now. I am going for a posix-style, since I have a nicely setup user/group system and it just works well w/ the posix permissions. And I didn't know about the octal numbers (or not to much of an extent at least). Thank you for the detailed answer. — Jakar50 secs ago
So I'm coding a simple ping pong game. I've started doing the if statements for the ball collisions and I'm a bit stuck. I want the ball to bounce of the rackets when it comes in contact with them. Also I cant find a way to make the ball start off initially moving left. Even though the ball_dir_x...
I wrote a PS script to back up data from single user pcs to their network homedrive. The purpose of this tool is to save some time and ensure process consistency when reimaging/replacing machines. I would appreciate your critiques and ideas. I am new to Powershell scripting.
Breakdown of the sc...
Using printf, I am supposed to make the final calculation end in % and with one decimal point and use type casting so that the calculations are always correct.
Here's my code:
System.out.printf("Making " + shotsMade + " out of " + shots + " shots, the player's shooting percentage was " + shotsM...
I'm a C++ newbie and this is my first exercise (so be gentle). I will appreciate any input.
I wanted to create a basic String class that will hold a CString and have:
constructor, destructor, copy constructor.
assignment operator (both from String and CString).
<< and >> operators to stre...
So im new to web development im constantly torn btween good code and bad code i was wondering if you could help me improve my following code and if im doing it right in terms of how i use on the line by line basis
<?php
if (@!$_COOKIE['true']){
setcookie('true','true',time()+86100);
$...
I haven't coded all winter, and it seems like everything I learned about efficiency from my data structures class leaked out my head. I was wondering if I can get some help in making my code less verbose, and more efficient, as some of the things I do seem redundant. My code is correct (I'm confi...
Sorry about the maybe misleading title, but I wonder why is this way of creating objects and adding properties and methods:
//A)
var myObjCreatedByFunction = function() {
this.prop1 = "a";
this.func1 = function() {
alert("a");
}
};
and then using prototype to create additional methods...
I have attempted to edit a post that happened to trigger an "excessively-long" auto-flag. In this case, it contained code within a single block. As soon as the editor comes up, the app stops responding and crashes after a few seconds. I have tested this several times and it has occurred each time...
this new user had the good sense to accept an answer: http://codereview.stackexchange.com/q/79066/12390 maybe we can throw him a few votes so he can upvote the answer he accepted
Hey @markhamden - I would like to chat about this question/answer in the 2nd monitor. When you arrive there I'll make sure you have write-access there, — rolfl ♦12 secs ago