Search Results

Search found 407 results on 17 pages for 'gary beam'.

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

  • Is there such a thing as a C# style extension method in C++ ?

    - by Gary Willoughby
    I'm currently learning C++ and i run into the simple problem of converting an int to a string. I've worked around it using: string IntToString(int Number) { stringstream Stream; Stream << Number; return Stream.str(); } but though it would be more elegant to use something like: int x = 5; string y = x.toString(); but how do i add the toString() method to a built in type? or am i missing something totally fundamental?

    Read the article

  • What theoretical and/or experimental programming-language features are there?

    - by Gary Rake
    I'm designing a programming language, purely for fun, and want to add as many experimental features as I can, just to make programming in it something completely different, and that not in a bad way like Brainf*ck or Malbolge. However, I seem to be quite bad at coming up with new things for it but I'm sure that there are tons of things out there that have been talked about but never really tried out. What experimental language features or concepts not implemented in mainstream languages are there at the moment? E.g: If I asked this in, let's say, 1960, an answer could be "Object-oriented programming". I'm sure that there are a lot of unimplemented ideas computer-scientists have (recently) come up with, at least I was told so.

    Read the article

  • Decoding and caching json every 60 minutes

    - by Gary
    Hi, How do I do this on a php webpage? I want to get and decode a json string and display the results as html on my page, however, I don't want it hotlinking back to the source. If I could write the decoded string to a txt file say weather.txt on the server and keep the html formatting and do it so that the page won't fetch the json script until 60 minutes has passed since the last time it was fetched regardless of how many times the page is opened during that 60 minute period and the weather.txt is viewed. All I can come up with is a simple script that hotlinks, everything else I have tried simply failed. $file = file_get_contents('http://sample.com/weather'); $out = (json_decode($file)); echo $out-mainText; Will appreciate any help with this.

    Read the article

  • C signal parent process from child

    - by Gary
    I'm trying to solve a problem I've got where a child process runs execvp() and needs to let the parent know if it returns. So, after the execvp() returns (because there's been an error), how can I tell the parent that this particular event has happened so it can handle it. There's one method of writing a string of text through the pipe I'm using and then reading that from the parent.. but it seems a bit sloppy. Is there a better way? Thanks!

    Read the article

  • How can I use a compound condition in a join in Linq?

    - by Gary McGill
    Let's say I have a Customer table which has a PrimaryContactId field and a SecondaryContactId field. Both of these are foreign keys that reference the Contact table. For any given customer, either one or two contacts may be stored. In other words, PrimaryContactId can never be NULL, but SecondaryContactId can be NULL. If I drop my Customer and Contact tables onto the "Linq to SQL Classes" design surface, the class builder will spot the two FK relationships from the Customer table to the Contact table, and so the generated Customer class will have a Contact field and a Contact1 field (which I can rename to PrimaryContact and SecondaryContact to avoid confusion). Now suppose that I want to get details of all the contacts for a given set of customers. If there was always exactly one contact then I could write something like: from customer in customers join contact in contacts on customer.PrimaryContactId equals contact.id select ... ...which would be translated into something like: SELECT ... FROM Customer INNER JOIN Contact ON Customer.FirstSalesPersonId = Contact.id But, because I want to join on both the contact fields, I want the SQL to look something like: SELECT ... FROM Customer INNER JOIN Contact ON Customer.FirstSalesPersonId = Contact.id OR Customer.SecondSalesPersonId = Contact.id How can I write a Linq expression to do that?

    Read the article

  • Execute another program in multi-threaded program

    - by Gary
    Hi, Just wondering how if it's possible to execute another program in a thread and send information to/get information from it. Essentially the same concept as with a child process and using pipes to communicate - however I don't want to use fork. I can't seem to find whether it's possible to do this, any help would be appreciated. Thanks

    Read the article

  • ASP.NET MVC / Linq-to-SQL classes: Can I get it to infer readable display names?

    - by Gary McGill
    If I have a table Orders with fields CustomerID, OrderID and OrderDate, then the "Linq-to-SQL classes" generated class will be called Orders, with members called CustomerID, OrderID and OrderDate. So far so good. However, if I then do Html.LabelFor(m => m.OrderDate) then the generated text will be "OrderDate" instead of "Order Date". I tried using Order_Date as the field name, but that didn't work. Is there any way to get it to infer a better display name? [I know that I can use data annotations to specify the display name explicitly, but I really don't want to do that for all my classes/members - I just want it to work by convention.]

    Read the article

  • Can you explicitly set a structure layout/alignment in C++ as you can in C#?

    - by Gary Willoughby
    In C# you have nice alignment attributes such as this: [StructLayout(LayoutKind.Explicit)] public struct Message { [FieldOffset(0)] public int a; [FieldOffset(4)] public short b; [FieldOffset(6)] public int c; [FieldOffset(22)] //Leave some empty space just for the heck of it. public DateTime dt; } Which gives you fine control on how you need your structure to be layed out in memory. Is there such a thing in standard C++?

    Read the article

  • How to modify posted form data within controller action before sending to view?

    - by Gary
    I want to render the same view after a successful action (rather than use RedirectToAction), but I need to modify the model data that is rendered to that view. The following is a contrived example that demonstrates two methods that that do not work: [AcceptVerbs("POST")] public ActionResult EditProduct(int id, [Bind(Include="UnitPrice, ProductName")]Product product) { NORTHWNDEntities entities = new NORTHWNDEntities(); if (ModelState.IsValid) { var dbProduct = entities.ProductSet.First(p => p.ProductID == id); dbProduct.ProductName = product.ProductName; dbProduct.UnitPrice = product.UnitPrice; entities.SaveChanges(); } /* Neither of these work */ product.ProductName = "This has no effect"; ViewData["ProductName"] = "This has no effect either"; return View(product); } Does anyone know what the correct method is for accomplishing this?

    Read the article

  • Cannot move ckeditor 4 selection to beginning

    - by Gary Hillerson
    I've been exploring numerous solutions in stackoverflow and elsewhere to try to get ckeditor 4 to scroll to the top after I've programmatically added a number of pages to it, using CKEditor's InsertHtml function. After adding my html, which looks fine, I want to position the cursor at the beginning. Here's one of a variety of things I've tried without success: function MoveCaretToStart(myEditor) { var range = new CKEDITOR.dom.range( editor.document ); range.selectNodeContents(editor.document.getBody()); range.moveToElementEditStart(range.root); // also tried range.collapse(true); range.select(); } ... MoveCaretToStart(CKEDITOR.instances['myEditor']); // which already has contents in it This doesn't throw any errors, but also doesn't move the cursor position (it remains at the end of the doc). I thought this one would be easy, but it sure hasn't been. Any help appreciated.

    Read the article

  • PHP - Open or copy a file when knowing only part of its name?

    - by Gary Willoughby
    I have a huge repository of files that are ordered by numbered folders. In each folder is a file which starts with a unique number then an unknown string of characters. Given the unique number how can i open or copy this file? for example: I have been given the number '7656875' and nothing more. I need to interact with a file called '\server\7656800\7656875 foobar 2x4'. how can i achieve this using PHP?

    Read the article

  • C# - How to implement multiple comparers for an IComparable<T> class?

    - by Gary Willoughby
    I have a class that implements IComparable. public class MyClass : IComparable<MyClass> { public int CompareTo(MyClass c) { return this.whatever.CompareTo(c.whatever); } etc.. } I then can call the sort method of a generic list of my class List<MyClass> c = new List<MyClass>(); //Add stuff, etc. c.Sort(); and have the list sorted according to my comparer. How do i specify further comparers to sort my collection different ways according to the other properties of MyClass in order to let users sort my collection in a number of different ways?

    Read the article

  • How am i overriding this C++ inherited member function without the virtual keyword being used?

    - by Gary Willoughby
    I have a small program to demonstrate simple inheritance. I am defining a Dog class which is derived from Mammal. Both classes share a simple member function called ToString(). How is Dog overriding the implementation in the Mammal class, when i'm not using the virtual keyword? (Do i even need to use the virtual keyword to override member functions?) mammal.h #ifndef MAMMAL_H_INCLUDED #define MAMMAL_H_INCLUDED #include <string> class Mammal { public: std::string ToString(); }; #endif // MAMMAL_H_INCLUDED mammal.cpp #include <string> #include "mammal.h" std::string Mammal::ToString() { return "I am a Mammal!"; } dog.h #ifndef DOG_H_INCLUDED #define DOG_H_INCLUDED #include <string> #include "mammal.h" class Dog : public Mammal { public: std::string ToString(); }; #endif // DOG_H_INCLUDED dog.cpp #include <string> #include "dog.h" std::string Dog::ToString() { return "I am a Dog!"; } main.cpp #include <iostream> #include "dog.h" using namespace std; int main() { Dog d; std::cout << d.ToString() << std::endl; return 0; } output I am a Dog! I'm using MingW on Windows via Code::Blocks.

    Read the article

  • Regex to extract this semi formatted data

    - by Codygman
    Alright, I can't quite figure out how to do this. Given the following text: Roland AX-1: /start Roland's AX-1 strap-on remote MIDI controller has a very impressive 45-note velocity sensitive keyboard, and has switchable velocity curves, goes octave up/down, transpose, split/layering zones, and has fun tempo control for sequencers and more. Roland's AX-1 comes with a built-in GS control for total MIDI control of GM/GS synths. Its "Expression Bar" can control pitch and mod via an almost ribbon-like controller. It's also the newest and most advanced remote controller for your synths or midi modules. /end Roland AX-7: /start Roland's AX-7 builds on the infamous Roland AX-1 design. You just strap it on and put it to the front of the stage. Offering several controllers, such as: a D-Beam, then you can open the door to amazing live performance. 7-segment LED display, larger patch memory (Around 128 patches with MIDI data backup), and comes with GM2/GS compatibility make it extra easy to use. The 45-note, velocity-sensitive keyboard. 5 realtime controllers including a data entry knob, touch controller knob, opression bar, a hold button, and D-Beam. 128 patches with MIDI data backup. 2 MIDI zones. /end I'm trying to use the following: /^([\w\d \-]*):\s\s\s\s^\/start([^\:]*)\/end$/im You can see on rubular here: http://rubular.com/r/BVRRHsnWdp Thanks for any help. I guess i'm trying to match blocks of text until I hit the next title which always ends with a :$

    Read the article

  • erlide, which eclipse/which packages?

    - by KevinDTimm
    I have downloaded eclipse 3.4 (java version) for MacOSX (carbon). I have tried to 'update' to the erlide, but see many (duplicated) options (many erlide, options that say 'only for erl SDK updates', etc.) Sometimes I get 403 errors when attempting to access http://erlide.org/update and http://erlide.sourceforge.net/update. Finally, when I get some set of options installed, I either get errors like : Loading of /Users/kevindtimm/Documents/eclipse-java-ganymede-SR2-macosx-carbon/eclipse/plugins/org.erlide.kernel.common_0.8.1.201005250801/ebin/erlide_kernel_common.beam failed: badfile (hello_world@ktmac)1> =ERROR REPORT==== 24-Nov-2010::19:17:32 === beam/beam_load.c(1768): Error loading function erlide_kernel_common:monitor/0: op put_string u u x: please re-compile this module with an R14B compiler or, when I've done different installations of erlide, I get no response in the console to : hello:hello(). Does anybody have a good reference for how to load this plug-in and which items I should install? -module(hello). -export([hello/0]). hello() -> io:write("Hello World\n"). [edit] I have installed eclipse 3.6 (c++) as requested below, and the following code still can't find hello:hello(). %%file_comment -module(hello). %% %% Include files %% %% %% Exported Functions %% -export([hello/0]). %% %% API Functions %% %% %% Local Functions %% hello() -> io:write("Hello World\n"). [/edit]

    Read the article

  • Optical multicast

    - by Randomblue
    I have a 10G XPF+ optical cable with market updates from a stock exchange. This cable goes into a switch, which then multicasts every packet to a couple of computers. The problem with using a switch for multicast is that there is latency overhead, even with a pass-through switch (~200ns). Are there "optical" solutions (I'm thinking of a beam splitter of some sort) which would allow for close to zero latency 10G multicast?

    Read the article

  • ArchBeat Link-o-Rama Top 10 for November 4-10, 2012

    - by Bob Rhubart
    The Top 10 most popular items shared via the OTN ArchBeat Facebook Page for the week of November 4-10, 2012. OAM/OVD JVM Tuning | @FusionSecExpert Vinay from the Oracle Fusion Middleware Architecture Group (the very prolific A-Team) shares a process for analyzing and improving performance in Oracle Virtual Directory and Oracle Access Manager. Exploring Lambda Expressions for the Java Language and the JVM | Java Magazine In the latest //Java/Architect column in Java Magazine, Ben Evans, Martijn Verburg, and Trisha Gee explain how, "although Lambda expressions might seem unfamiliar to begin with, they're quite easy to pick up, and mastering them will be vital for writing applications that can take full advantage of modern multicore CPUs." SOA Galore: New Books for Technical Eyes Only Shake up up your technical skills with this trio of new technical books from community members covering SOA and BPM. Oracle Solaris 11.1 update focuses on database integration, cloud | Mark Fontecchio TechTarget editor Mark Fontecchio reports on the recent Oracle Solaris 11.1 release, with comments from IDC's Al Gillen. Solving Big Problems in Our 21st Century Information Society | Irving Wladawsky-Berger "I believe that the kind of extensive collaboration between the private sector, academia and government represented by the Internet revolution will be the way we will generally tackle big problems in the 21st century. Just as with the Internet, governments have a major role to play as the catalyst for many of the big projects that the private sector will then take forward and exploit. The need for high bandwidth, robust national broadband infrastructures is but one such example." — Irving Wladawsky-Berger ADF Mobile Custom Javasciprt – iFrame Injection | John Brunswick The ADF Mobile Framework provides a range of out of the box components to add within your AMX pages, according to John Brunswick. But what happens when "an out of the box component does not directly fulfill your development need? What options are available to extend your application interface?" John has an answer. Architects Matter: Making sense of the people who make sense of enterprise IT Why do architects matter? Oracle Enterprise Architect Eric Stephens suggests that you ask yourself this question the next time you take the elevator to the Oracle offices on the 45th floor of the Willis Tower in Chicago, Illinois (or any other skyscraper, for that matter). If you had to take the stairs to get to those offices, who would you blame? "You get the picture," he says. "Architecture is essential for any necessarily complex structure, be it a building or an enterprise." (Read the article...) Converting SSL certificate generated by a 3rd party to an Oracle Wallet | Paulo Albuquerque Oracle Fusion Middleware A-Team member Paulo Albuquerque shares "a workaround to get your private key, certificate and CA trusted certificates chain into Oracle Wallet." How Data and BPM are married to get the right information to the right people at the right time | Leon Smiers "Business Process Management…supports a large group of stakeholders within an organization, all with different needs," says Oracle ACE Leon Smiers. "End-to-end processes typically run across departments, stakeholders and applications, and can often have a long life-span. So how do organizations provide all stakeholders with the information they need?" Leon provides answers in this post. Updated Business Activity Monitoring (BAM) Class | Gary Barg Oracle SOA Team blogger Gary Barg has news for those interested in a skills upgrade. This updated Oracle University course "explains how to use Oracle BAM to monitor enterprise business activities across an enterprise in real time. You can measure your key performance indicators (KPIs), determine whether you are meeting service-level agreements (SLAs), and take corrective action in real time." Thought for the Day "For every complex problem, there is a solution that is simple, neat, and wrong." — H. L. Mencken (September 12, 1880 – January 29, 1956) Source: SoftwareQuotes.com

    Read the article

  • Rotate Body From Corner

    - by Siddharth
    I want to ask that how to rotate body from corner? movableBeam.getBeamBody().setTransform(movableBeam.getBeamBody().getPosition(), angle); The above line of code rotate the beam from center that I want rotate from one of the conner. Any member please help me. EDIT : float beamCenterX = movableBeam.getX() + movableBeam.getWidth() / 2f; float beamCenterY = movableBeam.getY() + movableBeam.getHeight() / 2f; float cornerOffsetX = movableBeam.getX() - beamCenterX; float cornerOffsetY = movableBeam.getY() - beamCenterY; float bodyAngle = (float) Math.atan2(cornerOffsetY, cornerOffsetX); float newAngle = imageAngle + bodyAngle; float newCornerOffsetX = (float) Math.cos(Math .toDegrees(newAngle)); float newCornerOffsetY = (float) Math.sin(Math .toDegrees(newAngle)); cornerOffsetX = movableBeam.getX() - movableBeam.getWidth() / 2f; cornerOffsetY = movableBeam.getY() - movableBeam.getHeight() / 2f; Vector2 postion = new Vector2( (newCornerOffsetX - cornerOffsetX + movableBeam.getX()) / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT, (newCornerOffsetY - cornerOffsetY + movableBeam.getY()) / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT); movableBeam.getBeamBody().setTransform(postion, newAngle);

    Read the article

  • Top Oracle Validated Integration Partner Headlines - 28 Oct

    - by Roxana Babiciu
    Five9’s Cloud Contact Center Software Achieves Oracle Validated Integration with Oracle Service Cloud. Read more. eSkill Corporation Achieves Oracle Validated Integration with Oracle Taleo Business Edition Cloud Service. Read more. BEAM Compare Achieves Oracle Validated Integration with Oracle’s PeopleSoft 9.2. Read more. Enterprise Imaging Platform from Canon Information and Imaging Solutions, Inc. Achieves Oracle Validated Integration with Oracle's JD Edwards EnterpriseOne. Read more.

    Read the article

  • How to Draw texture between 2 Vector3

    - by Sparky41
    My scenario: RTS combat style, 1 unit fires beam on another unit My problem is i want to draw a flat texture between 2 Vector3 points. I have looked at various Billboarding styles but that doesn't give me a proper solution. I looked at this: http://msdn.microsoft.com/en-us/library/bb464051.aspx is BasicEffect and DrawPrimitives the correct solution just stretch the texture to the distance between point of origin to target? I used the quad class they used but i found this it seemed to inflexible So my question to you is how would i go about this sort of problem? Regards

    Read the article

  • Collision Error

    - by Manji
    I am having trouble with collision detection part of the game. I am using touch events to fire the gun as you will see in the video. Note, the android icon is a temporary graphic for the bullets When ever the user touches (represented by clicks in the video)the bullet appears and kills random sprites. As you can see it never touches the sprites it kills or kill the sprites it does touch. My Question is How do I fix it, so that the sprite dies when the bullet hits it? Collision Code snippet: //Handles Collision private void CheckCollisions(){ synchronized(mSurfaceHolder){ for (int i = sprites.size() - 1; i >= 0; i--){ Sprite sprite = sprites.get(i); if(sprite.isCollision(bullet)){ sprites.remove(sprite); mScore++; if(sprites.size() == 0){ mLevel = mLevel +1; currentLevel++; initLevel(); } break; } } } } Sprite Class Code Snippet: //bounding box left<right and top>bottom int left ; int right ; int top ; int bottom ; public boolean isCollision(Beam other) { // TODO Auto-generated method stub if(this.left>other.right || other.left<other.right)return false; if(this.bottom>other.top || other.bottom<other.top)return false; return true; } EDIT 1: Sprite Class: public class Sprite { // direction = 0 up, 1 left, 2 down, 3 right, // animation = 3 back, 1 left, 0 front, 2 right int[] DIRECTION_TO_ANIMATION_MAP = { 3, 1, 0, 2 }; private static final int BMP_ROWS = 4; private static final int BMP_COLUMNS = 3; private static final int MAX_SPEED = 5; private HitmanView gameView; private Bitmap bmp; private int x; private int y; private int xSpeed; private int ySpeed; private int currentFrame = 0; private int width; private int height; //bounding box left<right and top>bottom int left ; int right ; int top ; int bottom ; public Sprite(HitmanView gameView, Bitmap bmp) { this.width = bmp.getWidth() / BMP_COLUMNS; this.height = bmp.getHeight() / BMP_ROWS; this.gameView = gameView; this.bmp = bmp; Random rnd = new Random(); x = rnd.nextInt(gameView.getWidth() - width); y = rnd.nextInt(gameView.getHeight() - height); xSpeed = rnd.nextInt(MAX_SPEED * 2) - MAX_SPEED; ySpeed = rnd.nextInt(MAX_SPEED * 2) - MAX_SPEED; } private void update() { if (x >= gameView.getWidth() - width - xSpeed || x + xSpeed <= 0) { xSpeed = -xSpeed; } x = x + xSpeed; if (y >= gameView.getHeight() - height - ySpeed || y + ySpeed <= 0) { ySpeed = -ySpeed; } y = y + ySpeed; currentFrame = ++currentFrame % BMP_COLUMNS; } public void onDraw(Canvas canvas) { update(); int srcX = currentFrame * width; int srcY = getAnimationRow() * height; Rect src = new Rect(srcX, srcY, srcX + width, srcY + height); Rect dst = new Rect(x, y, x + width, y + height); canvas.drawBitmap(bmp, src, dst, null); } private int getAnimationRow() { double dirDouble = (Math.atan2(xSpeed, ySpeed) / (Math.PI / 2) + 2); int direction = (int) Math.round(dirDouble) % BMP_ROWS; return DIRECTION_TO_ANIMATION_MAP[direction]; } public boolean isCollision(float x2, float y2){ return x2 > x && x2 < x + width && y2 > y && y2 < y + height; } public boolean isCollision(Beam other) { // TODO Auto-generated method stub if(this.left>other.right || other.left<other.right)return false; if(this.bottom>other.top || other.bottom<other.top)return false; return true; } } Bullet Class: public class Bullet { int mX; int mY; private Bitmap mBitmap; //bounding box left<right and top>bottom int left ; int right ; int top ; int bottom ; public Bullet (Bitmap mBitmap){ this.mBitmap = mBitmap; } public void draw(Canvas canvas, int mX, int mY) { this.mX = mX; this.mY = mY; canvas.drawBitmap(mBitmap, mX, mY, null); } }

    Read the article

  • Lightning whip particle effects

    - by Fibericon
    I'm currently using Mercury Particle Engine for the particle effects in my game, and I'm trying to create a sort of lightning whip - basically a lightning effect bound to a line that curves when the player moves. I know how to use the editor, and I have particle effects working in game. However, I'm completely lost as to where I should start for this specific particle effect. Perhaps if I could find the code for it in a different particle engine, I could convert it, but I can't seem to find that either. What I did find was a lot of tutorials for creating the lines associated with lightning programmatically, which doesn't help in this case because I don't want it to be rigid. Perhaps it would be more like some sort of laser beam with crackling effects around it? I'm running into a wall as far as even beginning to implement this goes.

    Read the article

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