Search Results

Search found 724 results on 29 pages for 'constants'.

Page 12/29 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Why do programmers write n=O(n^2)?

    - by Jaakko Seppälä
    I studied algorithms in a book Cormen & al. "Introduction to algorithms". In the fourth printing, on the page 43 defines O(g(n))={f(n):there exists positive constants c and n_0 s.t. 0<=f(n)<=cg(n) for all n=n_0} I reported this as a bug in the book www-site because this leads to notation like n=O(n^2) and suggested alternative given in http://www.artofproblemsolving.com/Forum/viewtopic.php?f=296&t=31517&start=20 . It looks like my bug report has not been accepted. Why the programmers won't renew the notation?

    Read the article

  • Platformer Starter Kit - Collision Issues

    - by Cyral
    I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision (Being it needs to be more precise). Standing on the edge of a tile and jumping causes the player to move off the the tile when he lands. And 80% of the time, when the player lands, he goes flying though SOLID tiles in a diagonal fashion. This is very annoying as it is almost impossible to test other features, when spawning and jumping will result in the player landing in another part of the level or falling off the edge completely. The code is as follows: /// <summary> /// Updates the player's velocity and position based on input, gravity, etc. /// </summary> public void ApplyPhysics(GameTime gameTime) { float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds; Vector2 previousPosition = Position; // Base velocity is a combination of horizontal movement control and // acceleration downward due to gravity. velocity.X += movement * MoveAcceleration * elapsed; velocity.Y = MathHelper.Clamp(velocity.Y + GravityAcceleration * elapsed, -MaxFallSpeed, MaxFallSpeed); velocity.Y = DoJump(velocity.Y, gameTime); // Apply pseudo-drag horizontally. if (IsOnGround) velocity.X *= GroundDragFactor; else velocity.X *= AirDragFactor; // Prevent the player from running faster than his top speed. velocity.X = MathHelper.Clamp(velocity.X, -MaxMoveSpeed, MaxMoveSpeed); // Apply velocity. Position += velocity * elapsed; Position = new Vector2((float)Math.Round(Position.X), (float)Math.Round(Position.Y)); // If the player is now colliding with the level, separate them. HandleCollisions(); // If the collision stopped us from moving, reset the velocity to zero. if (Position.X == previousPosition.X) velocity.X = 0; if (Position.Y == previousPosition.Y) velocity.Y = 0; } /// <summary> /// Detects and resolves all collisions between the player and his neighboring /// tiles. When a collision is detected, the player is pushed away along one /// axis to prevent overlapping. There is some special logic for the Y axis to /// handle platforms which behave differently depending on direction of movement. /// </summary> private void HandleCollisions() { // Get the player's bounding rectangle and find neighboring tiles. Rectangle bounds = BoundingRectangle; int leftTile = (int)Math.Floor((float)bounds.Left / Tile.Width); int rightTile = (int)Math.Ceiling(((float)bounds.Right / Tile.Width)) - 1; int topTile = (int)Math.Floor((float)bounds.Top / Tile.Height); int bottomTile = (int)Math.Ceiling(((float)bounds.Bottom / Tile.Height)) - 1; // Reset flag to search for ground collision. isOnGround = false; // For each potentially colliding tile, for (int y = topTile; y <= bottomTile; ++y) { for (int x = leftTile; x <= rightTile; ++x) { // If this tile is collidable, ItemCollision collision = Level.GetCollision(x, y); if (collision != ItemCollision.Passable) { // Determine collision depth (with direction) and magnitude. Rectangle tileBounds = Level.GetBounds(x, y); Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds); if (depth != Vector2.Zero) { float absDepthX = Math.Abs(depth.X); float absDepthY = Math.Abs(depth.Y); // Resolve the collision along the shallow axis. if (absDepthY < absDepthX || collision == ItemCollision.Platform) { // If we crossed the top of a tile, we are on the ground. if (previousBottom <= tileBounds.Top) isOnGround = true; // Ignore platforms, unless we are on the ground. if (collision == ItemCollision.Impassable || IsOnGround) { // Resolve the collision along the Y axis. Position = new Vector2(Position.X, Position.Y + depth.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } else if (collision == ItemCollision.Impassable) // Ignore platforms. { // Resolve the collision along the X axis. Position = new Vector2(Position.X + depth.X, Position.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } } } } // Save the new bounds bottom. previousBottom = bounds.Bottom; } It also tends to jitter a little bit sometimes, I'm solved some of this with some fixes I found here on stackexchange, But Ive only seen one other case of the flying though blocks problem. This question seems to have a similar problem in the video, but mine is more crazy. Again this is a very annoying bug! Any help would be greatly appreciated! EDIT: Speed stuff // Constants for controling horizontal movement private const float MoveAcceleration = 13000.0f; private const float MaxMoveSpeed = 1750.0f; private const float GroundDragFactor = 0.48f; private const float AirDragFactor = 0.58f; // Constants for controlling vertical movement private const float MaxJumpTime = 0.35f; private const float JumpLaunchVelocity = -3500.0f; private const float GravityAcceleration = 3400.0f; private const float MaxFallSpeed = 550.0f; private const float JumpControlPower = 0.14f;

    Read the article

  • How much server bandwidth does an average RTS game require per month?

    - by Nat Weiss
    My friend and I are going to write a multiplayer, multiplatform RTS game and are currently analyzing the costs of going with a client-server architecture. The game will have a small map with mostly characters, not buildings (think of DotA or League of Legends). The authoritative game logic will run on the server and message packet sizes will be highly optimized. We'd like to know approximately how much server bandwidth our proposed RTS game would use on a monthly basis, considering these theoretical constants: 100 concurrent users maximum 8 players maximum per game 10 ticks per second Bonus: If you can tell us approximately how much server RAM this kind of game would use that would also help a great deal. Thanks in advance.

    Read the article

  • When to use mixins in Ruby

    - by Gilles
    I am wondering when to use mixins? I have read about them. Many authors compare them to interfaces, abstract classes, etc. Mixins are modules that are mixed-in and modules are a way to group similar methods, constants and classes together. I have seen examples where a module for math functions is created. It makes sense to group and reuse such functions but should I only mix these in a class if I am faced with an inheritance situation? Should I mix these in anytime I want to use them in a class? Should they be used exactly like interfaces in other languages or are there other subtleties?

    Read the article

  • Best practice Java - String array constant and indexing it

    - by Pramod
    For string constants its usual to use a class with final String values. But whats the best practice for storing string array. I want to store different categories in a constant array and everytime a category has been selected, I want to know which category it belongs to and process based on that. Addition : To make it more clear, I have a categories A,B,C,D,E which is a constant array. Whenever a user clicks one of the items(button will have those texts) I should know which item was clicked and do processing on that. I can define an enum(say cat) and everytime do if clickedItem == cat.A .... else if clickedItem = cat.B .... else if .... or even register listeners for each item seperately. But I wanted to know the best practice for doing handling these kind of problems.

    Read the article

  • Ripping MP3s in Rhythmbox Ubuntu 12.10 (64 bit)?

    - by James Fellows Yates
    I installed a couple of days ago Ubuntu 12.10 (64 bit). I today tried ripping a CD in the MP3 format. However, whenever I try to rip, it says it is missing an extra multimedia plugin "Gstreamer extra plug-ins (i386)". I then try to install the :i386 version of the gstreamer-ugly plugins, but then I get the same problem but with the id3-demuxer (or something similar) The Terminal output I get from both problems (but replace the "MPEG-1 Layer 3 (MP3) encoder" with the "ID3-demuxer" name) is: james@clefairy:~$ rhythmbox (rhythmbox:24122): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed Rhythmbox-Message: Missing plugin: gstreamer|0.10|rhythmbox|MPEG-1 Layer 3 (MP3) encoder|encoder-audio/mpeg, mpegversion=(int)1, layer=(int)3 /usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed import gobject._gobject It doesn't help that each time I have to install/remove the entire Gstreamer-ugly collection each time - I can't find that specific file. The CD plays fine, it's the ripping plugin that doesn't seem to work. I didn't have this problem previously on 12.04 (64 bit).

    Read the article

  • Handling array passed to object at creation

    - by cecilli0n
    When creating my object I pass it an array of a row from my database. (everything in the array we will need, disregarding unnecessary elements at sql query level) When I need to access certain array elements from within my class, I do so like $this->row['element'] However, As I continue development, I sometimes forget what exactly is in this passed array.(this itself doesn't seem good) I am wondering if their is a professional approach to dealing with this, Or am I the only one who has these "I wonder whats in the array" thoughts. One approach to tackling this could be that when we originally pass the array, in the constructor, we assign each element of the array to its own variable, but is this considered professional practice? Additionally by doing this, we could make those variables constants, in a attempt at immutability. Overall I am trying to adhere to good software craftsmanship. Regards.

    Read the article

  • How to devise instruction set of a stack based machine?

    - by Anindya Chatterjee
    Stack based virtual machines like CLR and JVM has different set of instructions. Is there any theory behind devising the instruction set while creating a virtual machine? e.g. there are JVM instruction sets to load constants from 0-5 onto the stack iconst_0 iconst_1 iconst_2 iconst_3 iconst_4 iconst_5 whereas in CLR there are instruction set to load number from 0 to 8 onto the stack as follows ldc.i4.0 ldc.i4.1 ldc.i4.2 ldc.i4.3 ldc.i4.4 ldc.i4.5 ldc.i4.6 ldc.i4.7 ldc.i4.8 why there is no ldc.i4.9 and if ldc.i4 is there why we need the above opcodes? And there are others like these. I am eager to know what is the reason behind this difference between opcodes of different VMs? Is there any specific theory to devise these opcodes or it is totally driven by the characteristics of the VM itself or depends on the high-level language constructs?

    Read the article

  • HW resources for the device driver [closed]

    - by VladimirLenin
    Need to provide memory and IRQ resources to the Linux kernel in order to bring up the CAN controller. Have no idea how to get them. Below is the structure I need to fill in. This structure I have taken for example, this is for the Run-Time Clock, but I need for CAN controller. Both are on the same board, and there are constants for RT Clock (and all other devices), but not for my CAN chip. When looking at the subject chip driver's code (sp_probe() function), I see it needs the same type resources. struct resource tegra_rtc_resources[] = { [0] = { .start = ???, .end = ???, .flags = IORESOURCE_MEM, }, [1] = { .start = ???, .end = ???, .flags = IORESOURCE_IRQ, }, };

    Read the article

  • Who could ask for more with LESS CSS? (Part 1 of 3&ndash;Features)

    - by ToStringTheory
    It wasn’t very long ago that I first began to get into CSS precompilers such as SASS (Syntactically Awesome Stylesheets) and LESS (The Dynamic Stylesheet Language) and I had been hooked on the idea since.  When I finally had a new project come up, I leapt at the opportunity to try out one of these languages. Introduction To be honest, I was hesitant at first to add either framework as I didn’t really know much more than what I had read on their homepages, and I didn’t like the idea of adding too much complexity to a project - I couldn’t guarantee I would be the only person to support it in the future. Thankfully, both of these languages just add things into CSS.  You don’t HAVE to know LESS or SASS to do anything, you can still do your old school CSS, and your output will be the same.  However, when you want to start doing more advanced things such as variables, mixins, and color functions, the functionality is all there for you to utilize. From what I had read, SASS has a few more features than LESS, which is why I initially tried to figure out how to incorporate it into a MVC 4 project. However, through my research, I couldn’t find a way to accomplish this without including some bit of the Ruby on Rails framework on the computer running it, and I hated the fact that I had to do that.  Besides SASS, there is little chance of me getting into the RoR framework, at least in the next couple years.  So in the end, I settled with using LESS. Features So, what can LESS (or SASS) do for you?  There are several reasons I have come to love it in the past few weeks. 1 – Constants Using LESS, you can finally declare a constant and use its value across an entire CSS file. The case that most people would be familiar with is colors.  Wanting to declare one or two color variables that comprise the theme of the site, and not have to retype out their specific hex code each time, but rather a variable name.  What’s great about this is that if you end up having to change it, you only have to change it in one place.  An important thing to note is that you aren’t limited to creating constants just for colors, but for strings and measurements as well. 2 – Inheritance This is a cool feature in my mind for simplicity and organization.  Both LESS and SASS allow you to place selectors within other selectors, and when it is compiled, the languages will break the rules out as necessary and keep the inheritance chain you created in the selectors. Example LESS Code: #header {   h1 {     font-size: 26px;     font-weight: bold;   }   p {     font-size: 12px;     a     {       text-decoration: none;       &:hover {         border-width: 1px       }     }   } } Example Compiled CSS: #header h1 {   font-size: 26px;   font-weight: bold; } #header p {   font-size: 12px; } #header p a {   text-decoration: none; } #header p a:hover {   border-width: 1px; } 3 - Mixins Mixins are where languages like this really shine.  The ability to mixin other definitions setup a parametric mixin.  There is really a lot of content in this area, so I would suggest looking at http://lesscss.org for more information.  One of the things I would suggest if you do begin to use LESS is to also grab the mixins.less file from the Twitter Bootstrap project.  This file already has a bunch of predefined mixins for things like border-radius with all of the browser specific prefixes.  This alone is of great use! 4 – Color Functions This is the last thing I wanted to point out as my final post in this series will be utilizing these functions in a more drawn out manner.  Both LESS and SASS provide functions for getting information from a color (R,G,B,H,S,L).  Using these, it is easy to define a primary color, and then darken or lighten it a little for your needs.  Example: Example LESS Code: @base-color: #111; @red:        #842210; #footer {   color: (@base-color + #003300);   border-left:  2px;   border-right: 2px;   border-color: desaturate(@red, 10%); } Example Compiled CSS: #footer {    color: #114411;    border-left:  2px;    border-right: 2px;    border-color: #7d2717; } I have found that these can be very useful and powerful when constructing a site theme. Conclusion I came across LESS and SASS when looking for the best way to implement some type of CSS variables for colors, because I hated having to do a Find and Replace in all of the files using the colors, and in some instances, you couldn’t just find/replace because of the color choices interfering with other colors (color to replace of #000, yet come colors existed like #0002bc).  So in many cases I would end up having to do a Find and manually check each one. In my next post, I am going to cover how I’ve come to set up these items and the structure for the items in the project, as well as the conventions that I have come to start using.  In the final post in the series, I will cover a neat little side project I built in LESS dealing with colors!

    Read the article

  • C++ linkage error . What am I doing wrong ? [migrated]

    - by nashmaniac
    So, this is the first time I actually separated a single program into a header and two .cpp files . But I think I am getting an linkage error . Heres how the directory looks . (heres a link to my image I dont have enough rep to post image in the question) http://i.stack.imgur.com/sbT4V.png The main.cpp is my main source file where all the calling functions and other important stuff goes . In functions.cpp I have all my functions , in the coordin.h file I have the function prototypes and structures and Constants . Everything is ok no typo nothing I have checked everything . But I am getting an undefined reference to function error. I have included the coordin.h file too . Do you think the functions.cpp file needs to go somewhere else I mean is the compiler not looking inside that file ? Thanks !

    Read the article

  • Classless tables possible with Datamapper?

    - by barerd
    I have an Item class with the following attributes: itemId,name,weight,volume,price,required_skills,required_items. Since the last two attributes are going to be multivalued, I removed them and create new schemes like: itemID,required_skill (itemID is foreign key, itemID and required_skill is primary key.) Now, I'm confused how to create/use this new table. Here are the options that came to my mind: 1) The relationship between Items and Required_skills is one-to-many, so I may create a RequiredSkill class, which belongs_to Item, which in turn has n RequiredSkills. Then I can do Item.get(1).requiredskills. This sounds most logical to me. 2) Since required_skills may well be thought of as constants (since they resemble rules), I may put them into a hash or gdbm database or another sql table and query from there, which I don't prefer. My question is: is there sth like a modelless table in datamapper, where datamapper is responsible from the creation and integrity of the table and allows me to query it in datamapper way, but does not require a class, like I may do it in sql?

    Read the article

  • Would you see any use of a Trilean (True, False, ??)

    - by Sybiam
    I don't know if I'm alone but sometimes I have a function that should return true or false. But in some case there would be a third result that would make more sense. In some language theses cases would be handled with integers or with exception. For exemple you want to handle the age of a user if he is over 18 years old. And you have a function like this. if(user.isAdult(country_code)){ //Go On }else{ // Block access or do nothing } But in some case depending how your app is built I could see case where the birthday field is incomplete. Then this function should return something undetermined. switch(user.isAdult()){ case true: // go on break; case undetermined: //Inform user birthday is incomplete case false: //Block access } As i said we can handle that with Exceptions and Int, but I would find it quite sexy to have a true, false, undetermined embeded in the language instead of using some home defined constants.

    Read the article

  • Runge-Kutta (RK4) integration for game physics

    - by Kai
    Gaffer on Games has a great article about using RK4 integration for better game physics. The implementation is straightforward but the math behind it confuses me. I understand derivatives and integrals on a conceptual level but I haven't manipulated equations in a long time. Here's the brunt of Gaffer's implementation: void integrate(State &state, float t, float dt) { Derivative a = evaluate(state, t, 0.0f, Derivative()); Derivative b = evaluate(state, t+dt*0.5f, dt*0.5f, a); Derivative c = evaluate(state, t+dt*0.5f, dt*0.5f, b); Derivative d = evaluate(state, t+dt, dt, c); const float dxdt = 1.0f/6.0f * (a.dx + 2.0f*(b.dx + c.dx) + d.dx); const float dvdt = 1.0f/6.0f * (a.dv + 2.0f*(b.dv + c.dv) + d.dv) state.x = state.x + dxdt * dt; state.v = state.v + dvdt * dt; } Can anybody explain in simple terms how RK4 works? Specifically, why are we averaging the derivatives at 0.0f, 0.5f, 0.5f, and 1.0f? How is averaging derivatives up to the 4th order different from doing a simple euler integration with a smaller timestep? After reading the accepted answer below, and several other articles, I have a grasp on how RK4 works. To answer my own questions: Can anybody explain in simple terms how RK4 works? RK4 takes advantage of the fact that we can get a much better approximation of a function if we use its higher-order derivatives rather than just the first or second derivative. That's why the Taylor series converges much faster than Euler approximations. (take a look at the animation on the right side of that page) Specifically, why are we averaging the derivatives at 0.0f, 0.5f, 0.5f, and 1.0f? The Runge-Kutta method is an approximation of a function that samples derivatives of several points within a timestep, unlike the Taylor series which only samples derivatives of a single point. After sampling these derivatives we need to know how to weigh each sample to get the closest approximation possible. An easy way to do this is to pick constants that coincide with the Taylor series, which is how the constants of a Runge-Kutta equation are determined. This article made it clearer for me: http://web.mit.edu/10.001/Web/Course%5FNotes/Differential%5FEquations%5FNotes/node5.html. Notice how (15) is the Taylor series expansion while (17) is the Runge-Kutta derivation. How is averaging derivatives up to the 4th order different from doing a simple euler integration with a smaller timestep? Mathematically it converges much faster than doing many Euler approximations. Of course, with enough Euler approximations we can gain equal accuracy to RK4, but the computational power needed doesn't justify using Euler.

    Read the article

  • §non_lazy_ptr iphone sdk 3.0

    - by Hans Espen
    After I built my iphone 2.2.1 application in sdk 3.0, I get a lot of errors of type §non_lazy_ptr. I am getting it on the CFFTPStream constants, like kCFStreamPropertyFTPPassword and kCFStreamPropertyUserName. Anyone know what causes this?

    Read the article

  • Quartz scheduler is failing to start the cron job

    - by Amit
    Hi I am using Quartz scheduler to trigger a cron which needs to perform a host of activities. My Code for the same is as follow: In the init() method of my InitServlet class, I am defining my TimerServer public class InitServlet extends HttpServlet { public void init(ServletConfig config) throws ServletException { try { System.out.println("Starting the CRON"); //Set the DSO Handler CRON TimerServer task = TimerServer.getInstance(); task.setTask(); } catch (Exception ex) { System.out.println("Failed to start the cron"); ex.printStackTrace(); } } In my TimerServer class I have the following methods public void setTask() { try{ this.setSubscriptionDailyJob(); } catch(SchedulerException ex) { log.error("SchedulerException: "+ex.getMessage(), ex); } private void setSubscriptionDailyJob() throws SchedulerException { log.info("Step 1 "); Scheduler scheduler = schedulerFactory.getScheduler(); log.info("Step 2 "); JobDetail subscriptionJob = new JobDetail("subscription", "subscriptiongroup", SubscriptionDaily.class); log.info("Step 3 "); // Initiate CronTrigger with its name and group name CronTrigger subscriptionCronTrigger = new CronTrigger("subscriptionCronTrigger", "subscriptionTriggerGroup"); try { log.info("Subscription cron: "+Constants.SUBSCRIPTION_CRON); // setup CronExpression CronExpression cexp = new CronExpression(Constants.SUBSCRIPTION_CRON); // Assign the CronExpression to CronTrigger subscriptionCronTrigger.setCronExpression(cexp); } catch (Exception ex) { log.warn("Exception: "+ex.getMessage(), ex); } scheduler.scheduleJob(subscriptionJob, subscriptionCronTrigger); scheduler.start(); } In my SubscriptionDaily class : public class SubscriptionDaily implements Job { public void execute(JobExecutionContext arg0) throws JobExecutionException { //Actions to be performed } } Now checking my logs, I am getting Step 1, Step 2 but not further. My code is getting stucked at the TimerServer class itself. Logs wrt to Scheduler are : 17:24:43 INFO [TimerServer]: Step 1 17:24:43 INFO [SimpleThreadPool]: Job execution threads will use class loader of thread: http-8080-1 17:24:43 INFO [SchedulerSignalerImpl]: Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 17:24:43 INFO [QuartzScheduler]: Quartz Scheduler v.1.6.5 created. 17:24:43 INFO [RAMJobStore]: RAMJobStore initialized. 17:24:43 INFO [StdSchedulerFactory]: Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 17:24:43 INFO [StdSchedulerFactory]: Quartz scheduler version: 1.6.5 17:24:43 INFO [TimerServer]: Step 2 I think a log entry is missing : [QuartzScheduler]: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. Please help.

    Read the article

  • Very simple application fails with "multiple target patterns" from Eclipse

    - by Paul Lammertsma
    Since I'm more comfortable using Eclipse, I thought I'd try converting my project from Visual Studio. Yesterday I tried a very simple little test. No matter what I try, make fails with "multiple target patterns". (This is similar to this unanswered question.) I have three files: Application.cpp: using namespace std; #include "Window.h" int main() { Window *win = new Window(); delete &win; return 0; } Window.h: #ifndef WINDOW_H_ #define WINDOW_H_ class Window { public: Window(); ~Window(); }; #endif Window.cpp: #include <cv.h> #include <highgui.h> #include "Window.h" const char* WINDOW_NAME = "MyApp"; Window::Window() { cvNamedWindow(WINDOW_NAME, CV_WINDOW_AUTOSIZE); cvResizeWindow(WINDOW_NAME, 200, 200); cvMoveWindow(WINDOW_NAME, 0, 0); int key = 0; while (true) { key = cvWaitKey(0); if (key==27 || cvGetWindowHandle(WINDOW_NAME)==0) { break; } } } Window::~Window() { cvDestroyWindow(WINDOW_NAME); } I have added the following paths to the compiler include path (-I): "$(OPENCV)/cv/include" "$(OPENCV)/cxcore/include" "$(OPENCV)/otherlibs/highgui" I have added the following libraries to the linker (-l): cv cxcore highgui And the following library search path (-L): "$(OPENCV)/lib/" Eclipse, the compiler and the linker all succeed in including the headers and libraries. I am using the GNU C/C++ compiler & linker from Cygwin. When compiling, I get the following make error: src/Window.d:1: *** multiple target patterns. Stop. Window.d contains: src/Window.d src/Window.o: ../src/Window.cpp \ C:/Program\ Files/OpenCV/cv/include/cv.h \ C:/Program\ Files/OpenCV/cxcore/include/cxcore.h \ C:/Program\ Files/OpenCV/cxcore/include/cxtypes.h \ C:/Program\ Files/OpenCV/cxcore/include/cxerror.h \ C:/Program\ Files/OpenCV/cxcore/include/cvver.h \ C:/Program\ Files/OpenCV/cxcore/include/cxcore.hpp \ C:/Program\ Files/OpenCV/cv/include/cvtypes.h \ C:/Program\ Files/OpenCV/cv/include/cv.hpp \ C:/Program\ Files/OpenCV/cv/include/cvcompat.h \ C:/Program\ Files/OpenCV/otherlibs/highgui/highgui.h \ C:/Program\ Files/OpenCV/cxcore/include/cxcore.h ../src/Constants.h \ ../src/Window.h C:/Program\ Files/OpenCV/cv/include/cv.h: C:/Program\ Files/OpenCV/cxcore/include/cxcore.h: C:/Program\ Files/OpenCV/cxcore/include/cxtypes.h: C:/Program\ Files/OpenCV/cxcore/include/cxerror.h: C:/Program\ Files/OpenCV/cxcore/include/cvver.h: C:/Program\ Files/OpenCV/cxcore/include/cxcore.hpp: C:/Program\ Files/OpenCV/cv/include/cvtypes.h: C:/Program\ Files/OpenCV/cv/include/cv.hpp: C:/Program\ Files/OpenCV/cv/include/cvcompat.h: C:/Program\ Files/OpenCV/otherlibs/highgui/highgui.h: C:/Program\ Files/OpenCV/cxcore/include/cxcore.h: ../src/Constants.h: ../src/Window.h: I tried removing all OpenCV headers from Window.d (from line 2 onwards), but the error remains. Also, I've updated Eclipse and OpenCV, all to no avail. Do you have any ideas worth trying? I'm willing to try anything!

    Read the article

  • iPhone OpenGL ES missing functions should be there - glBlendFuncSeparate etc

    - by quixoto
    I'm using OpenGL ES 1.1 on the iPhone, and I'd like to use the following functions: glBlendFuncSeparate glBlendColor With their related constants. These didn't exist in early iPhone GL implementations, but according to this page: http://developer.apple.com/iphone/library/releasenotes/General/iPhone30APIDiffs/index.html they should be there in 3.0+, which I'm building for. But I'm getting "implicit definition" warnings. What do I need to do to get those functions? Thanks!

    Read the article

  • unhandeled exception occured in c#

    - by abid
    hey. i`m getting this error that system.data.datarowview is not permitted in this contexxt. valid expressions are constants expressions and ( in some contexts). column name are not permitted.. can any body guide me what this error says.. can any one provide me a suggestion whether where im wrong.. any guesses guys??? im not getting it.. :/

    Read the article

  • using Java interfaces

    - by mike_hornbeck
    I need to create interface MultiLingual, that allows to display object's data in different languages (not data itself, but introduction like "Author", "Title" etc.). Printed data looks like this : 3 grudnia 1998 10th of June 1924 Autor: Tolkien Tytul: LoTR Wydawnictwo: Amazon 2010 Author: Mitch Albom Title: Tuesdays with Morrie Publishing House: Time Warner Books 2003 37 360,45 PLN 5,850.70 GBP 3rd of December 1998 10th of June 1924 Author: Tolkien Title: LoTR Publishing House: Amazon 2010 Author: Mitch Albom Title: Tuesdays with Morrie Publishing House: Time Warner Books 2003 37,360.45 GBP 5,850.70 GBP Test code looks like this : public class Main { public static void main(String[] args){ MultiLingual gatecrasher[]={ new Data(3,12,1998), new Data(10,6,1924,MultiLingual.ENG), new Book("LoTR", "Tolkien", "Amazon", 2010), new Book("Tuesdays with Morrie", "Mitch Albom", "Time Warner Books",2003, MultiLingual.ENG), new Money(1232895/33.0,MultiLingual.PL), new Money(134566/23.0,MultiLingual.ENG), }; for(int i=0;i < gatecrasher.length;i++) System.out.println(gatecrasher[i]+"\n"); for(int i=0;i < gatecrasher.length;i++) System.out.println(gatecrasher[i].get(MultiLingual.ENG)+"\n"); } } So i need to introduce constants ENG, PL in MultiLingual interface, as well as method get(int language) : public interface MultiLingual { int ENG = 0; int PL= 1; String get(int lang); } And then I have class Book. Problem starts with the constructors. One of them needs to take MultiLingual.ENG as argument, but how to achieve that ? Is this the proper way? : class Book implements MultiLingual { private String title; private String publisher; private String author; public Book(String t, String a, String p, int y, MultiLingual lang){ } Or should I treat this MultiLingual.ENG as int variable , that will just change automatically constants in interface? Second constructor for book doesn't take MultLingual as argument, but following implementation is somehow wrong : public Book(String t, String a, String p, int y){ Book someBook = new Book(t, a, p, y, MultiLingual m); } I could just send int m in place of MultiLingual m but then I will have no control if language is set to PL or ENG. And finally get() method for Boook but I think at least this should be working fine: public String get(int lang){ String data; if (lang == ENG){ data = "Author: "+this.author+"\n"+ "Title: "+this.title+"\n"+ "Publisher: "+this.publisher+"\n"; } else { data = "Autor: "+this.author+"\n"+ "Tytul: "+this.title+"\n"+ "Wydawca: "+this.publisher+"\n"; } return data; } @Override public String toString(){ return ""; } }

    Read the article

  • unhandled exception occured in c#

    - by abid
    hey. i`m getting this error that system.data.datarowview is not permitted in this contexxt. valid expressions are constants expressions and ( in some contexts). column name are not permitted.. can any body guide me what this error says.. can any one provide me a suggestion whether where im wrong.. any guesses guys??? im not getting it.. :/

    Read the article

  • PHP best practices for naming conventions

    - by alex
    I recently started these naming conventions.. all functions & variables = camelCase constants with define() = ALL_CAPS_AND_UNDERSCORES Now I see a lot of other people mix up camelCase and underscores and they seem to have some sort of convention to it... What do you use and what is best? I've heard that public and private functions should have underscores before some.. I assume private have 2 underscores as in __construct() ? Thank you!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >