Search Results

Search found 6433 results on 258 pages for 'trouble shooting'.

Page 147/258 | < Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >

  • SQL statement HAVING MAX(some+thing)=some+thing

    - by Andreas
    I'm having trouble with Microsoft Access 2003, it's complaining about this statement: select cardnr from change where year(date)<2009 group by cardnr having max(time+date) = (time+date) and cardto='VIP' What I want to do is, for every distinct cardnr in the table change, to find the row with the latest (time+date) that is before year 2009, and then just select the rows with cardto='VIP'. This validator says it's OK, Access says it's not OK. This is the message I get: "you tried to execute a query that does not include the specified expression 'max(time+date)=time+date and cardto='VIP' and cardnr=' as part of an aggregate function." Could someone please explain what I'm doing wrong and the right way to do it? Thanks

    Read the article

  • C++ containers on classes, returning pointers

    - by otneil
    Hello, I'm having some trouble to find the best way to accomplish what I have in mind due to my inexperience. I have a class where I need to a vector of objects. So my first question will be: is there any problem having this: vector< AnyType container* and then on the constructor initialize it with new (and deleting it on the destructor)? Another question is: if this vector is going to store objects, shouldn't it be more like vector< AnyTipe* so they could be dynamically created? In that case how would I return an object from a method and how to avoid memory leaks (trying to use only STL)?

    Read the article

  • Unique number generation with Java Server Faces

    - by Buddhika Ariyaratne
    I am developing an application for a medical channelling centre where multiple users reserve bookings for doctors with JSF and JPA. A sequence number is unique to the Doctor, Date and Session. I tried to get a unique sequence number from counting the previous bookings and add one, but if two requests comes at the same time, two bookings get the same number causing trouble to functionality. How can I get unique number in this case? Can I use an application wide bean to generate it? (I thought it is not practicle to get the unique number from the database sequence number as there are several doctors, sessions and daily they have to have different booking number.)

    Read the article

  • Getting a unix timestamp as a string in C++

    - by wyatt
    I'm using the function time() in order to get a timestamp in C++, but, after doing so, I need to convert it to a string. I can't use ctime, as I need the timestamp itself (in its 10 character format). Trouble is, I have no idea what form a time_t variable takes, so I don't know what I'm converting it from. cout handles it, so it must be a string of some description, but I have no idea what. If anyone could help me with this it'd be much appreciated, I'm completely stumped. Alternately, can you provide the output of ctime to a MySQL datetime field and have it interpreted correctly? I'd still appreciate an answer to the first part of my question for understanding's sake, but this would solve my problem.

    Read the article

  • Catching KeyboardInterrupt when working with PyGame

    - by Sebastian P.
    I have written a small Python application where I use PyGame for displaying some simple graphics. I have a somewhat simple PyGame loop going in the base of my application, like so: stopEvent = Event() # Just imagine that this eventually sets the stopEvent # as soon as the program is finished with its task. disp = SortDisplay(algorithm, stopEvent) def update(): """ Update loop; updates the screen every few seconds. """ while True: stopEvent.wait(options.delay) disp.update() if stopEvent.isSet(): break disp.step() t = Thread(target=update) t.start() while not stopEvent.isSet(): for event in pygame.event.get(): if event.type == pygame.QUIT: stopEvent.set() It works all fine and dandy for the normal program termination; if the PyGame window gets closed, the application closes; if the application finishes its task, the application closes. The trouble I'm having is, if I Ctrl-C in the Python console, the application throws a KeyboardInterrupt, but keeps on running. The question would therefore be: What have I done wrong in my update loop, and how do I rectify it so a KeyboardInterrupt causes the application to terminate?

    Read the article

  • How to split up a long list using \n

    - by pypy
    Here is a long string that I convert to a list so I can manipulate it, and then join it back together. I am having some trouble being able to have an iterator go through the list and when the iterator reach, let us say every 5th object, it should insert a '\n' right there. Here is an example: string = "Hello my name is Josh I like pizza and python I need this string to be really really long" string = string.split() # do the magic here string = ' '.join(string) print(string) Output: Hello my name is Josh I like pizza and python I need this string to be really really long Any idea how i can achieve this? I tried using: for words in string: if words % 5 == 0: string.append('\n') but it doesn't work. What am I missing?

    Read the article

  • Mysqli prepared insert statements always returning false

    - by user1754679
    I'm writing prepared statements that are supposed to insert data into a table, on a database that's been pre-selected in the variable $GLOBALS['mysqli']. The connection has been tested, and that's not the problem I'm having. I'm only running into trouble whenever my prepared statement involves INSERT INTO. I know the tablename, and field names are correct, but $stmt is ALWAYS false. What gives? $stmt = $GLOBALS['mysqli']->prepare("INSERT INTO audit_RefreshCount (user, count, lastrefresh) values (?,?,?)"); if ($stmt == TRUE) { $stmt->bindParam('ssi', $_SESSION['username'], '0', time()); //$stmt->bind_Param('ssi', $_SESSION['username'], '0', time()); // Also doesn't work. $stmt->execute(); }

    Read the article

  • C++ - Resources in static library question

    - by HardCoder1986
    Hello! This isn't a duplicate of http://stackoverflow.com/questions/531502/vc-resources-in-a-static-library because it didn't help :) I have a static library with TWO .rc files in it's project. When I build my project using the Debug configuration, I retrieve the following error (MSVS2008): fatal error LNK1241: resource file res_yyy.res already specified Note, that this happens only in Debug and Release library builds without any troubles. The command line for Resources page in project configuration looks the same for every build: /fo"...(Path here)/Debug/project_name.res" /fo"...(Path here)/Release/project_name.res" and I can't understand what's the trouble. Any ideas? UPDATE I don't know why this happens, but when I turn "Use Link-Time Code Generation" option on the problem goes away. Could somebody explain why does this happen? I feel like MS-compiler is doing something really strange here. Thanks.

    Read the article

  • reading and writing QByteArrays

    - by synchronicity
    I'm having trouble reading and writing QByteArray data to a file. My goal is to save QPixmap data into a QByteArray and save that QByteArray to a file (with the ability to read this QByteArray back from the file and into a QPixmap). I want to use following code from the QPixmap documentation: QPixmap pixmap(<image path>); QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format After writing the buffer to a file, I want to be able to retrieve the QByteArray and load it back into a QPixmap using the QPixmap::loadFromData() function. Please let me know if any further clarification is needed (I'm open to alternative approaches as well, I just need to be able to read and write the QPixmap to a file! :) );

    Read the article

  • How does Maven find a Artifact in a remote repository?

    - by Thomas
    I'm trying to create a maven plugin to generate a file with the URL to all the dependencies in a project. I have been able to get the dependencies and their artifact, but I'm having trouble getting the download URL. Using ArtifactResolver and ArticateMetadataSource I get some of the artifact information. However I fail to get all the information for all the dependencies. I haven't been able to find documentation on the resolution logic, so that I can call it form my plugin. I can use an ArtifactResolver to download the artifact, but what I really wanted was just the URL. The Maven Artifact API has a a method called getDownloadURL (see http://maven.apache.org/ref/2.0.4/maven-artifact/apidocs/org/apache/maven/artifact/Artifact.html). However I cant seem to find a way to get a real value into it. I always get a null value. Is there a way to have it resolved (downloading or not) and get the URL for where the file came from?

    Read the article

  • CakePHP Routing Alias, no prefix

    - by Jason McCreary
    I have a dashboard with a series of widgets. Per specification, the widgets need to be buried under a /widgets/ directory. So I have added the following to my routes.php Router::connect('/widget/:controller/:action/*', array()); But I seem to be running into trouble on widgets/links/ and widgets/links/view/1 I am new to CakePHP, but this doesn't seem all that impressive. I have yet to find anything in the Book or by search. So any help is appreciated. Thanks.

    Read the article

  • How to get rid of this sliver of white between DIVs?

    - by George Edison
    I am currently having trouble getting rid of a sliver of white... Here is an example page: http://m.stackoverflow.quickmediasolutions.com/view_question.php?id=97969&site=serverfault As you can see, the answers have a sliver of white stuffed between the top of the 'button' and the content. Here is some relevant code: <!-- this is the top of the 'button' --> <div class='top'></div> <!-- right here is where the space is --> <div class='content'></div> .top { height: 5px; } .content { display: block; padding-left: 10px; }

    Read the article

  • hyperlink in firefox to windows share

    - by Eds
    I am having trouble creating a hyperlink to a windows share, that works correctly in firefox and IE9. The original line was this: <a href="\\10.1.3.33\sharename\filename.txt" target="_new">Link</a> This works correctly in IE9, andopens the file as you would expect. However, this does not seem to work in firefox, as it just appends the above to the root directory, so it ends up looking in: /\10.1.3.33/sharename/filename I have tried as someone suggested and appending file:// to the pathname, but this does not seem to load anything in firefox, but does work in IE. Can anyone advise on what I should be using the get a link to a network share working in all browsers? Many thanks, Eds

    Read the article

  • BlackBerry Technical Specification

    - by Sam
    I'm having trouble locating BlackBerry techical specifications and their website is a mess. They also don't have a number that I can use to easily contact them. This isn't exactly a coding question, but what does the BlackBerry audio API look like, and where can I get technical specifications on audio? Specifically, I'm trying to find out more information on Audio-In, specifically, through the Mic-In on the 3.5 mm jack. Unfortunately, before I can proceed, I need to know such things like sampling rate, data width, etc. Direction to the right resource or if you know off of the top of your head is appreciated.

    Read the article

  • iPhone SDK 3.0 deprecation of UITableViewCell .text

    - by djt9000
    Came across an SDK3.0 deprecation that I am having a bit of trouble tryinig to figure out. If my declaration of @property (nonatomic, retain) UIImage *rowImage; does not work, nor @property (nonatomic, readonly, retain) UIImage *rowImage; and I @synthesize rowImage; Do I need to write my own setter because @synthesize will not properly handle this? cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:RootViewControllerCell] autorelease]; // Dpericated in SDK 3.0 // //cell.text = controller.title; //cell.image = controller.rowImage; // Using what the documentation says to use Error=== cell.textLabel = controller.title; Error=== cell.imageView = controller.rowImage; Error: Object cannot be set - Either readonly property or no setter found. Hope this makes sense, any help would be appreciated.

    Read the article

  • how to close the activity chooser dialog from progremmatically?

    - by sojan
    Hi, Help needed. I am developing an application which need to show a chooser dialogue .(Am using a SEND_INTENT) .I need to close the chooser dialog after a particular amount of time,say 15 sec. how can i close the chooser dialog? is it possible? Is there any way to get the first item in the chooser? is there a way to filter the items appearing in the chooser dialog.. Any one pls help me am in big trouble. Any Help greatly appreciated.

    Read the article

  • Algorithm for calculating indefinite integrals

    - by mbac32768
    Suppose I have an integral that's bounded on one (or both) ends by (-)infinity. AFAICT, I can't analytically solve this problem, it takes brute force (e.g. using a Left Riemann Sum). I'm having trouble generalizing the algorithm so that it sets the proper subdivisions; I'll either do far too much work to calculate something trivial, or not do nearly enough and have huge aliasing errors. Answering in any language is cool, but maybe someone with better google-fu can end this quickly. :) Is what I'm looking for as impossible as trying to measure the British coastline?

    Read the article

  • Gnome screensaver

    - by BParker
    Hi, After many years of Windows development in C/C++ i've decided to make a move to linux, and see if i can put together a simple screen saver. The code is an SDL based OpenGL particle engine affair, nothing too complex. I've got the code running ok as a stand-alone app, but i have been having some trouble finding out how to build a screen saver app. I'm running ubuntu 10.04 if that makes much difference, but i was wondering if anyone can point me in the direction of a decent tutorial on building basic gnome screen savers. Thanks

    Read the article

  • trying to make an accordion menu from a list - jquery indexhibit

    - by orionrush
    Hello - Im teaching my self javascript & jquery so this might be a bit of a low brow question or entirely too much code for anyone to wade through, but Im hoping for some feedback. I have looked around and haven't found a thread that looks like it will deals neatly with my question. Im using the cms indexhibit (cant create a new tag!) and trying to create an accordion style menu from the menu list it generates. I basically have the behaviour Im after, modifying an existing bit of work but there are quite a few foibles, which are no doubt a conflict between the .click and .toggle and a confused use if statements. I basically want to start from scratch and redo this so I can a) learn from my mistakes b) understand what's happening. Im having trouble now because I dont know where to go from here, or how to trouble shoot it. Can anyone give me a quick analysis how the the script in the head of the document work together? Also any insight into the nature of the conflicts Im seeing and what approach might take to remedy them? If you were going to start afresh what would be your approach? Here is a test to see it in action (warts and all): http://stillstatic.nfshost.com/ This script goes into the document head: <script type='text/javascript'> //im not entirely clear as to what this achieves path = 'path/to/script/'; $(document).ready(function() { setTimeout('move_up()', 1); expandingMenu(0); expandingMenu(1); expandingMenu(2); expandingMenu(3); expandingMenu(4); //etc }); </script> the generated list: <ul> <li class='section-title active_menu'>blogs</li> <li><a class="active" href='#' onclick="do_click();">3</a></li> </ul> <ul> //this menu section dose not have a label: class .section-title <li><a href='#' onclick="do_click();">1</a></li> <li><a href='#' onclick="do_click();">2</a></li> </ul> <ul> //this menu section is not the 'active menu' this is achieved by the jquery script <li class='section-title'>writing</li> <li><a href='#' onclick="do_click();">4</a></li> <li><a href='#' onclick="do_click();">5</a></li> </ul> The meat of in an external script: function expandingMenu(num) { var speed = 500; var menu_title = $("#menu ul").eq(num).children(":first"); // ie. first child be the title with the class .section-title unless the user turned it off var menu_items = $("#menu ul").eq(num).children().filter(function (index) { return index 0; }); // ie. any li NOT in position 0, below li.section-title if (menu_items.is(".active") == true) { menu_title.addClass("active_menu"); //Add a class to the active list so we can style it. } if (menu_title.is(".section-title") == true){ // this if prevents interference with users who turn off the section titling if ((menu_items.is(".active") == false) && (menu_items.is(":visible")) ) { menu_items.hide(0);// first we hide the inactive exhibits } $('li').click(function (){ if ( (menu_title.is(":visible") == true) ){ menu_items.hide(speed); } if ( (menu_items.is(":hidden") == true ) && (('')) ){// ?! without this second condition things break down. . . menu_items.show(speed); } }) menu_title.css({cursor:"pointer"}).toggle( // add click functions + pointer to menu_title function () { menu_items.show(speed);//Open it up }, function () { // this function could even be empty but without the if things get weird if (menu_items.is(".xx")) menu_items.hide(speed); //Take the menu item off of active duty! } ) } }

    Read the article

  • Better data-structure design

    - by Tempname
    Currently in my application I have a single table that is giving me a bit of trouble. The issue at hand is I have a value object that is mapped to this table. When the data is returned to me as an array of value objects, I have to then loop through this array and begin my recursion by matching the ParentID to parent ObjectID's. The column ParentID is either null (acts a parent) or it holds the value of an ObjectID. I know there has to be a better way to create this data structure so that I do not have to do recursive loops to match ParentID's with their ObjectID's. Any help with this is greatly appreciated. Here is the table in describe form: +----------------+------------------+------+-----+---------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------------+------+-----+---------------------+-----------------------------+ | ObjectID | int(11) unsigned | NO | PRI | NULL | auto_increment | | ObjectHeight | decimal(6,2) | NO | | NULL | | | ObjectWidth | decimal(6,2) | NO | | NULL | | | ObjectX | decimal(6,2) | NO | | NULL | | | ObjectY | decimal(6,2) | NO | | NULL | | | ObjectLabel | varchar(255) | NO | | NULL | | | TemplateID | int(11) unsigned | NO | MUL | NULL | | | ObjectTypeID | int(11) unsigned | NO | MUL | NULL | | | ParentID | int(11) unsigned | YES | MUL | NULL | | | CreationDate | datetime | YES | | 0000-00-00 00:00:00 | | | LastModifyDate | timestamp | YES | | NULL | on update CURRENT_TIMESTAMP | +----------------+------------------+------+-----+---------------------+-----------------------------+e

    Read the article

  • Discovering the default gateway without DHCP

    - by JavaRocky
    A crazy question, but is there anyway to discover the default gateway without DHCP? This would be for a device on a network which does not use DHCP which does not have an IP address as yet. I was thinking if I could discover the default gateway, then i could try to guess an unused ip address then broadcast on the network to see if it's being used. I may be asking for trouble i understand. E.g. if there is already a computer which has a static IP and is shutdown.

    Read the article

  • How to format a getUpdatedAt() kind of date in Symfony?

    - by Guillaume Flandre
    I'd like to change the formatting of a date in Symfony 1.4 The default one being: <?php echo $question->getUpdatedAt(); // Returns 2010-01-26 16:23:53 ?> I'd like my date to be formatted like so: 26/01/2010 - 16h23 I tried using the format_date helper DateHelper class. Unfortunately the API is rather empty (something really needs to be done about it.) Browsing the helper's source code, I found that a second argument, format, can be passed. I assumed it was using the same syntax as PHP's date function. But here's what it outputs (same example as above): <?php sfContext::getInstance()->getConfiguration()->loadHelpers('Date'); // [...] echo format_date($question->getUpdatedAt(),'d/m/y - H\hi') // Returns 26/23/2010 - 16\4i I'm sure I'm not the first one having trouble doing this but I've been Googling around and nothing accurate showed up. Do you guys have any idea how to format a date in Symfony 1.4?

    Read the article

  • Injecting a dependancy into a base class

    - by Jamie Dixon
    Hey everyone, I'm on a roll today with questions. I'm starting out with Dependency Injection and am having some trouble injecting a dependency into a base class. I have a BaseController controller which my other controllers inherit from. Inside of this base controller I do a number of checks such as determining if the user has the right privileges to view the current page, checking for the existence of some session variables etc. I have a dependency inside of this base controller that I'd like to inject using Ninject however when I set this up as I would for my other dependencies I'm told by the compiler that: Error 1 'MyProject.Controllers.BaseController' does not contain a constructor that takes 0 argument This makes sense but I'm just not sure how to inject this dependency. Should I be using this pattern of using a base controller at all or should I be doing this in a more efficient/correct way?

    Read the article

  • NHibernate: Can I access a generated primary key after saving a model?

    - by littlecharva
    Howdy, So I've got a simple table with an ID field that's incrementally generated on INSERT. I've set the mapping up in NHibernate to reflect this: <id name="ID"> <generator class="identity" /> </id> And it all works fine. Trouble is, I need to get the generated ID after I've saved a new model to use elsewhere: var model = new MyModel(); session.SaveOrUpdate(model); But at this stage model.ID == null, not the ID. Any ideas? Anthony

    Read the article

  • C# Design a class with interface?

    - by Haroon
    I am having a bit of trouble understanding how I will design a class. My class will have 3 methods ICollection<Field> GetFields(); //perform validation internally - return back the object T UpdateFields(ICollection<Field> fields); //pass in model object with values on it, set up fields, then pass back all fields ICollection<Field> GetFieldsWithValues(T object); What is the best way to construct/design such a class keeping in mind: 1. The model object I pass in will be one of 3 or 4 tables, however when I call GetFIelds - internally for each object I know what fields will be there i.e. list.add(new Field{name = "id", value = "5"}); list.add(new Field{name = "nameofcompany", value = "super guys"});

    Read the article

< Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >