Search Results

Search found 507 results on 21 pages for 'jay stevens'.

Page 16/21 | < Previous Page | 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • C++: Reference and Pointer question (example regarding OpenGL)

    - by Jay
    I would like to load textures, and then have them be used by multiple objects. Would this work? class Sprite { GLuint* mTextures; // do I need this to also be a reference? Sprite( GLuint* textures ) // do I need this to also be a reference? { mTextures = textures; } void Draw( textureNumber ) { glBindTexture( GL_TEXTURE_2D, mTextures[ textureNumber ] ); // drawing code } }; // normally these variables would be inputed, but I did this for simplicity. const int NUMBER_OF_TEXTURES = 40; const int WHICH_TEXTURE = 10; void main() { std::vector<GLuint> the_textures; the_textures.resize( NUMBER_OF_TEXTURES ); glGenTextures( NUMBER_OF_TEXTURES, &the_textures[0] ); // texture loading code Sprite the_sprite( &the_textures[0] ); the_sprite.Draw( WHICH_TEXTURE ); } And is there a different way I should do this, even if it would work? Thanks.

    Read the article

  • Why should structure names have a typedef?

    - by Jay
    I have seen source codes always having a typedef for a structure and using the same everywhere instead of using the structure name as "struct sname" etc directly? What is the reason behind this? Are there any advantages in doing this?

    Read the article

  • Advice for keeping large C++ project modular?

    - by Jay
    Our team is moving into much larger projects in size, many of which use several open source projects within them. Any advice or best practices to keep libraries and dependancies relatively modular and easily upgradable when new releases for them are out? To put it another way, lets say you make a program that is a fork of an open source project. As both projects grow, what is the easiest way to maintain and share updates to the core? Advice regarding what I'm asking only please...I don't need "well you should do this instead" or "why are you"..thanks.

    Read the article

  • Ant build script executing <sql> task using java code

    - by Jay
    Any idea, why none of the debugging comments are printed once after executing the ANT build script's SQL task via java code? The java class to execute the sql in build scirpt is public class AntRunnerTest { private Project project; public void executeTask(String taskName) { try { project = new Project(); project.init(); project.setBasedir(new String(".")); ProjectHelper helper = ProjectHelper.getProjectHelper(); project.addReference("ant.projectHelper", helper); helper.parse(project, new File("build-copy.xml")); System.out.println("Before"); project.executeTarget(taskName); System.out.println("After"); } catch(Exception ex) { System.out.println(ex.getMessage()); } } public static void main(String args[]) { try { AntRunnerTest newInst = new AntRunnerTest(); newInst.executeTask("sql"); } catch(Exception e) { System.out.println(""+e); } } } I dont see the debug String "After" getting printed in the console. I noticed this issue only when i try to execute a sql task using java code. The ant script has the following simple transaction tag in it. <transaction> <![CDATA[ select now() ]]> </transaction> Any thoughts? Thanks in advance.

    Read the article

  • Could You Quickly Test a Web Page in Apples Safari 3 [Simple Pass:Fail]

    - by Jay
    I am not fortunate to have access to Apple Safari 3.0 [which has a WebKit version < 525]. Would someone kindly test a Web page for me, it will return your userAgent string and a simple pass:fail. In WebKit versions < 525.… [<= Apple Safari 3.0] it should fail and = 525.… [= Apple Safari 3.1] it should pass. I appreciate all your help, all you have to post is if the Web page, on the second line, says pass or fail, please. Kind regards! To test: http://80etc.com/test.html

    Read the article

  • Editing/Modifying a .java file programmatically? (not the .class file)

    - by Jay
    So, here is a piece of code using CodeModel that generates java code: JCodeModel cm = new JCodeModel(); JDefinedClass dc = cm._class("foo.Bar"); JMethod m = dc.method(0, int.class, "foo"); m.body()._return(JExpr.lit(5)); File f = new File("C:/target/classes"); f.mkdirs(); cm.build(f); This code generates a .java file: package foo; public class Bar { int foo() { return 5; } } However, I DO NOT want CodeModel to create a new java file for me. I do have a .java file already and would like to add a few lines of code to a method inside it. So, I would like the API to modify the java file directly/ create a modified copy of it. Is there a way to doing this?

    Read the article

  • How to design authentication in a thick client, to be fail safe?

    - by Jay
    Here's a use case: I have a desktop application (built using Eclipse RCP) which on start, pops open a dialog box with 'UserName' and 'Password' fields in it. Once the end user, inputs his UserName and Password, a server is contacted (a spring remote-servlet, with the client side being a spring httpclient: similar to the approaches here.), and authentication is performed on the server side. A few questions related to the above mentioned scenario: If said this authentication service were to go down, what would be the best way to handle further proceedings? Authentication is something that I cannot do away with. Would running the desktop client in a "limited" mode be a good idea? For instance, important features/menus/views will be disabled, rest of the application will be accessible? Should I have a back up authentication service running on a different machine, working as a backup? What are the general best-practices in this scenario? I remember reading about google gears and how it would let you edit and do stuff offline - should something like this be designed? Please let me know your design/architectural comments/suggestions. Appreciate your help.

    Read the article

  • C++: Accessing std::map keys and values

    - by Jay
    How do you access an std::vector of the keys or values of an std::map? Thanks. Edit: I would like to access the actual elements, not just copies of their contents. essentially I want a reference, not a copy. This is essentially what I am wanting to do: std::map<std::string, GLuint> textures_map; // fill map glGenTextures( textures_map.size(), &textures_map.access_values_somehow[0] );

    Read the article

  • What could cause ASP.NET's executionTimeout to not be enforced running under IIS?

    - by Jay
    I'm trying to troubleshoot a problem, but I'm unable to reproduce it locally under IIS because no matter how low I set executionTimeout, the requests never time out. I've tried setting this via the web.config (, via code (Page.Server.ScriptTimeout = 5;). I'm running with binaries that were compiled in release mode, and debug=false is set in the compilation element. FWIW, under Cassini (the standalone development webserver), everything works as expected, running out of the same directory off of the exact same assemblies/config files. Any ideas on what could be causing this?

    Read the article

  • Sending files through a webservice

    - by Jay
    Hi, I have to send some files through a webservice in C#. The files to be sent can be from different locations i.e. there is one folder having 4 files and another folder having 5 files. Assuming i have a mechanism to select which files to send. What would be the best way to send those files? Should I be sending them one by one and let the client figure out how to put them together, or zip all the files into a single file and send that zip file to the client. If there is any other way to implement this, I would be more than happy to look into that approach too. Thanks

    Read the article

  • Why doesn't TextBlock databinding call ToString() on a property whose compile-time type is an interf

    - by Jay
    This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object It turns out to have nothing to do with collaborators and is reproducible. When I bind Label.Content to a property of the DataContext that is declared as an interface type, ToString() is called on the runtime object and the label displays the result. When I bind TextBlock.Text to the same property, ToString() is never called and nothing is displayed. But, if I change the declared property to a concrete implementation of the interface, it works as expected. Is this somehow by design? If so, any idea why? To reproduce: Create a new WPF Application (.NET 3.5 SP1) Add the following classes: public interface IFoo { string foo_part1 { get; set; } string foo_part2 { get; set; } } public class Foo : IFoo { public string foo_part1 { get; set; } public string foo_part2 { get; set; } public override string ToString() { return foo_part1 + " - " + foo_part2; } } public class Bar { public IFoo foo { get { return new Foo {foo_part1 = "first", foo_part2 = "second"}; } } } Set the XAML of Window1 to: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <StackPanel> <Label Content="{Binding foo, Mode=Default}"/> <TextBlock Text="{Binding foo, Mode=Default}"/> </StackPanel> </Window> in Window1.xaml.cs: public partial class Window1 : Window { public Window1() { InitializeComponent(); DataContext = new Bar(); } } When you run this application, you'll see the text only once (at the top, in the label). If you change the type of foo property on Bar class to Foo (instead of IFoo) and run the application again, you'll see the text in both controls.

    Read the article

  • i want to convert my aspx.cs to dll

    - by jay rathod
    i have a default.aspx page: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="btn" runat="server" Text="clicke here" OnClick="btn_Click"/> <asp:TextBox ID="txt" runat="server"></asp:TextBox> <asp:Label runat="server" ID="lbl"></asp:Label> </div> </div> </form> </body> </html> and default.aspx.cs : public partial class _Default : System.Web.UI.Page { string test; protected void Page_Load(object sender, EventArgs e) { } protected void btn_Click(object sender, EventArgs e) { test = txt.Text; lbl.Text = test; } } now i want to make the dll of my default.aspx.cs file and remove it from the website and give the reference of it. so how can i do this??

    Read the article

  • Simplest LINQ in C# troubleshooting.

    - by Jay
    I'm trying to learn a bit of LINQ but I'm having compile issues right off the bat. Is there any specific reason why this won't work? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace HelloLINQ { class HelloLINQ { public static void Main() { Example1(); } public static void Example1() { var numbers = new int[] { 1, 5, 3, 7, 3, 8, 9, 3, 6, 6, 2 }; var under5 = from n in numbers select n; foreach (var n in under5) { Console.WriteLine(n); } } } } The error is: Could not find an implementation of the query pattern for source type 'int[]'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?

    Read the article

  • Stuck with a Base64 Decode (php)

    - by jay
    I started decoding a footer from a template but this is pretty much as far as I got since im a noobie @ php. Any assstance will be appreciated as I'm pretty suck. Here's the original file: $o="QAAACg07Y25xJ2RrZnR0OiVkawARYmZ1YW5/JTk7JioAEDk7KAHgCAA5DgoNAoA4d293J2BraGVmawAEJyNudFhvaGpiPCc4OQHXbmEhwCcvAbYnLid8AeUEUAY2aGlzZm5pAABidVg2NSdhaGhzcG5jYGJzAUx0KnR3aHMlBNAOBuAOOwbSBQJhcgAAaWRzbmhpWGJ/bnRzdC8gYwAAfmlmam5kWHRuY2JlZnUgLgZAJyEhJy8JEAEUWGYDAHFiLzQuJxSIe3snAY8zAY9zbgMAMi4uC0IoKCcAAENoaSBzJ3RvaHAnaGknc28IKGInYXULgCd3ZmBiDUInABAKDQ6AKBJhJ0Voc3NoaidBAiJQDOM9J1QB0FNGVVMnKioNIQKgAwAnFqJuYzolu8APeWEDcQ+CAmAOAnYZFBHTEcInYHVuY1hvvzMCshIxDgLTEpIRPA+wGZMOFNICkxyiBkEAQQaP+A8YUQaPAsED8waPZnUvMy48JxEACPMCwQWC308GpAEGYyYXDQ8NDyZgDQ0yBo8nJynDBmEAQAeXvgEZQSgWLhikCqECERtfYnN0PSdCSUMCk5vlBPEKDQBhKKN6DmAGYDBgDdIEMShkISBmLKV/8ioekQHwEnIC4wPhASAP6AMpD4EFIAShJ0EwcGJ4eHUjSwqiA8EjFWJ1JSck0R0zJMIiVGRodwfBfnVuYG8z9AOgB7EARQKpYWslOSEC8TAEPCcNgy2wWHNuamIvIF4gFkA4OYAgAYRla2hgbmlhaC8BVGV1KDknAAB0cnd3aHVzYmMnZX4nO2YnAABvdWJhOiVvc3N3PSgocHBwIAApajHwaXNob2h0c25pYH0pZBAAaGooAUQodWJ2cm51YmpiaXMACXQoJSdzbnNrYjolSgMjJ1UB6JLIR9B0czFgYDkB5U8FEwJqOygCVD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WyRsbGxsbCsrXSkmMHgwZikrMztmb3IoJGxsbGw9MDskbGxsbDwkbGw7JGxsbGwrKykkbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGxdPSRsbGxsbGxsbFskbGxsbGxsbC0kbGxsKyRsbGxsXTskbGxsbGxsbCs9JGxsO31lbHNleyRsbD0oJGxsbGxsbGxsbGwoJGxbJGxsbGxsKytdKTw8OCk7JGxsKz0kbGxsbGxsbGxsbCgkbFskbGxsbGwrK10pKzE2O2ZvcigkbGxsbD0wOyRsbGxsPCRsbDskbGxsbGxsbGxbJGxsbGxsbGwrJGxsbGwrK109JGxsbGxsbGxsbGwoJGxbJGxsbGxsXSkpOyRsbGxsbCsrOyRsbGxsbGxsKz0kbGw7fX1lbHNlJGxsbGxsbGxsWyRsbGxsbGxsKytdPSRsbGxsbGxsbGxsKCRsWyRsbGxsbCsrXSk7JGxsbGxsbDw8PTE7JGxsbGxsbGxsbC0tO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkd4c2JEMG5ZMmh5SnpzPSIpKTskbGxsbGw9MDtldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkQwaVB5SXVKR3hzYkd4c2JHeHNiR3hzYkNnMk1pazciKSk7JGxsbGxsbGxsbGw9IiI7Zm9yKDskbGxsbGw8JGxsbGxsbGw7KXskbGxsbGxsbGxsbC49JGxsbGxsbGxsbGxsbCgkbGxsbGxsbGxbJGxsbGxsKytdXjB4MDcpO31ldmFsKCRsbGxsbGxsbGxsbCgiSkd4c2JHeHNiR3hzYkM0OUpHeHNiR3hzYkd4c2JHd3VKR3hzYkd4c2JHeHNiR3hzYkNnMk1Da3VJajhpT3c9PSIpKTtldmFsKCRsbGxsbGxsbGwpOw==")) Here's what I got it down to: $lllllllllll='base64_decode'; $llllllllll='ord'; $lllllllllllll='strlen'; $llllllllllll='chr'; $lllllllll="?".$llllllllllll(62); $lllllllll.=$llllllllll.$llllllllllll(60)."?"; $lll=0;$code=(base64_decode("JGxsbGxsbGxsbGxsPSdiYXNlNjRfZGVjb2RlJzs="));echo $code;eval(base64_decode("JGxsbGxsbGxsbGxsPSdiYXNlNjRfZGVjb2RlJzs="));$ll=0;$code=($lllllllllll("JGxsbGxsbGxsbGw9J29yZCc7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGw9J29yZCc7"));$llll=0;$lllll=3;$code=($lllllllllll("JGw9JGxsbGxsbGxsbGxsKCRvKTs="));echo $code;eval($lllllllllll("JGw9JGxsbGxsbGxsbGxsKCRvKTs="));$lllllll=0;$llllll=($llllllllll($l[1])<<8)+$llllllllll($l[2]);$code=($lllllllllll("JGxsbGxsbGxsbGxsbGw9J3N0cmxlbic7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGxsbGw9J3N0cmxlbic7"));$lllllllll=16;$llllllll="";for(;$lllll<$lllllllllllll($l);){if($lllllllll==0){$llllll=($llllllllll($l[$lllll++])<<8);$llllll+=$llllllllll($l[$lllll++]);$lllllllll=16;}if($llllll&0x8000){$lll=($llllllllll($l[$lllll++])<<4);$lll+=($llllllllll($l[$lllll])>>4);if($lll){$ll=($llllllllll($l[$lllll++])&0x0f)+3;for($llll=0;$llll<$ll;$llll++)$llllllll[$lllllll+$llll]=$llllllll[$lllllll-$lll+$llll];$lllllll+=$ll;}else{$ll=($llllllllll($l[$lllll++])<<8);$ll+=$llllllllll($l[$lllll++])+16;for($llll=0;$llll<$ll;$llllllll[$lllllll+$llll++]=$llllllllll($l[$lllll]));$lllll++;$lllllll+=$ll;}}else$llllllll[$lllllll++]=$llllllllll($l[$lllll++]);$llllll<<=1;$lllllllll--;}$code=($lllllllllll("JGxsbGxsbGxsbGxsbD0nY2hyJzs="));echo $code;eval($lllllllllll("JGxsbGxsbGxsbGxsbD0nY2hyJzs="));$lllll=0;$code=($lllllllllll("JGxsbGxsbGxsbD0iPyIuJGxsbGxsbGxsbGxsbCg2Mik7"));echo $code;eval($lllllllllll("JGxsbGxsbGxsbD0iPyIuJGxsbGxsbGxsbGxsbCg2Mik7"));$llllllllll="";for(;$lllll<$lllllll;){$llllllllll.=$llllllllllll($llllllll[$lllll++]^0x07);}$code=($lllllllllll("JGxsbGxsbGxsbC49JGxsbGxsbGxsbGwuJGxsbGxsbGxsbGxsbCg2MCkuIj8iOw=="));echo $code;eval($lllllllllll("JGxsbGxsbGxsbC49JGxsbGxsbGxsbGwuJGxsbGxsbGxsbGxsbCg2MCkuIj8iOw=="));$code=($lllllllll);echo $code;eval($lllllllll);

    Read the article

  • How to clip and fill a canvas using an alpha mask

    - by Jay Koutavas
    I have some .png icons that are alpha masks. I need to render them as an drawable image using the Android SDK. On the iPhone, I use the following to get this result, converting the "image" alpha mask to the 'imageMasked' image using black as a fill: CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate(NULL, thumbWidth, thumbHeight, 8, 4*thumbWidth, colorSpace, kCGImageAlphaPremultipliedFirst); CGRect frame = CGRectMake(0,0,thumbWidth,thumbHeight); CGContextClipToMask(context, frame, [image CGImage]); CGContextFillRect(context, frame); CGImageRef imageMasked = CGBitmapContextCreateImage(context); CGContextRelease(context); How do I accomplish the above in Android SDK? I've started to write the following: Drawable image = myPngImage; final int width = image.getMinimumWidth(); final int height = image.getMinimumHeight(); Bitmap imageMasked = Bitmap.createBitmap(width, height, Config.ARGB_8888); Canvas canvas = new Canvas(iconMasked); image.draw(canvas); ??? I'm not finding how to do the clipping on imageMasked using image.

    Read the article

  • Creating subtree from tree which is represented in xml - python

    - by Jay
    Hi I have an XML (in the form of tree), I require to create sub-tree out of it. For ex: <a> <b> <c>Hello</c> <d> <e>Hi</e> </a> Subtree would be <root> <a> <b> <c>Hello</c> </b> </a> <a> <d> <e>Hi</e> </d> </a> </root> What is the best XML library in python to do it? Any algorithm that already does this would also be helpful. Note: the XML doc won't be that big, it will easily fit in memory.

    Read the article

  • Getting moved out of a development job

    - by Jay
    I'm a year out of college and I started my first dev job at a small (<15 people) company several months ago. It was an internship position that recently turned full time. The position started out as development but for full time I got offered a grab bag of positions: qa, docs, call support and some dev work. It's clear that my employers feel I am lacking dev skills, which is true. I did not major in CS in college and did not have much dev experience. However, I'm convinced that I can be a good developer and I will be a good developer once given the chance to write lots of code. My question is simple: what should I do? As I see it, there are two options. Work hard in the non-dev duties so that my employers may eventually give me significant dev responsibilities. Look for a new job where I will be a developer first and an all purpose guy second (if at all). Thanks guys.

    Read the article

  • Creating subdomain in URL alaising

    - by Jay
    I am creating a social networking site and one of the requirements is to have the subdomain like URL for each user. For example, for the user1 his profile page will be user1.mysitename.com and for the user2 profile page will be user2.mysitename.com. Can it be done using url aliasing? basically user1.mysitename.com should be www.mysitename.com/profile.aspx?username=user1 I will be hosting this in windows 2003 (IIS6), any help is highly appreciated.

    Read the article

  • How to pause the timer in c#?

    - by Jay
    I have a timer in my code and the interval is 10s When the timer elapsed, I will do some checking, and it may takes more than 10s for checking and some update jobs. However, if I didn't stop the timer, seems the checking will execute every 10s ... If I call the stop(), seems the timer cannot be start again ... ie something like: protected void timer_elapsed(object sender, EventArgs args) { __timer.Stop(); //Some checking here more than 10s __timer.Start(); } I just want another 10s to check again after the before checking is done. anyone can help?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21  | Next Page >