Search Results

Search found 17977 results on 720 pages for 'someone smiley'.

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

  • Can someone explain this java interface to me please?

    - by Karl Patrick
    I realize that the method run must be declared because its declared in the runnable interface. But my question comes when this class runs how is the Thread object allowed if there is no import call to a particular package? how does runnable know anything about Thread or its methods? does the runnable interface extend the thread class? Obviously i dont understand interfaces very well. thanks in advance. class PrimeFinder implements Runnable{ public long target; public long prime; public boolean finished = false; public Thread runner; PrimeFinder(long inTarget){ target = inTarget; if(runner == null){ runner = new Thread(this); runner.start() } } public void run(){ } }

    Read the article

  • SRAM Cell Diagram - Can someone explain this a bit more clearly? ( From COMP1917 @ UNSW: Lecture 2 o

    - by Kristina
    I've begun watching a series of first year lectures from the University of New South Wales (UNSW) in Australia, and I'm a bit perplexed by the instructors explanation of how an SRAM gate works. I realize this isn't exactly "programming-related" but since it comes from a series of lectures relating to computing and programming, I thought StackOverflow may be able to help (reddit failed me entirely). In this lecture beginning at around 32:12, Richard (the lecturer) tries to explain how a "latch gate" works within SRAM. Although his students seem to keep up, I feel I'm missing something crucial which is preventing the concept from really "clicking" in my brain. For convenience, I've added the image from the video below: Thanks in advance for any help you can provide, but if this question doesn't fit your view of "programming-related" could you please provide an alternate forum for this in a comment when you cast your close vote? Thanks!

    Read the article

  • Can someone rid me of these turbulent T4 template editors?

    - by Will
    I'm using Tangible's editor and (no offense guys) it sucks. Its one painful step above notepad. But its (afaik) the only game in town. Does anybody have any tips/tricks on creating T4 templates in a non-painful way? For instance, I'm thinking about creating a T4 Template that essentially turns a class defined in a solution into a template generator. DTE, look for code that is marked with this or that attribute, run this or that method, and drop the results into a file. At least I'd get legit intellisense out of the deal...

    Read the article

  • Can someone explain an Enterprise Service Bus to me in non-buzzspeak?

    - by Jason Baker
    Some of our partners are telling us that our software needs to interact with an Enterprise Service Bus. After researching this a bit, my instinct is to say that this is just buzz speak for saying that we need to have a platform-indpendent way to pass messages back and forth. I'm just trying to get a feel for what our partners are telling us. Am I correct in dismissing our partners' request as just trying to get our software to be more buzzword-compliant, or are they telling us something we should listen to (even if encoded in buzzspeak)?

    Read the article

  • Could someone explain gtk2hs drag and drop to me, the listDND.hs demo just isn't doing it for me?

    - by Tom Carstens
    As the title says, I just don't get DND (or rather I understand the concept and I understand the order of callbacks, I just don't understand how to setup DND for actual usage.) I'd like to say that I've done DND stuff before in C, but considering I never really got that working... So I'm trying (and mostly succeeding, save DND) to write a text editor (using gtksourceview, because it has built in code highlighting.) Reasons are below if you want them. Anyways, there's not really a good DND demo or tutorial available for gtk2hs (listDND.hs just doesn't translate well in my head.) So what I'm asking is for code that demonstrates simple DND on a window widget (for example.) Ideally, it should accept drops from other windows (such as Thunar) and print out the information in string form. I think I can take it from there... Reasons: I'm running a fairly light weight setup, dwm and a few gtk+2 programs. I really don't want to have to pull in gtk+3 to get the current gedit from the repos (Arch Linux.) Currently, I'm using geany for all of my text editing needs, however, geany is a bit heavy for editing config files. Further, geany doesn't care for my terminal of choice (st;) so I don't even get the benefit of using it as an IDE. Meaning I'd like a lightweight text editor with syntax highlighting. I could configure emacs or vim or something, but that seems to me to be more of a hack then a proper solution. Thus my project was born. It's mostly working (aside from DND, all that's left is proper multi-tab support.) Admittedly, I could probably work this out if I wrote it in C, but there isn't that much state in a text editor so Haskell's been working fine with almost no need for mutable variables.

    Read the article

  • Can someone recommend a good tutorial on MySQL indexes, specifically when used in an order by clause

    - by Philip Brocoum
    I could try to post and explain the exact query I'm trying to run, but I'm going by the old adage of, "give a man a fish and he'll eat for a day, teach a man to fish and he'll eat for the rest of his life." SQL optimization seems to be very query-specific, and even if you could solve this one particular query for me, I'm going to have to write many more queries in the future, and I'd like to be educated on how indexes work in general. Still, here's a quick description of my current problem. I have a query that joins three tables and runs in 0.2 seconds flat. Awesome. I add an "order by" clause and it runs in 4 minutes and 30 seconds. Sucky. I denormalize one table so there is one fewer join, add indexes everywhere, and now the query runs in... 20 minutes. What the hell? Finally, I don't use a join at all, but rather a subquery with "where id in (...) order by" and now it runs in 1.5 seconds. Pretty decent. What in God's name is going on? I feel like if I actually understood what indexes were doing I could write some really good SQL. Anybody know some good tutorials? Thanks!

    Read the article

  • A web application that uses someone else's mail server?

    - by John
    I'm building a web application, call it http://mywebapp.com, where a user should be able to create a newsletter and email it to everyone in his user account's contact list. So he can check mark all his friends, select an html template, fill in the body content, and send. The only catch to this is that after the user sends the email, the recipient must NOT be allowed to trace the source of the email back to http://mywebapp.com. The reason for this condition is because the user is a "reseller" of my business who wants to appear as if he's an independent business. If liability issues arise due to the reseller's unduly usage, I do not want to be caught up in the legal issues. Hence, I do not want anything about my business or technology to be traceable back to me by newsletter recipients. What's the best way to achieve this?

    Read the article

  • Problem with C function of type char pointer, can someone explain?

    - by JJ
    Find the errors from following C function : char* f(int i) { int i; char buffer[20]; switch ( i ) { 1: strcpy( buffer, "string1"); 2: strcpy( buffer, "string2"); 3: strcpy( buffer, "string3"); default: strcpy(buffer, "defaultstring"); } return buffer; } this is c funtion not C++, I think it has to do with type conversion my compiler give warning that declaration of int i shadows a parameter.

    Read the article

  • Can someone explain this color wheel code to me?

    - by user1869438
    I just started doing java and i need some help with understanding this code. I got it from a this website. This is supposed to be code for a color wheel but i don't really understand how it works, especially the final ints STEPS and SLICES. import java.awt.Color; import objectdraw.*; public class ColorWheel extends WindowController { private double brightness; private Text text; private FilledRect swatch; private Location center; private int size; private FilledRect brightnessOverlay; private static final int SLICES = 96; private static final int STEPS = 16; public void begin() { canvas.setBackground(Color.BLACK); brightness = 1.; size = Math.min(canvas.getWidth(), canvas.getHeight() - 20); center = new Location(canvas.getWidth() / 2, size / 2); for(int j = STEPS; j >= 1; j--) { int arcSize = size * j / STEPS; int x = center.getX() - arcSize / 2; int y = center.getY() - arcSize / 2; for(int i = 0; i < SLICES; i++) { Color c = Color.getHSBColor((float)i / SLICES, (float)j / STEPS, (float)brightness); new FilledArc(x, y, arcSize, arcSize, i * 360. / SLICES, 360. / SLICES + .5, c, canvas); } } swatch = new FilledRect(0, canvas.getHeight() - 20, canvas.getWidth(), 20, Color.BLACK, canvas); brightnessOverlay = new FilledRect(0, 0, canvas.getWidth(), canvas.getHeight() - 20, new Color(0, 0, 0, 0), canvas); text = new Text("", canvas.getWidth() / 2, canvas.getHeight() - 18, canvas); text.setAlignment(Text.CENTER, Text.TOP); text.setBold(true); } public void onMouseDrag(Location point) { brightness = (canvas.getHeight() - point.getY()) / (double)(canvas.getHeight()); if(brightness < 0) { brightness = 0; } else if(brightness > 1) { brightness = 1; } if(brightness < .5) { text.setColor(Color.WHITE); } else { text.setColor(Color.BLACK); } brightnessOverlay.setColor(new Color(0f, 0f, 0f, (float)(1 - brightness))); } public void onMouseMove(Location point) { double saturation = 2 * center.distanceTo(point) / size; if(saturation > 1) { text.setText(""); swatch.setColor(Color.BLACK); return; } double hue = -Math.atan2(point.getY() - center.getY(), point.getX() - center.getX()) / (2 * Math.PI); if(hue < 0) { hue += 1; } swatch.setColor(Color.getHSBColor((float)hue, (float)saturation, (float)brightness)); text.setText("Color.getHSBColor(" + Text.formatDecimal(hue, 2) + "f, " + Text.formatDecimal(saturation, 2) + "f, " + Text.formatDecimal(brightness, 2) + "f)"); } }

    Read the article

  • Can someone help me compare using F# over C# in this specific example (IP Address expressions)?

    - by Phobis
    So, I am writing code to parse and IP Address expression and turn it into a regular expression that could be run against and IP Address string and return a boolean response. I wrote the code in C# (OO) and it was 110 lines of code. I am trying to compare the amount of code and the expressiveness of C# to F# (I am a C# programmer and a noob at F#). I don't want to post both the C# and F#, just because I don't want to clutter the post. If needed, I will do so. Anyway, I will give an example. Here is an expression: 192.168.0.250,244-248,108,51,7;127.0.0.1 I would like to take that and turn it into this regular expression: ((192.168.0.(250|244|245|246|247|248|108|51|7))|(127.0.0.1)) Here are some steps I am following: Operations: Break by ";" 192.168.0.250,244-248,108,51,7 127.0.0.1 Break by "." 192 168 0 250,244-248,108,51,7 Break by "," 250 244-248 108 51 7 Break by "-" 244 248 I came up with F# that produces the output. I am trying to forward-pipe through my operations listed above, as I think that would be more expressive. Can anyone make this code better? Teach me something :) open System let createItemArray (group:bool) (y:char) (items:string[]) = [| let indexes = items.Length - 1 let group = indexes > 0 && group if group then yield "(" for i in 0 .. indexes do yield items.[i].ToString() if i < indexes then yield y.ToString() if group then yield ")" |] let breakBy (group:bool) (x:string) (y:char): string[] = x.Split(y) |> createItemArray group y let breakItem (x:string) (y:char): string[] = breakBy false x y let breakGroup (x:string) (y:char): string[] = breakBy true x y let AddressExpression address:string = let builder = new System.Text.StringBuilder "(" breakGroup address ';' |> Array.collect (fun octet -> breakItem octet '.') |> Array.collect (fun options -> breakGroup options ',') |> Array.collect (fun (ranges : string) -> match (breakGroup ranges '-') with | x when x.Length > 3 -> match (Int32.TryParse(x.[1]), Int32.TryParse(x.[3])) with | ((true, a) ,(true, b)) -> [|a .. b|] |> Array.map (int >> string) |> createItemArray false '-' | _ -> [|ranges|] | _ -> [|ranges|] ) |> Array.iter (fun item -> match item with | ";" -> builder.Append ")|(" | "." -> builder.Append "\." | "," | "-" -> builder.Append "|" | _ -> builder.Append item |> ignore ) builder.Append(")").ToString() let address = "192.168.0.250,244-248,108,51,7;127.0.0.1" AddressExpression address

    Read the article

  • Could someone tell me if my C++ indent style is named? (example given)

    - by Maulrus
    I'm learning C++. For me, my programming style is just what looks the best; it doesn't seem to follow the rules of any one particular style. Here's an example void f(int x){ //no space between close-paren and bracket if (!x){ cout << "x is non-zero\n"; } //closing bracket indented to the same level as the original statement } It's only slightly different for something like a class or a namespace: class myClass {}; //space between class name and bracket, otherwise the same as functions K&R style does uses that kind of bracketing for statements, but my style uses it for everything. I'd like to know if there's a name for it so I can say simply what my indent style is without having to explain using examples like these.

    Read the article

  • Can someone tell me why my dataset wont save correctly to the database in simple winforms app?

    - by Mike
    I have been struggling with this all day and I know it is probably something stupid. My code is below. If I call save then exit my program and start again I can save images to my events but if I just call save when I try to add an image and call save again I get a foreign key error. From what I know I thought my save method was updating the database from my dataset so the event associated with the image should exist. Anyway here is my save method... Private Sub Save() Me.Validate() EventsBindingSource.EndEdit() ImagesBindingSource.EndEdit() TableAdapterManager.UpdateAll(EventDataSet) EventDataSet.AcceptChanges() End Sub Am I doing this wrong? Is this enough detail?

    Read the article

  • Could someone help me debug my app (not very big)?

    - by Alex
    Not sure if this kind of help is accepted to ask for here, tell me if it isn't. It has to get done before tomorrow, it's not entirerly finished but it should work somewhat ok by now. I'm trying to use the Eclipse debugger (not very used to it). I have my top-level or main class, which is Game, in which I have a constructor and a main method. In the main method I create a new "Game", initiating the constructor. public static void main(String[] args){ Game chess = new Game(); } public Game(){ Board board = new Board(); That's the first thing the debugger reacts to: Thread [main] (Suspended) ClassNotFoundException(Object).<init>() line: 20 [local variables unavailable] ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217 ClassNotFoundException(Exception).<init>(String, Throwable) line: not available ClassNotFoundException.<init>(String) line: not available URLClassLoader$1.run() line: not available AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method] Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available Launcher$ExtClassLoader.findClass(String) line: not available Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available Launcher$AppClassLoader.loadClass(String, boolean) line: not available Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available Game.<init>() line: 15 Game.main(String[]) line: 11 Line 11 is the one line in my main method, line 15 is the instantiation of "board".

    Read the article

  • Can someone help me understand why this is happening?

    - by Juan Manuel Formoso
    I just run into the weirdest thing I've ever encounter. Consider this test page: <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script language=javascript> function test(myParameter) { alert(myParameter); } </script> </head> <body> <input type="button" value="Strange" onclick="javascript: test(044024);" /> <input type="button" value="Ok" onclick="javascript: test('044024');" /> </body> </html> If I click the "strange" button, I get 18452, if I click the "ok" button I get 044024 Does anyone know what is happening and explain it to me?

    Read the article

  • Someone please can see why the following prepared statment returns nothing?

    - by jartaud
    $stmt = mysqli_prepare($link,"SELECT *FROM ads INNER JOIN dept ON dept.id_dept = ads.in_dpt INNER JOIN members ON members.idMem = ads.from_Mem INNER JOIN sub_cat_ad ON id_sub_cat = ads.ads_in_Cat INNER JOIN cat_ad ON idCat_ad = sub_cat_ad.from_cat_ad WHERE ads_in_Cat = ? "); if(isset($_GET['fromSCat'])){ $fromSCat = mysqli_real_escape_string($link,$_GET['fromSCat']);} mysqli_stmt_bind_param($stmt,'i',$fromSCat); mysqli_stmt_execute($stmt); mysqli_stmt_fetch($stmt); $tot=mysqli_stmt_num_rows($stmt); //Ouput: 0

    Read the article

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