implementation

BigInteger numbers implementation and performance

99封情书 提交于 2019-12-04 19:44:56
I have written a BigInteger class in C++ that should be able to do operations on all numbers with any size. Currently I am trying to achieve a very fast multiplication method by comparing the existing algorithms and test for which amount of digits they work best and I ran into very unexpected results.I tried to do 20 multiplications of 500-digit and I timed them. This was the result: karatsuba: 14.178 seconds long multiplication: 0.879 seconds Wikipedia told me It follows that, for sufficiently large n, Karatsuba's algorithm will perform fewer shifts and single-digit additions than longhand

ASP.NET/Paypal: PayPal Integration Wizard?

最后都变了- 提交于 2019-12-04 18:54:38
问题 I'm currently trying my luck to integrate PayPal in ASP.NET (I'm just starting to know more about PayPal, okay?) PayPal Integration Wizard. Hmmm. Does this even work? What are your thoughts/comments/suggestions about it? Any good implementation (in ASP.NET) you could share? 回答1: There are a lot of articles, tutorials and samples out there. Official Paypal resources PayPal SDKs PayPal Sample Code Blog posts and articles ASP.NET Implementation for Paypal Website Payments Standard Use of the

How to implement IDisposable in Entity Framework?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 18:27:29
I am having my entity framework context in a separate EL Layer, which stands for Entity Layer and then I move to DAL, then BL and my user inteface aspx.cs code page. I am confused as such how to use IDisposable in the same. What I am doing till now, supopose in my DAL I have context of my entities. namespace abc { public class Action: IDisposable { Entities context = new Entities(); // all the methods public void Dispose() { context.Dispose(); } } } Is it the correct way of doing so? I am just a naive programmer so help me in learning the same logic. Personally I would change it a little bit,

what SDL and OpenGL version and implementation I'm using

丶灬走出姿态 提交于 2019-12-04 14:03:23
I downloaded SDL 1.2.14 on Windows 7 and I have Mobility Radeon X1800 driver installed. I'm using Microsoft Visual C++ 2010 Express. I added the SDL include and library directories in the "VC++ Directories" I added the following Additional Dependencies: opengl32.lib; glu32.lib; SDL.lib; SDLmain.lib; I added the SDL.dll to my program folder I didn't add any opengl directories! #include "SDL.h" #include "SDL_opengl.h" bool running = true; int main(int argc, char* args[]) { SDL_Init(SDL_INIT_EVERYTHING); SDL_Surface* screen = SDL_SetVideoMode(640,480,32,SDL_OPENGL); glViewport(0,0,640,480);

C++ header and implementation files: what to include?

大兔子大兔子 提交于 2019-12-04 13:42:20
问题 There is a .h file and a .cpp file with the same name but different extension. If I want to use what's in the .cpp file, do I include the .h file or the .cpp file? 回答1: The simple answer is that you almost always want to include .h files, and compile .cpp files. CPP files are (usually) the true code, and H files are (usually) forward-declarations. The longer answer is that you may be able to include either, and it might work for you, but both will give slightly different results. What

How does MapReduce framework implement the sort phase?

无人久伴 提交于 2019-12-04 11:52:46
I am interested in the implementation of the MapReduce sort phase; it seems to be very efficient. Could someone provide some references about it please? Thanks! This points to ReduceTask.java as the place where sort phase is coded. See lines 393-408 in ReduceTask.java . If you need more info, download the entire source and dig into it. EDITED "Sort" phase falls under ReduceTask as shown in this figure below from hadoop book . (Page no: 163) 来源: https://stackoverflow.com/questions/9363761/how-does-mapreduce-framework-implement-the-sort-phase

How would I implement a ranking algorithm in my website to sort database data?

佐手、 提交于 2019-12-04 10:41:53
I want to implement a ranking system on a website I've been working on and have decided to go with the Hacker News algorithm. My reasoning for choosing this algorithm is simply because it's been described here . I was looking at this Python code (the language I'm using to build my site) and couldn't figure out how I would implement it. def calculate_score(votes, item_hour_age, gravity=1.8): return (votes - 1) / pow((item_hour_age+2), gravity) Given the tables: posts: id | title | time_submitted votes: id | postid | userid | score How would I pull the data from the database? The ideal solution

DDD - which layer DTO should be implemented

删除回忆录丶 提交于 2019-12-04 10:01:25
问题 I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Application Service Layer. The DTO implementation seems part of the Domain, but it means that when I create a collection of DTOs in the Service Layer and pass it to a Presentation Layer, I

Automating a Job at Work: Importing Powerpoint Bullet Text into an Excel Sheet

∥☆過路亽.° 提交于 2019-12-04 09:39:30
I have been asked to automate a particular task at work today which takes up a lot of our time! The following is what needs to be done and I would appreciate any help on how I can do this (Implementation Advice) within the realms of my knowledge, if possible. Problem I have a PowerPoint document (.ppt). I would like to extract text from there (the text is in bullet point format). I would like to insert these bullets points into an Excel sheet, each bullet point should be a row. I would also like to put in the adjacent column the page this bullet point text was taken from. So, basically:

How to implement an artificial neural network in Delphi? [closed]

点点圈 提交于 2019-12-04 08:21:47
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I want to have an artificial neural network: 42 input neurons 168 hidden neurons 7 output neurons This network is to play the game of "Connect Four". At the end of each game, the network gets feedback (game result / win?). Learning should be done with Temporal Difference Learning.