Search Results

Search found 907 results on 37 pages for 'simon cave'.

Page 29/37 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Help with MySQL database structure - user notification system

    - by Simon
    Hi, I'd like to send global notifications to my users (1000+ users) and allow them to close the notification box once they have read the message. Basically I may send one notification per week globally ie/ each user get the same message and they are not personal in nature. What is the best way to achieve this? Create 2 tables: **tb_messages** message_id massage_title message_content **tb_read_messages** user_id message_id is-read That way i can just show each user the current notifications that are not read? select * from tb_read_messages WHERE user_id = $user_id AND is-read = no OR is there a more efficient way? Thanks!!!

    Read the article

  • How to create diagrams for papers.

    - by Simon
    I want to create some diagrams for some papers. Diagrams will contain some text, e.g. some console output. I need images for using also in html files. There is TikZ so can create images like this: http://www.texample.net/tikz/examples/boxes-with-text-and-math/ http://www.texample.net/tikz/examples/rule-based-diagram/ http://www.texample.net/tikz/examples/scenario-tree/ but as a result I get some ps/pdf files, not images. What's more I want to generate the pictures from text files as I want to track changes in some VCS, any binary files are not suitable for that.

    Read the article

  • Why does Java return a date in GMT-4.5 when choosing Co-ordinated Universal Time time zone in Window

    - by Simon Nickerson
    We have seen a strange issue on some Windows XP machines involving the "Co-ordinated Universal Time" time zone. Not all Windows XP machines seem to have it, but on those that do, the following simple Java program public class TimeTest { public static void main(String[] args) { System.out.println(java.util.TimeZone.getDefault()); System.out.println(new java.util.Date()); } } on JDK 1.6.0_06 prints: sun.util.calendar.ZoneInfo[id="America/Caracas",offset=-16200000,dstSavings=0,useDaylight=false,transitions=5,lastRule=null] Fri Nov 13 05:34:14 VET 2009 (i.e. 4 and a half hours behind GMT). I should add that I am based in London, and have never been to South America. :-) My questions are: Where does Java get this time zone from? I thought Co-ordinated Universal Time was supposed to be the new name for GMT. Why do some Windows machines have this time zone but not others?

    Read the article

  • What are the implications of using static const instead of #define?

    - by Simon Elliott
    gcc complains about this: #include <stdio.h> static const int YY = 1024; extern int main(int argc, char*argv[]) { static char x[YY]; } $ gcc -c test1.c test1.c: In function main': test1.c:5: error: storage size of x' isn't constant test1.c:5: error: size of variable `x' is too large Remove the “static” from the definition of x and all is well. I'm not exactly clear what's going on here: surely YY is constant? I had always assumed that the "static const" approach was preferable to "#define". Is there any way of using "static const" in this situation?

    Read the article

  • c# How to find if two objects are equal

    - by Simon G
    Hi, I'm needing to know the best way to compare two objects and to find out if there equal. I'm overriding both GethashCode and Equals. So a basic class looks like: public class Test { public int Value { get; set; } public string String1 { get; set; } public string String2 { get; set; } public override int GetHashCode() { return Value ^ String1.GetHashCode() ^ String2.GetHashCode(); } public override bool Equals( object obj ) { return GetHashCode() == obj.GetHashCode(); } } So for testing purposes I created two objects: Test t = new Test() { Value = 1, String1 ="One", String2 = "One" }; Test t2 = new Test() { Value = 1, String1 = "Two", String2 = "Two" }; bool areEqual = t.Equals( t2 ); In testing this areEqual returns true event though both objects are different. I realise this is because String1 and String2 are the same value in each object and thus cancels each other out when hashing. Is there a better way off hashing object that the method I have that will resolve my issue?

    Read the article

  • Intelligent Merge of two Arrays (3-way-kindof)

    - by simon.oberhammer
    I have to Arrays, each represents a list of Stories. Two users can concurrently modify the order, add or remove Stories, and I want those changes merged. An example should make this clearer Orignial 1,2,3,4,5 UserA (mine) 3,1,2,4,5 (moved story 3 to start) UserB (theirs) 1,2,3,5,4 (moved story 5 forward) The result of the above should be Merge (result) 3,1,2,5,4 In case of conflicts, UserA should always win. I came pretty far with this simple approach. First i deleted whatever mine says i should deleted (that part of the code is not shown, it's trivial), then I iterate of mine, inserting and moving from theirs what is needed (mstories = mine, tstories = theirs): var offset = 0; for (var idx=0;idx<mstories.length;idx++) { var storyId = mstories[idx]; // new story in theirs if (mstories.indexOf(tstories[idx]) == -1) { mstories.splice(idx+1, 0, tstories[idx]); idx--; continue; } // new story in mine? if (tstories.indexOf(storyId) == -1) { tstories.splice(idx+offset, 0, storyId); offset += 1; // story moved } else if (tstories.indexOf(storyId) != idx + offset) { tstories.splice(tstories.indexOf(storyId), 1); tstories.splice(idx+offset, 0, storyId); } } It's close, but it gets confused when too many Stories are moved to the front / back with Stories in between, which the other User touched. I have an extended version which does checks on the original and is smarter - holding 2 offsets, etc - , but I feel like this is a problem that must have a) a name b) a perfect solution and i don't want to re-invent it.

    Read the article

  • Problems with MySQL OR clause

    - by Simon
    I have a problem with AND and OR clause in SQL. Here is my query: SELECT `act1`.`name`, `act1`.`surname`, `act2`.`name`, `act2`.`surname`, `act3`.`name`, `act3`.`surname` FROM `videos`, `actors` AS act1, `actors` AS act2, `actors` AS act3 WHERE `videos`.`ident` = 'somethink' AND ( `act1`.`id` = `videos`.`id_actor1` OR `act2`.`id` = `videos`.`id_actor2` OR `act3`.`id` = `videos`.`id_actor3` ) It returns me all variations of {name, surname}, but I want the name and surname of first exactly, second and thirth, if they exist.

    Read the article

  • Clear all currently defined vim macros

    - by Simon Walker
    Hi everyone I have a vim macro that I keep mistyping, usually when I'm trying to save something so I do it quickly and I can't work out what keys I pressed. It is annoying as it pastes some irrelevant bash code into my file so I have to undo the erroneous pasting which also undos the last thing I typed that I do want. I was looking for a way to either list the currently defined macros (so I can redefine the offending one), or a way to clear out them completely. I only use macros in the very short term so I don't mind losing them all. Cheers

    Read the article

  • How can i design a DB where the user can define the fields and types of a detail table in a M-D rela

    - by Simon
    My application has one table called 'events' and each event has approx 30 standard fields, but also user defined fields that could be any name or type, in an 'eventdata' table. Users can define these event data tables, by specifying x number of fields (either text/double/datetime/boolean) and the names of these fields. This 'eventdata' (table) can be different for each 'event'. My current approach is to create a lookup table for the definitions. So if i need to query all 'event' and 'eventdata' per record, i do so in a M-D relaitionship using two queries (i.e. select * from events, then for each record in 'events', select * from 'some table'). Is there a better approach to doing this? I have implemented this so far, but most of my queries require two distinct calls to the DB - i cannot simply join my master 'events' table with different 'eventdata' tables for each record in in 'events'. I guess my main question is: can i join my master table with different detail tables for each record? E.g. SELECT E.*, E.Tablename FROM events E LEFT JOIN 'E.tablename' T ON E._ID = T.ID If not, is there a better way to design my database considering i have no idea on how many user defined fields there may be and what type they will be.

    Read the article

  • Why I cant be able to change the UITableViewCell detailTextLabel's frame?

    - by Simon
    Hi.. I am having a table view with default UITableViewCell of style UITableViewCellStyleValue2. I just want to move detailTextLabel few pixels to the right. I know it makes no sense to adjust its width and height :). I am trying to set detailTextLabel's frame with my x and y value. But its not affecting the its frame. I prefer to use default UITableViewCell, in this case, over a customized cell because the default UITableViewCell automatically manages the text alignment and centering of the labels.. How to change UITableViewCell detailTextLabel's frame? Am I allowed to change its frame? Thanks everyone..

    Read the article

  • In Rails, how would I include a section of a page only if the rest of the page doesn't match a certain regexp?

    - by Simon
    We have a site with a lot of user-generated content, and we'd like to show Google ads on it. Some of the content is such that we mustn't show the ads on pages containing that content, or else the whole site gets banned. We've come up with a regexp which we think will match all the offending content. So, three approaches come to mind: Render the page once without the ad section, and then insert the ad section into it if it's clean Render the page as normal, and do the insertion in client-side javascript Render the page above the ad section, capturing only the parts of the page that change; make sure there are no changing parts afterwards. Only show the ads if the captured text is clean, and make sure the unchanging, uncaptured parts are well-vetted in advance. The first one seems like it might delay the page rendering for too long; the second seems like it might delay showing the ads too long; and the third seems too fragile. Is there a better approach? If not, which one is the best solution of the three?

    Read the article

  • How would you convert a String to a Java string literal?

    - by Simon Nickerson
    This is sort of the Java analogue of this question about C#. Suppose I have a String object which I want to represent in code and I want to produce a string literal that maps to the same thing. I was just about to write a state machine that ingests the string character by character and escapes appropriately, but then I wondered if there was a better way, or a library that provides a function to do this.

    Read the article

  • MySQL LEFT JOIN, GROUP BY and ORDER BY not working as required

    - by Simon
    I have a table 'products' => ('product_id', 'name', 'description') and a table 'product_price' => ('product_price_id', 'product_id', 'price', 'date_updated') I want to perform a query something like SELECT `p`.*, `pp`.`price` FROM `products` `p` LEFT JOIN `product_price` `pp` ON `pp`.`product_id` = `p`.`product_id` GROUP BY `p`.`product_id` ORDER BY `pp`.`date_updated` DESC As you can probably guess the price changes often and I need to pull out the latest one. The trouble is I cannot work out how to order the LEFT JOINed table. I tried using some of the GROUP BY functions like MAX() but that would only pull out the column not the row. Thanks.

    Read the article

  • PHP – Slow String Manipulation

    - by Simon Roberts
    I have some very large data files and for business reasons I have to do extensive string manipulation (replacing characters and strings). This is unavoidable. The number of replacements runs into hundreds of thousands. It's taking longer than I would like. PHP is generally very quick but I'm doing so many of these string manipulations that it's slowing down and script execution is running into minutes. This is a pain because the script is run frequently. I've done some testing and found that str_replace is fastest, followed by strstr, followed by preg_replace. I've also tried individual str_replace statements as well as constructing arrays of patterns and replacements. I'm toying with the idea of isolating string manipulation operation and writing in a different language but I don't want to invest time in that option only to find that improvements are negligible. Plus, I only know Perl, PHP and COBOL so for any other language I would have to learn it first. I'm wondering how other people have approached similar problems? I have searched and I don't believe that this duplicates any existing questions.

    Read the article

  • Identifying a class which is extending an abstract class

    - by Simon A. Eugster
    Good Evening, I'm doing a major refactoring of http://wiki2xhtml.sourceforge.net/ to finally get better overview and maintainability. (I started the project when I decided to start programming, so – you get it, right? ;)) At the moment I wonder how to solve the problem I'll describe now: Every file will be put through several parsers (like one for links, one for tables, one for images, etc.): public class WikiLinks extends WikiTask { ... } public class WikiTables extends WikiTask { ... } The files will then be parsed about this way: public void parse() { if (!parse) return; WikiTask task = new WikiLinks(); do { task.parse(this); } while ((task = task.nextTask()) != null); } Sometimes I may want to use no parser at all (for files that only need to be copied), or only a chosen one (e.g. for testing purposes). So before running task.parse() I need to check whether this certain parser is actually necessary/desired. (Perhaps via Blacklist or Whitelist.) What would you suggest for comparing? An ID for each WikiTask (how to do?)? Comparing the task Object itself against a new instance of a WikiTask (overhead)?

    Read the article

  • Launch ms word template as new document from IE...

    - by Simon
    I have a requirement to launch .dot files (ms word templates) as new documents from the browser... Let me explain... if you click on a .dot file in Windows Explorer it opens a new document and runs any macros... you can right click and edit the template... I want to link to the files, so I use <a href="file://myserver/templates/letter.dot">Letter</a>... However this then prompts for the "Download File" dialogue box... and then if I click "Open" it opens the template in edit mode... not the required new document mode... This may be a technical impossibility but can I achieve the desired result in ActiveX or something??

    Read the article

  • Why doesn't my ClickOnce deployment pick up the latest changes to the application?

    - by Simon
    I have a WinForms app which is deployed to a local network drive (as 'Online Only') via ClickOnce. This has been working fine but today I made some changes to the application and attempted to ClickOnce deploy it to a separate network location (to use as a test system) rather than the current production location. ClickOnce publishes successfully, with no errors, to the correct location but only publishes the pre-change version; i.e. none of my changes are visible: the version number is the old version number and the displayed release date is the last production release back in 2009. What do I have to do to get this to publish correctly? I've used a similar approach on other applications with no such issues.

    Read the article

  • Which database should I use for best performance

    - by _simon_
    Hello, I am working in Visual Studio 2005, .NET 2.0. I need to write an application, which listens on COM port and saves incoming data to a database. Main feature: save incoming data (series of 13-digits numbers), if this number allready exists, then mark it as double. For example, there could be these records in database: 0000000000001 OK 0000000000002 OK 0000000000002 Double 0000000000003 OK 0000000000004 OK I could use SQL database, but I don't know if it is fast enough... Database should be able to store up to 10.000.000 records and write up to 100 records per minute (so it needs to check 100 times per minute if this record allready exists). Which database should I use? Maybe the whole database would need to be in RAM. Where could I learn more about this? Thanks

    Read the article

  • How can I get Eclipse to insert tabs instead of spaces for Java content assist?

    - by Simon Nickerson
    Is there any way to persuade Eclipse to use tabs instead of spaces for indenting its built-in Java content assist proposals (such as when creating an empty method which overrides a method in the parent class)? The only setting I could find that looked relevant is in Windows/Preferences/General/Editors/Text Editors/Insert spaces for tabs, and this setting is unchecked. At the moment I have to remember to select them and re-format with <Ctrl>+<Shift>+<F>.

    Read the article

  • Passing function-specific variables

    - by Simon Carlson
    Say I got two functions that looks like this: function main(Index) { doStuff(); } function doStuff() { if(Index == 1) { document.write("Hello world!") } } And some HTML: <input type="button" value="Click me" onclick="main(1)" /> I realize this is a very stupid way to use function-specific variables and such, but it's just out of curiosity. So is it possible to pass the variable Index from the main function to the doStuff function?

    Read the article

  • How to handle the close (big X) button at the source?

    - by Simon T.
    We would like under some circumstances to block the action of the close button in the title bar. The problem is that it's a MDI applications and it seems that we will have to add code in each forms to cancel the operation in the Closingevent handler. It seems that the child forms are the first to receive the event. There is no way to add code at a single place to cancel the close operation. Information on how the close event is propagated to the child form would be welcome. Is there a simple way of doing what we want to do?

    Read the article

  • Speeding up Math calculations in Java

    - by Simon
    I have a neural network written in Java which uses a sigmoid transfer function defined as follows: private static double sigmoid(double x) { return 1 / (1 + Math.exp(-x)); } and this is called many times during training and computation using the network. Is there any way of speeding this up? It's not that it's slow, it's just that it is used a lot, so a small optimisation here would be a big overall gain.

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >