Markup
Members-
Posts
612 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Events
Blogs
Everything posted by Markup
-
Why don't CAPTCHA's work...
-
Hey, do you play quake live? I did for about a week while my friend was teaching me a few things, but I havn't played it for ages
-
http://www.youtube.com/watch?v=DreDIhnK-co
-
fraps / camtasia
-
Account Hijacking & Jagex� Item Return Policy
Markup replied to lordkafei's topic in General Discussion
This is why recovery questions should be considered as multiple passwords. -
I think this is the case as well. Did you move around any wires as you installed it? A plausible theory, you might want to take it to a specialist to get it checked incase theres a leak, I heard it significantly reduces the current output of the battery which can cause HDD failures and potential loss of data!
-
level 10 smith all steel level 20 smith all mithril level 30 smith all adamant level 40 smith all rune level 50 new tier level 60 new tier level 70 new tier level 80 new tier level 90 new tier Then make it so that the new tier armour degrades after a time based upon the smithing level of the person who smithed the armour. For example a level 50 smither who made lvl 50 tier armour results in armour that degrades after say 10 hours. However a level 99 who smiths lvl 50 tier armour results in an armour that degrades after 100 hours. You get the point, improve/alter wherever necessary as its just the concept.
-
lolwut
-
DoS = denial of service DDoS = distributed denial of service
-
Help with vectors, file inputs, and C++ needed.
Markup replied to Orpheus's topic in Programming and Web Design
http://pastebin.com/uUsEAEPH #include <iostream> #include <fstream> #include <string> #include <vector> using namespace std; struct studentData { int ID; string firstName; string lastName; double outstandingBalance; }; int main() { vector<studentData> vecStudentData; ifstream fileInput; fileInput.open("students.dat", ifstream::in); if(fileInput.fail()) { cout << "File failed to open" << endl; return 1; } studentData temp; while(fileInput.good()) { fileInput >> temp.ID >> temp.firstName >> temp.lastName >> temp.outstandingBalance; vecStudentData.push_back(temp); } fileInput.close(); for(unsigned int i = 0; i < vecStudentData.size(); i++) { cout << i << " " << vecStudentData[i].ID << " " << vecStudentData[i].firstName << " " << vecStudentData[i].lastName << " " << vecStudentData[i].outstandingBalance << endl; } } This assumes a .dat layout with each var seperated by whitespace. eg/ ID FIRSTNAME LASTNAME OB ID FIRSTNAME LASTNAME OB... ID FIRSTNAME LASTNAME OB ID FIRSTNAME LASTNAME OB ... ID FIRSTNAME LASTNAME OB ... I hate files :( -
Help with vectors, file inputs, and C++ needed.
Markup replied to Orpheus's topic in Programming and Web Design
http://www.cplusplus.com/reference/stl/vector/ You don't resize vectors as that is handled automatically by the container. You add objects to vectors using push_back or push_front usually. Theres also methods for inserting. myVec.push_back(datastring); You should also consider reading up on the other types of containers since they all have advantages and disadvantages. http://www.cplusplus.com/reference/stl/ -
http://www.youtube.com/watch?v=Qkb_RSvtkUA Skill occurring
-
http://en.wikipedia.org/wiki/Percent-encoding http://php.net/manual/en/function.urlencode.php http://php.net/manual/en/function.urldecode.php
-
http://www.youtube.com/watch?v=EDXWUNNHVuY
-
Common use of the word "clog" is to describe a mass which has accumulated as in a pipe and now restricts flow. Obviously, this is a poor analogy at best in modern computing. This is no doubt easy enough to visualize that many will never consider that perhaps the closest analog to a clogged pipe in computing is caused by bus width and timing, which is a far more accurate analog to a narrow pipe with low pressure than a clog, and that clogs in that sense cannot exist without having the electrons parked on the circuitry in such a manner as to hinder the function of the equipment. It is vivid enough an image, but it is no analog for anything caused by concurrent Java installations. <3
-
Help with monte carlo integration in C++
Markup replied to assassin_696's topic in Programming and Web Design
Think I got it //Program uses Monte Carlo (random number generator) methods //to calculate a value for ln(2) #include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> #define myRand() ((double)rand() / (double)RAND_MAX); int main(int argc, char* argv[]) { int seed = (int)time(NULL); int n=100000; double x; double y; int r = 0; double ratio = 0.0; srand(seed); for(int i = 0; i < n; i++) { x = myRand(); y = myRand(); x += 1.0; r += (y*x <= 1.0) ? 1 : 0; //uncomment below to enter the matrix! //ratio = (double)r/(double)i; //std::cout << "Iteration: " << i << "\tArea: " << ratio*2.0 << "\tRatio: " << ratio << "\tx: " << x << "\ty: " << y << std::endl; } ratio = (double)r/(double)i; std::cout << "Ratio: " << ratio << "\tArea: "<< ratio*2.0 << std::endl; return 0; } -
Help with monte carlo integration in C++
Markup replied to assassin_696's topic in Programming and Web Design
I understand the monte carlo concept, just unsure on how to implement the finer details. In layman's terms, You place a box around the area of a graph you want to integrate, then using a random sampling method, you test points in the box. You keep track of how many points tested for and how many are under the line. Using this data you can approximate areas or expressions. eg/ An illustration of Monte Carlo integration. In this example, the domain D is the inner circle and the domain E is the square. Because the square's area can be easily calculated, the area of the circle can be estimated by the ratio (0.8) of the points inside the circle (40) to the total number of points (50), yielding an approximation for pi/4 approx 0.8 (PI*(d^2))/4 = (40/50)*(d^2) => PI/4 ~ (40/50) The calculated approx area being, (40/50)*(d^2) = 3.2 -
Help with monte carlo integration in C++
Markup replied to assassin_696's topic in Programming and Web Design
Updating, ignore http://www.cplusplus.com/reference/std/complex/log/ http://www.cplusplus.com/reference/clibrary/cstdlib/rand/ The second link being the most relevant. It shows you how to setup a seeded random generator. It also explains how to limit the range using modulo. replaced! Enjoy Notes: Observe indentation, although opinion based ;p The declaration of x and y are outside of the for loop to stop performance impact of declaring the variable on each iteration of the loop. outcome = (x*y < 1.0 ) ? 1 : 0; If condition is true, return the first value(left side of : ), if false return the second value(right side of : ) -
http://www.youtube.com/watch?v=W6T6nN1hJ0c Thanks to peter for adding full screen button <3
-
C++ Ignore friendship and inheritence, polymorphism for now. Basics of C++: · Structure of a program · Variables. Data Types. · Constants · Operators · Basic Input/Output Control Structures: · Control Structures · Functions (I) · Functions (II) Compound Data Types: · Arrays · Character Sequences · Pointers · Dynamic Memory · Data Structures · Other Data Types Object Oriented Programming: · Classes (I) · Classes (II) Advanced Concepts: · Templates · Namespaces · Exceptions · Type Casting Then take a quick look at reference , specifically the stl containers and strings library. And you could use Microsoft Visual C++ 2010 Express
-
So I went searching through my old code and I found a java implementation, http://pastebin.com/Zn9qfvVQ import java.net.*; import java.io.*; import java.util.Vector; public class hiscores { public static final String searchURL = "http://hiscore.runescape.com/index_lite.ws?player="; public static final String[] skillName = {"Overall", "Attack", "Defence", "Strength", "Constitution", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecrafting", "Hunter", "Construction", "Summoning", "Dungeoneering", "Duel Tournament", "Bounty Hunters", "Bounty Hunter Rogues", "Fist of Guthix", "Mobilising Armies", "B.A Attackers", "B.A Defenders", "B.A Collectors", "B.A Healers", "Castle Wars Games", "Conquest"}; public static final String[] skillDataName = {"Rank", "Level", "Experience"}; public static final int expVSize = skillName.length; public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String keyboard = ""; while(true) { System.out.print("Enter rs name: "); try { keyboard = br.readLine(); if(keyboard.compareTo("`exit") == 0) break; } catch(Exception e) { System.out.println("Threw a " + e.getClass() + " with message " + e.getMessage()); } System.out.println(); try { System.out.println("Looking up hiscores . . ."); Vector stats = getHiscores(keyboard); System.out.println("Found player!"); System.out.print(rHiscoresToString(stats)); } catch(FileNotFoundException e) { System.out.println("User not found."); } catch(Exception e) { System.out.println("Threw a " + e.getClass() + " with message " + e.getMessage()); } } } public static String rHiscoresToString(Vector data) { String formatted = ""; for(int i = 0; i < expVSize; i++) { String[] get = (String[])data.get(i); formatted = formatted + "[" + skillName[i] + "] "; for(int i2 = 0; i2 < get.length; i2++) { formatted = formatted + skillDataName[i2] + ": " + get[i2] + " || "; } formatted = formatted + "\n"; } return formatted; } public static Vector getHiscores(String rsname) throws Exception { Vector data = new Vector(expVSize); URL resultsURL = new URL(searchURL + rsname); BufferedReader resultsBuffer = new BufferedReader(new InputStreamReader(resultsURL.openStream())); String current = ""; while((current = resultsBuffer.readLine()) != null) { data.add(current.split(",")); } resultsBuffer.close(); return data; } } Terrible code fyi, just a rapid code. Need to watch out for expected vector size being greater than actual, causes out of bounds although unlikely. Should add a comparison
-
You'll want to: Windows Sockets 2 TCP ai_socktype = SOCK_STREAM; HTTP Protocol Java Python Then just string split/regex the lite hiscores
-
Overpowered guns? Then use it if you care. Else learn to play well, tactics, psychology, headshots, aim... We counterforceonepointsix'ers play with 5 guns and 5 guns only. At top level game play the deciding factor is tactics. And lolwut snipers "balanced" in bc2 how? Unless you're talking about non hardcore? in which case, nice HUD target tracking arrows... complete joke... Snipers should always be one hit to chest