instruction
stringlengths
71
71.9k
This is an assignment question from school: Write a method called licencePlate that takes an array of objectionable words and returns a random licence plate that does not have any of those words in it. Your plate should consist of four letters, a space, then three numbers. import java.util.*; class MethodAssign5{ st...
Is there anything what could be improved on this code? def factorial(n: Int, offset: Int = 1): Int = { if(n == 0) offset else factorial(n - 1, (offset * n)) } The idea is to have tail-recursive version of factorial in Scala, without need to define internal function or alias. This one is callable like this: factori...
I've set up some PHP to delete a directory, it's contents, and any subdirectory and its contents... I'm new to PHP so I'm most definitely doing something WRONG or am doing something in the most inefficient way. Looking for some references or suggestion on how to do this better... Using PHP 5.3.8. First Draft if ($handl...
The below logic is working fine. But is there any way to optimize this logic ? I have a string1, string2,...,stringn and values of each strings are string1 = "s1k1-s1k2-s1k3-....-s1kn | s1v1-s1v2-s1v3-....-s1vn"; string2 = "s2k1-s2k2-s2k3-....-s2kn | s2v1-s2v2-s2v3-....-s2vn"; ............. stringn = "...
Here is some code I wrote in Python / Numpy that I pretty much directly translated from MATLAB code. When I run the code in MATLAB on my machine, it takes roughly 17 seconds. When I run the code in Python / Numpy on my machine, it takes roughly 233 seconds. Am I not using Numpy effectively? Please look over my Python c...
I'm learning python and I want to model a single elimination tournament like they use in athletic events like tennis, basketball, etc. The idea would be to insert some meaningful metrics to determine the winner. I've already got a database that I plan to connect to to get the metrics, but I am hoping to find a better...
In my project, they use Hibernate's session the below mentioned way and then save entity objects with in a transaction. Session session = HibernateUtil.getCurrentSession(); session.beginTransaction(); Employee employee = new Employee() ; employee.setName("someName") ; employee.setEmailId ("someId") employee.setID (10...
I'm trying to improve my coding practices and I was just wondering if (I'm definitely sure there are) there are better ways of doing the following task. I'm rewriting the rent system of the building I live in, which currently (still) uses an Access '97 database. This is the schema that I've constructed and the followin...
I have a form. When I click the save button, I want to create an object from the data and pass that info to HTML elements on the same page (div.form_content). I decided, instead of creating a variable for each HTML element to create an array of HTML elements. I know the first HTML element is going to contain the firs...
Since I'm learning F# along with functional programming, I managed to implement the rules for Conway's Game of Life. I'm not sure if I can improve some of its parts, though. For example, the neighbours function does an ugly range testing, but I can't think of anything simpler. module Game open System type Cell = ...
Basically I have some methods that access the file system and to avoid that in the unit test I have broken those sections out into a protected virtual method. In the Unit Test I then use Moq to setup those protected methods the way I want. I am just curious if I am going about this correctly or is there a better way? B...
Please review the following code. Methods getFirsts and getSeconds, both of which are private, return a list of objects which implement CommonInterface. Is this a good or bad design? @Override public final List<? extends CommonInterface> getObjects(final CommonEnum type) { if (type == null) { return new Arr...
The following code should be mostly OK, but I'm trying to avoid any stylistic problems or find anything that I overlooked. The code is an implementation of asynchronous leadership election on a one way ring. Parts of the implementation are a bit unnatural, because it has some forced features. main.cpp #include <iostrea...
I implemented reversing a linked list in iterative way, just by knowing we need 3 pointers and I have never seen a code before, when I coded. I ran this code and tested it, it works fine. Even for null element and one element. But all the implementations on net have slightly different code. I was just wondering, how my...
So this is an app I'm working on, and I'd like to get some feedback on it. I'm leaving some key parts out, as I don't want everyone everywhere to have access to the complete code. The main pieces that I would like you guys to look at are still there though. // Does a remote AJAX request that scrapes the URL and parses ...
Sparse is probably the wrong word - this is for encoding arrays of booleans where contiguous values tend to be the same. It'd be great to know a proper name for this data structure so I could read about it or use an existing implementation. I already realize I probably ought not to use doctest, and would welcome feedba...
I'd love some feedback about this code that I'm editing and shortening now. <?php namespace bbn\cls; class mvc { use \bbn\traits\info; // From \bbn\traits\info. protected static $info=array(); protected static $cli=false; // Is set to null while not routed, then false if routing was unsucessful, an...
My app has a feature that when you click the new data button, HTML is loaded to the page via ajax. Because I am using AJAX, all events I want to add has to be bound using the on() method. There are 4 on('click') functions that are bound to 4 different HTML elements: // save data $('#container').on( { click: functi...
I want to get my first CSS layout reviewed. First of all, the related HTML code is as follows - <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> Preferences </title> <script src="options.js"></script> <link rel="stylesheet" href="options.css" /> </head> ...
In the very simple code below I'm illustrating having a master 'App' object with 'Chat' & 'Posts' modules inside. Now, what I'm asking is, in my conscious effort to keep my components loosely coupled and modular, how I can use other functionality in the App object following the modular, decoupled pattern of JS web apps...
I want to defer the reading of a bitmap to another thread. I'm mainly concerned about concurrency issues since I'm kind of green on that subject, so I would like to know if this code has any potential flaws. public class SomeActivity extends Activity { Bitmap threadBitmap; @Override protected void onCreat...
I have a string containing around 1 million sets of float/int coords, i.e.: '5.06433685685, 0.32574574576, 2.3467345584, 1,,,' They are all in one large string and only the first 3 values are used. The are separated by 3 commas. The code i'm using right now to read through them and assign them to a list is below: ...
I was interested in how this code can be improved apart from basic caching. This object creates 'tokens' much like that the iOS mail app and the tag section below. var TokenTime = { assets : { tokenArray : [] }, init : function (){ var self = this; //add event handler $('#friend').on('keyup', function ...
Does the code below look correct and efficient for removing duplicates from an unsorted linked list without using extra memory? An object of type Node denotes a LL node. void removeDuplicates() { Node current = head; while(current!=null) { Node prev = current; Node next = current.next; while(next!=n...
I'm new to Java and have been through some tutorials and I'm in the next step of checking how I'm doing now. Is there a better way of doing this? import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOExc...
I have an app that has a number ajax requests and instead of writing them all out, I created a plugin that takes options based on the request I am making. I would like the ajax requests to occur when page loads and when the user clicks, mouses over certain buttons. I decided to use the jquery.bind() method to bind the ...
In my Java program, I need to operate on the sublists a of ArrayList or LinkedList often, like removing a sublist, comparing two sublists. For ArrayList or LinkedList, I didn't find any good APIs to do these. My current implementation is as below. Basically, it takes an input like: u1234 u1236 u1236 u2def u1236 u1236 u...
I've written this simple script to force download some files (jpg, mp3, usually those which are loaded in browser by default). I was wondering whether there's any way this could be improved upon, which means: making it more secure making it use less cpu (filesize(), fopen(), fpassthru() are the usual suspects here) ma...
I am wondering if the code beneath considered as the proper way to achieve the topics stated in the title of the post. I wonder is the best practice for achieving it? var Obj = function() { if (arguments.length) { //do something for (var i in arguments) //iterate over the arguments alert...
Q. Basically this piece of code appears in my class constructor. It's working, but it seems very confusing. It basically checks if the jQuery library is present locally and if it's not it will try to download it. Is there any way I can improve this? Namely avoiding re-setting vars all the time? CODE: //First we check...
Since asynchronous operations (like Socket's Begin*-End* pairs and *Async methods) that use IOCP under the hood cause the byte array that you use as buffer to be pinned in the memory. So if you create a new byte array everytime you send to, or receive from a socket using IOCP, you're likely to encounter OutOfMemoryExce...
This is a problem from Interview Street in Dynamic Programming section. Billboards (20 points) ADZEN is a very popular advertising firm in your city. In every road you can see their advertising billboards. Recently they are facing a serious challenge , MG Road the most used and beautiful road in your city has be...
I have a list of dictionaries, with keys 'a', 'n', 'o', 'u'. Is there a way to speed up this calculation, for instance with NumPy? There are tens of thousands of items in the list. The data is drawn from a database, so I must live with that it's in the form of a list of dictionaries originally. x = n = o = u = 0 for en...
I'm learning programming and would appreciate any feedback on my code. I've come up with the below code. The logic works fine but the code itself seems rather confusing to me. Are there some patterns I could use to improve this code? // This code snippet handles click events on the Ingredients list (see the image below...
Here are some snippets I coded and I would like some feedback on my way of handling this: I have a utility class, as a singleton, that provides me with a method named randomColor which returns a (UIColor*): -(UIColor*)randomColor { float l_fRandomRedColor = [[MathUtility instance] randomFloatNumberBetweenNumber:0.0...
I want to implement the flood-fill algorithm for https://stackoverflow.com/questions/12995378/is-there-a-proper-algorithm-for-detecting-the-background-color-of-a-figure. I did it recursively, but I had a stack-overflow error. No matter - Wikipedia has a spot for a non-recursive, iterative solution. It requires a queue....
I am trying to learn some Java on my own, and I am tackling some "programming challenge" problems to practice the little I have learnt so far. Could anybody constructively critique this beginner's effort (source on Bitbucket)? public class BinaryCode { public String[] decode(String message) { int messageLength = ...
Given a string of length n, print all permutation of the given string. Repetition of characters is allowed. Print these permutations in lexicographically sorted order Examples: Input: AB Ouput: All permutations of AB with repetition are: AA AB BA BB Input: ABC Output: All permutations of ABC with repet...
Recently I had the need to make some ajax calls within a MVC 3.0 with Razor and jQuery application. After a bit of trial and error and refactoring it was discovered that a number of different needs were required. These included: The serverside code would be responsible for creating any redirect urls and we wanted to...
I'd like a code review on my very simple server application that validates whether the serial number retrieved from the client is a valid one or not. Is there a better way to handle the start/stop on the service? If you look at my Start and Service methods, I'm basically looking at isServerRunning boolean variable an...
I am trying to write 2 functions, one to read the matrix (2D array) and other one to print it out. So far I have: /* Read a matrix: allocate space, read elements, return pointer. The number of rows and columns are given by the two arguments. */ double **read_matrix(int rows, int cols){ double **mat = (double **...
I have a menu, where a user selects one out of 4, and another 2 or 4 options will appear. I used big buttons; a picturebox + label to create the buttons. The 4 main buttons are fixed, but the 4 other buttons depend on the first choice. Text and image will change. I programmed this, but I kinda feel this must be possibl...
I have this class whose code I pasted in full. The CredentialsManager class is not shown here as all it does is return the DB connection variables. Can be improved or is this is OK as I've written it? Namely, I'm interested if it's OK to have a private variable mysqli populate inside the function openConnection() or if...
I'd like to know whether having different variables for the src (source) and dst (destination) of an OpenCV function will have an effect on the processing time. I have two functions below that does the same thing. public static Mat getY(Mat m){ Mat mMattemp = new Mat(); Imgproc.cvtColor(m,mMattemp,Imgproc.COLO...
Preamble I am trying to learn JavaScript by writing code and looking up documentation, one problem at a time. I am already familiar with several "dynamic" languages, so I'm hoping to be productive quickly. This may not be the perfect way to learn the language, but I don't have the time to pick up a book right now. The ...
Title: Identifying equivalent lists I am using lists as keys, and therefore want to identify equivalent ones. For example, [0, 2, 2, 1, 1, 2] [4, 0, 0, 1, 1, 0] are 'equivalent' in my book. I 'equivalify' the list by checking the list value with the highest count, and set that to 0, then the next highest count to 1, a...
The Model is simple: a Player class with three attributes: first_name, last_name, and team_id. I'm just trying to get a handle on TDD for what will expand into a much more robust API. Here is my first stab at the integration/controller specs for REST actions on the API. I haven't seen a lot of concrete examples of RSpe...
I know there are other Python wiki API classes out there. I'm writing this one because I don't need all the bells and whistles, no edits, no talks, etc. I just need to be able to search for titles and get the wiki markup. Any advice or suggestions or comments or a review or anything really. # -*- coding: utf-8 -*- imp...
for now I'm using: int connect(const String& address, int port) { struct sockaddr_in servAddr; struct hostent* host; /* Structure containing host information */ /* open socket */ if((handle = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) return ERROR; //TODO: gethostbyname is ob...
I've written a BST implementation and would like a code review and any suggestions on how to make it better. #include<iostream.h> #include<conio.h> #include<stack> #include<queue> #ifndef BINSTREE #define BINSTREE using namespace std; typedef int valuetype; /*struct Node{ valuetype data; Node* left; Node* righ...
I have a timer that is only supposed to tick between x and x on weekdays. I have used the following implementation. void tmrMain_Tick(object sender, EventArgs e) { if (!(DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday)) { if ((IsTimeOfDayBetwee...
I've written a thread safe, persistent FIFO for Serializable items. The reason for reinventing the wheel is that we simply can't afford any third party dependencies in this project and want to keep this really simple. The problem is it isn't fast enough. Most of it is undoubtedly due to reading and writing directly to...
I was trying to solve the Median challenge at Interviewstreet.com. I wasn't able to pass most of the test cases. But according to my understanding my code should work fine. Here is the question: https://www.interviewstreet.com/challenges/dashboard/#problem/4fcf919f11817 Here is my code: /* Sample program illustrati...
I've been using the following user agent Regular Expression to detect mobile devices, but I recently came across a few resources that listed a whole host of mobile user agents that I had not heard of before. Whilst my agent check is only the first step in the detection process - I also have some JavaScript as a fallbac...
I want to make a C++ object hierarchy of "classifiers", which can be composed together via logical operators into a single classifier that implements the whole logical combination. This is actually for a particle physics analysis library, but I'll present a much simpler example which just classifies integers. The motiv...
The function takes 2 arguments: array: int[], cap: int Members would be ranged from 0 to cap. e.g. array = [0,0,0,2,6,3,0,4,2,4,0] cap = 6 The return value is a new array of same length based on these rules: The function can only change values of consecutive elements which are > 0. i.e. any where the original array ...
I have a for loop which loops through a list and builds and object, I needed to check the previous object with the one i'm building...which way is better? This way?: String lastDirection= ""; List<Stages> stages = new ArrayList(); for (Object object : results) { Vector result = (Vector) object; ...
I'm curious when a piece of code should be its own method or just left alone. This came up when I was creating a "work item" from the thread pool. When passing the argument to the "WaitCallback" object, I would argue that if the code that will run will ONLY run when this thread is being run, then it's OK to wrap the co...
I have a chunk of code that averages around the points of a grid of values and Im trying to figure out if there is a better way to do the averaging. The array itself is 1 dimensional but i am using an x and y and stride to keep track of it in 2d space. Im mainly just trying to figure out if there is a more optimized wa...
My goal is to compute the intersections of several vectors (sets of identifiers, gene-names to be specific). I start with a list of vectors and run the function below, which loops through 1:n where n is the number of sets and then uses combn to generate all combinations of my sets taken m at a time. I paste together a ...
Given two strings str1 and str2, write a function that prints all interleavings of the given two strings. You may assume that all characters in both strings are different Example: Input: str1 = "AB", str2 = "CD" Output: ABCD ACBD ACDB CABD CADB CDAB Input: str1 = "AB", str2 = "C" Output:...
Here is a code I want to simplify: public void Method1(Context context, EventLog log = null) { Class myClass = ConvertToMyClass(); ApiCall1 apiCall = new ApiCall1(context); if (log != null) { eventLog.WriteEntry("Starting"); } try { apiCall.Call1(myClass, null, false); ...
I have implemented a Non Reentrant Lock. I want to know if this has any mistakes, race conditions etc. I am aware of the fact that existing libraries have to be used (instead of writing our own), but this is just to see if I am understanding the java concurrency correctly. Any feedback is appreciated. public class MyLo...
I have a gridview with CheckBox inside it. When the user selects a row and clicks on a button, a message is sent for the specific user. How can this be optimized? protected void btnSendSMSForSpeceficUser_Click(object sender, EventArgs e) { using (NoavaranModel.NoavaranEntities1 dbContext=new NoavaranModel....
Please review this code, which should calculate the tax percentage a person will pay in a progressive tax system. The goal is to have a perfect program. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class TaxLevel...
Is this the best way to check if two floating point numbers are equal, or close to being equal? template <class T> bool IsEqual(T rhs, T lhs) { T diff = std::abs(lhs - rhs); T epsilon = std::numeric_limits<T>::epsilon( ) * std::max(std::abs(rhs), std::abs(lhs)); return diff <= epsilon ; }
I wrote this function to read Las file and save a shapefile. The function creates a shapefile with 8 fields. What I wish insert a parse element in the function in order to select the fields I wish to save LAS2SHP(inFile, outFile=None, parse=None). If parse=None all fields are saved. If parse="irn" the fields intensity...
What can I do to improve performance of this function? So far I've changed stuff as local as possible and made a break if all possible surrounding tiles have been found. Also I use a separate variable to track the length of a list instead of len(). The usage of this is to find surrounding tiles for all tiles. def getsu...
I've recently been learning (and struggling with) integrating AutoFac, NHibernate & ASP.NET Web API. I have found several tutorials with code that did not work as anticipated but managed to finally find a working solution. Essentially what I'm doing is registering a singleton of my SessionFactory to the WebApiApplicati...
I am new to Java and I am trying to learn about optimizing code to make it production ready. I have the following code below. I would like to know how I could optimize it. I thought by using a small snippet of could, it would be a good way to learn. Some points: The function would be run many times to it needs to be f...
I have to do a table like this one: +-------+-------+-------+-------+-------+-------+ | th 1 | th 2 | th 3 | th 4 | +-------+-------+-------+-------+-------+-------+ | | | | td 1 | td 2 | td 3 | | | | th 7 +-------+-------+-------+ | | | | td 4 | ...
I'm still learning Python, so I tried to build a basic MVC app using wxPython and pubsub. While it seems to work fine, the code seems to be getting out of hand. In model I decided against using traditional (e.g. Java) accessors and went with the more Pythonic approach of properties. I only wanted to set the setters, bu...
I more or less asked the same questions on stackoverflow.com, but maybe this is more for this forum. I have a hard time getting to grips with how to implement a top navigation (common for the whole site) and a page specific navigation (common for the current controller). I use Colin Williams' Template library. I have w...
I am trying to learn the absolute best way to program/design classes in PHP. I am hoping that you would be able to review and critique this simple class. Note: I know that there aren't any comments. Please don't critique me on that. <?php class VisitorCounter { protected $numVisits; protected $db; public f...
String Name = "yyyy MM DD abjwg kelk.exe" public static bool IsNameRight(string Name) { string[] temp = Name.Split(' '); string[] de= Name.Split('.'); if (de[1] == "pdf" && temp .Length == 5) { if (temp [0].Length == 4 && temp [1].Length == 2 && temp [3].Length == 2 ...
I'm making an avatar creator with jQuery where users can select and change hair, eye and skin colour. The page is a form with different values and when the user clicks on the form options the values are translated to CSS. This allows the avatar options to change. jQuery enhanced cookie is used to store the data values....
I'm looking for a way to simplify this code, because I could develop more overloads for TryThis I made the string and int both of class Nullable so that in each overloaded function, the catch block could return the same value. The problem is I need, if possible, no overloads of TryThis. The function overloads are b...
I'm modeling a reflection-based controller. I would like to know if you agree with my implementation and about what could be enhanced. I'm starting with reflection and I would like to know if I'm using good practices. public class StartController extends HttpServlet { @Override public void service(HttpServletR...
This is just a fun little exercise I had to do for a homework once (in Java rather than Clojure though). Basically, the goal is to find the number of different coin stacks you can build with the coins 1,2,5 and 10 to form a number N (I believe a closed form solution for this exists, but this isn't what this is about). ...
var ContentEditingHelper; $(ContentEditingHelper = function () { var costCenterSelector = '#CostCenter'; var projectSubcodeSelector = '#ProjectSubcode'; var incidentNumberSelector = '#IncidentNumber'; //This bit of code affects the 'Add New Order' dialog. It works on the 'Incident Number', 'Project Sub...
I have created an SslStream Abstract Class for my Client and i want you to review and enhance it for me if needed SecureStream.cs using System; using System.Net; using System.Net.Security; using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using Program.Connecti...
I am working on a Java project for college that involves us setting up a TCP Server and Client. I have that part working and now to add more of a feel to my project I want to add a GUI. We have not begun learning about GUI's in Java yet. However I want to try as I think it would be a useful exercise. I have a very basi...
This isn't urgent, it is more along the lines of trivia or a challenge. The solution works fine as it is, but I suspect it could be better. What follows is a method I came up with a while back in a rather ugly situation where I need to make a "best effort" to try casting an object of an unrestricted unknown type TO an...
It might be a bit redundant, and I'm not experienced enough to wrap it all into one function. But, I'm aiming for unicode email adresses and a quick loose but secure validation. How can I improve this? note: I'm using PDO, so I'm mainly focusing on preventing HTML injection. Is this an issue ether way if I'm outputting...
I wrote this code for reversing a doubly linked list containing words in each node, which works perfectly fine. My teacher says the algorithm is difficult to understand and the code as a whole could be made more efficient(reducing overhead and memory consumption). What changes can i make to the code/the reversing algo...
I am hoping someone can help me tidy up my code (for a practical for university). The practical is to use the random number generator to produce 100 integers (all between 1 and 10) and store them in an array. We then need to scan the array and print out how often each number appears. Following this, we needed to create...
I am using the Python module urllib3. It occurs to me that there is a better way to design a good class when I rebuild my last site crawler. class Global: host = 'http://xxx.org/' proxy=True proxyHost='http://127.0.0.1:8087/' opts=AttrDict( method='GET', headers={'Host':'xxxx.org', ...
How could I improve this code to make it shorter and more functional? #!usr/bin/python import time integer = 0 print("The current integer is set at " + str(integer) + ".") print("\n") time.sleep(2) prompt = raw_input("Would you like to change the integer? (Y/N) ") print("\n") if prompt == 'y': integer = int(raw_inp...
I would like to get some general comments on style and use of STL in particular. This is some code I wrote to do machine learning classification (logistic regression). Any suggestions would be very appreciated! A record containing an individual training example: /* * A class representing a single record to be used for...
In this program, I have been asked to read an existing textfile (1324passlist) containing a list of passwords, then create a dictionary file with both the password and MD5 hash of the password on the same line. It should also have the user input a password hash, search the created dictionary file and print the correspo...
Can someone improve this code? I need to eliminate the for loop. public bool CheckMobileSim(List<Mobile_Range> numberRange, string MobileNumber) { bool SimType = new bool(); string NineDigits = MobileNumber.Substring(0, 9).ToString(); long Number = Convert.ToInt64(NineDigits); if (numberRange != null) ...
I am developing a BlackJack game using Java, and it came to a point that I am using instanceof operator to determine if it is a type of some subclass. Here's an example: public void checkForBlackJack(Player player) { Hand fHand = player.getHands().get(0); if (fHand.getCardScore() == 21) { fH...
I have a Value class that may represent many different types: private BigInteger fNum; private BigDecimal fReal; private ArrayList<StaticValue> fArrayValues; private int fArrayOffset; private HashMapArray<String, StaticValue> fRecordValues; private boolean fIsCharLiteral; private int fEnumOrd; private char fCharLiteral...
I've successfully solved the Alien Languages problem for Google Code Jam in Haskell: The algorithm is trivial - turn the patterns into regular expressions and see how many of the known words match these expressions. But - this has taken me far longer than I expected it to, and most of the time I was battling with getti...
Can anyone review my addMatrix() method to see if I am following the instructions correctly? These are the instructions: This is a public method (I'm calling it addMatrix()) that has only one parameter for a DoubleMatrix to add this doubMatrix (not changing this doubMatrix) and the parameter's doubMatrix and return a ...
Im using Struts2 running in google app engine. User can use their google and facebook account to login to the site. When a user login, i have: session.put("email", email); When a user log-out, I have session.remove("email"); In Struts2 Action, I have the following: public class ChapterAction extends ActionSupport imp...
Can you help me optimize the speed and security of my homepage? (Link now dead - 2014/04/10 - http://www.pixel-klicker.de) var aktiv=0; var red ; var enable = []; var count = 1; var number = 0; var Jetzt = 0; var Start = 0; var codes = []; var xmlHttp; function createXMLHttpRequestObject() { if(window.ActiveX...
I posted the following code on here a few days ago: public class Practical4_Assessed { public static void main(String[] args) { Random numberGenerator = new Random(); int[] arrayOfGenerator = new int[100]; int[] countOfArray = new int[10]; int count; for (int countOfGen...
explain: from start day till now I've got 7.7 mb size, how long it will be to make it 10 gb size open System let dd = (DateTime.Now - DateTime.Parse("12/09/2012")).Days let oneday = 7.7 / Convert.ToDouble(dd) let in10gb = Convert.ToInt32( Math.Round (10.0 * 1024.0 / oneday) ) let years = Convert.ToInt32( Math.Round (...
public bool CheckPlace(string State, string City) { TestDataContext data = new TestDataContext(); bool IsKochi = new bool(); if (!string.IsNullOrEmpty(State) && !string.IsNullOrEmpty(City)) { var Place = (from a in data.Places where a.State == State || a.City == City select a.Place).ToList(); ...