Search Results

Search found 1862 results on 75 pages for 'matt varblow'.

Page 57/75 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • How do I output an individual character when using char *[] = "something"

    - by Matt
    I've been playing with pointers to better understand them and I came across something I think I should be able to do, but can't sort out how. The code below works fine - I can output "a", "dog", "socks", and "pants" - but what if I wanted to just output the 'o' from "socks"? How would I do that? char *mars[4] = { "a", "dog", "sock", "pants" }; for ( int counter = 0; counter < 4; counter++ ) { cout << mars[ counter ]; } Please forgive me if the question is answered somewhere - there are 30+ pages of C++ pointer related question, and I spent about 90 minutes looking through them, as well as reading various (very informative) articles, before deciding to ask.

    Read the article

  • Can any language potentially be used to create any program?

    - by Matt
    I've heard that given a programmer with enough time and skill in any particular language and enough lines of code, then any program could be created with any given language. I know its certainly not going to be cost-efficient, for instance, to rewrite Adobe Photoshop in BASIC, but could a good enough and patient enough programmer potentially create any program in any language?

    Read the article

  • In SQL can I return a tables with a varying number of columns

    - by Matt
    I have a somewhat more complicated scenario, but I think it should be possible. I have a large SPROC whose result is a set of characteristics for a set of persons. So the Table would look something like this: Property | Client1 Client 2 Client3 ----------------------------------------------------------- Sex | M F M Age | 67 56 67 Income | Low Mid Low It's built using cursors, iterating over different datasets. The problem I am facing is that there is a varying number of Clients and Properties, so an equally valid result over different input sets might be: Property | Client1 Client 2 ------------------------------------------- Sex | M F Age | 67 56 Weight | 122 122 The different number of properties is easy, those are just extra rows. My problem is that I need to declare a temporary table with a varying number of columns. There could be 2 clients or 100. Every client in guaranteed to have every property ultimately listed. What SQL structure would statisfy this and how can I declare it and insert things into it? I can't just flip the columns and rows either because there is a variable number of each.

    Read the article

  • Clever Next and Previous Buttons in jQuery

    - by matt
    I have created a webpage which when you press 'down' automatically scrolls down to the next ID (a section which isn't visible due to overflow: hidden) When you press 'up' it scrolls back up. At the moment each arrow simply tells the webpage to go to a specific div e.g. the 'down arrow' says <a class="tab" href="#page2">Down</a> This is ok for just two pages however as I will be having more pages what I would like is to be able to specify the amount of pages and for the arrows to automatically change which link it needs to go to next. For example, on page 1 the 'up arrow' is not visible and when you press the 'down arrow' it scrolls to #page2 whereupon the 'up arrow' is then visible. If you now press the down arrow again it will take you to #page3 whereupon it then becomes hidden as page 3 is the last page. I'm guessing I need to create a 'var' which specifies the amount of pages and that to make the arrows invisible it will change the css property 'display' to none yet I don't know how to do this nor to make the links work out which number to go to next! edit: Just botched together some code which hides the arrows based on the page number however still need to work out how to update the variables and change the links the arrows go to. (please exclude the coding, it's my first time trying to write script as opposed to just editing plugins!) var PageNumber = 1; var PageAmount = 2; function getPageNumber() { } function hideUpArrow() { if(PageNumber==1) { $("#up_arrow").css({ "display": "none" }); } } function hideDownArrow() { if(PageNumber==PageAmount) { $("#down_arrow").css({ "display": "none" }); } } $(document).ready(function(){ hideUpArrow(); });

    Read the article

  • Designing a Chart that expands as more data is entered in Excel

    - by Matt Ridge
    I have a worksheet that pulls data from another, it is designed to only show late jobs, and it works perfectly. I have it where it is broken down into quarters, and it gathers all this data and does everything I want. Except this one last bit... I want to have it where it shows charts, if there is data in said area the chart would self populate, otherwise it would be blank. If more data is entered into the range expand the chart accordingly. Attached is a simplified workbook with what it does, and what I'd like to see it do. I don't even know if this is possible... I thought if I wrote a script to make it so that the data changes with each addition it may fix my problem, but I'm not sure if that is the best way in this situation. https://dl.dropbox.com/u/3327208/Excel/Charts.xlsx

    Read the article

  • Why use object.prototype.constructor in OOP javascript?

    - by Matt
    I've recently started reading up on OOP javascript and one thing that authors seem to skip over is when an object A has been declared and suddenly I see "A.prototype.constructor =A; For example, var A = function(){}; // This is the constructor of "A" A.prototype.constructor = A; A.prototype.value = 1; A.prototype.test = function() { alert(this.value); } var a = new A(); // create an instance of A alert(a.value); // => 1 So I run the command in firebug "var A = function(){};" and then "A.Constructor" Which reveals it's a function. I understand this. I run the code "A.prototype.constructor = A;" and I thought this changes the A constructor from Function to A. The constructor property of A has been changed right? Instead when I run "A.constructor" it gives me function () still. What's the point? I also see A.constructor.prototype.constructor.prototype.. what is going on?

    Read the article

  • How to create a glib.Source from Python?

    - by Matt Joiner
    I want to integrate some asyncore.dispatcher instances into GLib's default main context. I figure I can create a custom GSource that's able to detect event readiness on the various sockets in asyncore.socket_map. From C I believe this is done by creating the necessary GSourceFuncs which could involve cheap and non-blocking calls to select, and then handling them using asyncore.read, .write and friends. How do I actually create a GSource from Python? The class glib.Source is undocumented, and attempts to use the class interactively have been in vain. Is there some other method that allows me to handled socket events in the asyncore module without resorting to timeouts (or anything that endangers potential throughput and CPU usage)?

    Read the article

  • Does the java JFC hash table use seperate chaining resolution? Can I traverse each list in the table

    - by Matt
    I have written a program to store a bunch of strings in a JFC hash table. There are defiantly collisions going on, but I don't really know how it is handling them. My ultimate goal is to print the number of occurrences of each string in the table, and traversing the bucket or list would work nicely. Or maybe counting the collisions? Or do you have another idea of how I could get a count of the elements?

    Read the article

  • WinForm-style Invoke() in unmanaged C++

    - by Matt Green
    I've been playing with a DataBus-type design for a hobby project, and I ran into an issue. Back-end components need to notify the UI that something has happened. My implementation of the bus delivers the messages synchronously with respect to the sender. In other words, when you call Send(), the method blocks until all the handlers have called. (This allows callers to use stack memory management for event objects.) However, consider the case where an event handler updates the GUI in response to an event. If the handler is called, and the message sender lives on another thread, then the handler cannot update the GUI due to Win32's GUI elements having thread affinity. More dynamic platforms such as .NET allow you to handle this by calling a special Invoke() method to move the method call (and the arguments) to the UI thread. I'm guessing they use the .NET parking window or the like for these sorts of things. A morbid curiosity was born: can we do this in C++, even if we limit the scope of the problem? Can we make it nicer than existing solutions? I know Qt does something similar with the moveToThread() function. By nicer, I'll mention that I'm specifically trying to avoid code of the following form: if(! this->IsUIThread()) { Invoke(MainWindowPresenter::OnTracksAdded, e); return; } being at the top of every UI method. This dance was common in WinForms when dealing with this issue. I think this sort of concern should be isolated from the domain-specific code and a wrapper object made to deal with it. My implementation consists of: DeferredFunction - functor that stores the target method in a FastDelegate, and deep copies the single event argument. This is the object that is sent across thread boundaries. UIEventHandler - responsible for dispatching a single event from the bus. When the Execute() method is called, it checks the thread ID. If it does not match the UI thread ID (set at construction time), a DeferredFunction is allocated on the heap with the instance, method, and event argument. A pointer to it is sent to the UI thread via PostThreadMessage(). Finally, a hook function for the thread's message pump is used to call the DeferredFunction and de-allocate it. Alternatively, I can use a message loop filter, since my UI framework (WTL) supports them. Ultimately, is this a good idea? The whole message hooking thing makes me leery. The intent is certainly noble, but are there are any pitfalls I should know about? Or is there an easier way to do this?

    Read the article

  • How to make RegexKitLite w/ iPhone SDK produce a list of all matches +/- and also return surrounding

    - by Matt
    I'd like to create a regular expression that will match and return based on the following criteria: 1) I have N search terms entered by a user 2) I have a body of text. 3) I want to return a list of all the occurrences of all the search terms entered by the user plus surrounding context. I think (\w+\W+){,4}(", ")(\W+\w+){,4} might work. 4) I don't know how to use RegexKitLite at all. Do I invoke a RegexKitLite class? or does it interface into NSString somehow?

    Read the article

  • Minutia on Objective-C Categories and Extensions.

    - by Matt Wilding
    I learned something new while trying to figure out why my readwrite property declared in a private Category wasn't generating a setter. It was because my Category was named: // .m @interface MyClass (private) @property (readwrite, copy) NSArray* myProperty; @end Changing it to: // .m @interface MyClass () @property (readwrite, copy) NSArray* myProperty; @end and my setter is synthesized. I now know that Class Extension is not just another name for an anonymous Category. Leaving a Category unnamed causes it to morph into a different beast: one that now gives compile-time method implementation enforcement and allows you to add ivars. I now understand the general philosophies underlying each of these: Categories are generally used to add methods to any class at runtime, and Class Extensions are generally used to enforce private API implementation and add ivars. I accept this. But there are trifles that confuse me. First, at a hight level: Why differentiate like this? These concepts seem like similar ideas that can't decide if they are the same, or different concepts. If they are the same, I would expect the exact same things to be possible using a Category with no name as is with a named Category (which they are not). If they are different, (which they are) I would expect a greater syntactical disparity between the two. It seems odd to say, "Oh, by the way, to implement a Class Extension, just write a Category, but leave out the name. It magically changes." Second, on the topic of compile time enforcement: If you can't add properties in a named Category, why does doing so convince the compiler that you did just that? To clarify, I'll illustrate with my example. I can declare a readonly property in the header file: // .h @interface MyClass : NSObject @property (readonly, copy) NSString* myString; @end Now, I want to head over to the implementation file and give myself private readwrite access to the property. If I do it correctly: // .m @interface MyClass () @property (readonly, copy) NSString* myString; @end I get a warning when I don't synthesize, and when I do, I can set the property and everything is peachy. But, frustratingly, if I happen to be slightly misguided about the difference between Category and Class Extension and I try: // .m @interface MyClass (private) @property (readonly, copy) NSString* myString; @end The compiler is completely pacified into thinking that the property is readwrite. I get no warning, and not even the nice compile error "Object cannot be set - either readonly property or no setter found" upon setting myString that I would had I not declared the readwrite property in the Category. I just get the "Does not respond to selector" exception at runtime. If adding ivars and properties is not supported by (named) Categories, is it too much to ask that the compiler play by the same rules? Am I missing some grand design philosophy?

    Read the article

  • Format Text Field While User Enters Data

    - by Matt
    Hello, so here is what I am trying to do. I have a birth date text field, while the user in puts text i want the field to automatically put it in the form YYYY-MM-DD. Basically while the user types it replaces the Y's M's and D's but leaves the hyphen. I am not sure how to go about this i may need a mask or something. I know this is where some of the formatting can be done - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ Any help would be of much help

    Read the article

  • Retrieving ids from MySQL query

    - by Matt Maclennan
    I am having trouble accessing the "model_id" and "brand_id" from the foreach loop that I am using. They are the right field names, because I have echoed them successfully, and I have also "var_dumped" the array, and the IDs are there. It is just a case of implementing the relevant links on each list section. Below is the code I have. <? $output = mysqli_query("SELECT * FROM bikes, bikeTypes WHERE bikes.model_id = bikeTypes.model_id"); $result = array(); while($row = mysqli_fetch_array($output)) { $result[$row['model']][] = $row; } foreach ($result as $category => $values) { echo "<li><a href='test.php?id=" . $row['model_id'] . "'>".$category.'</a><ul>'; foreach ($values as $value) { echo "<li><a href='details.php?id=" . $row['brand_id'] . "'>" . $value['bikeName'] . "</a></li>"; } echo '</ul>'; echo '</li>'; } ?>

    Read the article

  • JQuery Toggle which disables other links

    - by Matt Jameson
    Is there a way of disabling another link, the re-enabling them with the toggle function. here is my script so far. I would like to disable 'military' when I've clicked on 'Entertainment', but then re enable the link when the toggle returns. $("[href='#Entertainment']").click(function () { $("#Entertainment").toggle("slow"); }); $("[href='#Military']").click(function () { $("#Military").toggle("slow"); }); Is there anyway of doing this?

    Read the article

  • Print stacktrace from C code with embedded lua

    - by Matt H
    If I understand this correctly, Lua by default will call the debug library "debug.traceback" when an error occurs. However, when embedding Lua into C code like done in the example here: Simple Lua API Example We only have available the error message on the top of the stack. i.e. if (status) { /* If something went wrong, error message is at the top of */ /* the stack */ fprintf(stderr, "Couldn't load file: %s\n", lua_tostring(L, -1)); /* I want to print a stacktrace here. How do I do that? */ exit(1); } How do I print the stack trace from C after the initial error?

    Read the article

  • Build Path issue with Java Android project when starting Eclipse

    - by Matt Smith
    I booted up eclipse to start on a project, and without typing in a word I already have several errors. package department.namespace; import android.app.Activity; import android.os.Bundle; public class DepartmentActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } At package department.namespace, it says: multiple marks at this line and the type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files The import android.os cannot be resolved. Override cannot be resolved as a type The method OnCreate(Bundle) is undefined for the type Activity R. cannot be resolved as a variable. Since this JUST came up when I started Eclipse, how do I fix this?

    Read the article

  • IPhone: different system timers??

    - by matt
    I have been using mach_absolute_time() for all my timing functions so far. calculating how long between frames ect. I now want to get the exact time touch input events happen using event.timestamp in the touch callbacks. the problem is these two seem to use completely different timers. sure, you can get them both in seconds, but their origins are different and seemingly random... is there any way to sync the two different timers? or is there anyway to get access to the same timer that the touch input uses to generate that timestamp property? otherwise its next to useless.

    Read the article

  • Java Class<T> static method forName() IncompatibleClassChangeError

    - by matt
    Hi, i have this code: private static Importable getRightInstance(String s) throws Exception { Class<? extends Importable> c = Class.forName(s).asSubclass(Importable.class); Importable i = c.newInstance(); return i; } which i can also write private static Importable getRightInstance(String s) throws Exception { Class<? extends Importable> c = (Class<? extends Importable>)Class.forName(s); Importable i = c.newInstance(); return i; } or private static Importable getRightInstance(String s) throws Exception { Class<?> c = Class.forName(s); Importable i = (Importable)c.newInstance(); return i; } where Importable is an interface and s is a string representing an implementing class. Well, in any case it gives the following: Exception in thread "main" java.lang.IncompatibleClassChangeError: class C1 has interface Importable as super class Here is the last snippet of the stack trace: at java.lang.Class.forName(Class.java:169) at Importer.getRightImportable(Importer.java:33) at Importer.importAll(Importer.java:44) at Test.main(Test.java:16) Now, class C1 actually implemens Importable and i totally don't understand why it complaints. Thanks in advance.

    Read the article

  • How is this inupt tag linking to another page?

    - by Matt
    Response.Write("<div><input type='submit' name='submit' value='Update Cart' /></div>") Response.Write("<div><input type='submit' name='submit' value='Shop More' /></div>") Response.Write("<div><input type='submit' name='submit' value='Checkout' /></div>") that is some example code from my teacher, but he hasn't answered my email in a couple days so I need some help. When you click the Update Cart button it just updates the cart page it's on, but when you click the Shop More button it links to Shop.aspx a different page, and the Checkout links to another page as well. I can't figure out how it is linking just from that code, anybody have any insights?

    Read the article

  • JQuery SimpleModal

    - by Matt
    I've got a submit button inside my modal, and when it's pressed nothing happens! How do I make my form submit when the push my submit button? I don't want to use $('form').submit(); because then php doesn't detect that my button was clicked. <script type="text/javascript" language="javascript"> $(document).ready(function () { $('#btnAdd').click(function (e) { //clicking the button shows the modal popup up e.preventDefault(); $('#AddCareerItem').modal(); }); $('#btnCancelCareerContent').click(function (e) { //close the modal with the cancel button $.modal.close(); }); }); </script>

    Read the article

  • Turn off Jquery UI Accordion animation only during page load

    - by Matt H
    I'd like to turn off the accordian animation during page load, and then turn it back on after the page is loaded. Basically I've got multiple forms inside the accordion sections and when submitted the page gets reloaded and the relevant section is reloaded. But during the reload the animation is triggered which looks a little ugly. But I like it when the page is not being loaded. How do I achieve this effect?

    Read the article

  • In C# how can I serialize a List<int> to a byte[] in order to store it in a DB field?

    - by Matt
    In C# how can I serialize a List to a byte[] in order to store it in a DB field? I know how to serialize to a file on the disk, but how do I just serialize to a variable? Here is how I serialized to the disk: List<int> l = IenumerableofInts.ToList(); Stream s = File.OpenWrite("file.bin"); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(s, lR); s.Close(); I'm sure it's much the same but I just can't wrap my head around it.

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >