Daily Archives

Articles indexed Tuesday June 1 2010

Page 1/125 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • VBA - Access 03 - Iterating through a list box, with an if statement to evaluate

    - by Justin
    So I have a one list box with values like DeptA, DeptB, DeptC & DeptD. I have a method that causes these to automatically populate in this list box if they are applicable. So in other words, if they populate in this list box, I want the resulting logic to say they are "Yes" in a boolean field in the table. So to accomplish this I am trying to use this example of iteration to cycle through the list box first of all, and it works great: dim i as integer dim myval as string For i = o to me.lstResults.listcount - 1 myVal = lstResults.itemdata(i) Next i if i debug.print myval, i get the list of data items that i want from the list box. so now i am trying to evaluate that list so that I can have an UPDATE SQL statement to update the table as i need it to be done. so, i know this is a mistake, but this is what i tried to do (giving it as an example so that you can see what i am trying to get to here) dim sql as string dim i as integer dim myval as string dim db as database sql = "UPDATE tblMain SET " for i = 0 to me.lstResults.listcount - 1 myval = lstResults.itemdata(i) If MyVal = "DeptA" Then sql = sql & "DeptA = Yes" ElseIF myval = "DeptB" Then sql = sql & "DeptB = Yes" ElseIf MyVal = "DeptC" Then sql = sql & "DeptC = Yes" ElseIf MyVal = "DeptD" Then sql = sql & "DeptD = Yes" End If Next i debug.print (sql) sql = sql & ";" set db= currentdb db.execute(sql) msgbox "Good Luck!" So you can see why this is going to cause problems because the listbox that these values (DeptA, DeptB, etc) automatically populate in are dynamic....there is rarely one value in the listbox, and the list of values changes per OrderID (what the form I am using this on populates information for in the first place; unique instance). I am looking for something that will evaluate this list one at a time (i.e. iterate through the list of values, and look for "DeptA", and if it is found add yes to the SQL string, and if it not add no to the SQL string, then march on to the next iteration). Even though the listbox populates values dynamically, they are set values, meaning i know what could end up in it. Thanks for any help, Justin

    Read the article

  • What documentation is helpful when supporting an application?

    - by Andrew
    I am going to be taking over from a developer here at work soon. Hence, I'll be supporting all the applications that he has written over the last few years. My question is, when supporting an application that you probably don't know much about, what kind of documentation is most helpful to get a handle on how to fix problems, extend functionality, modify functionality, etc? I'm thinking it would need to give you an overview of what the software does, what interfaces it has to other software, what databases it uses, usernames, passwords, and so on. Is there such a thing as a software support document? Referrals to any templates would be most helpful. BTW, unfortunately, there are no requirements documents, specs, etc! So, really my question is, if my colleague had a day to write a single document for each application so that I could (more easily) support it, what would that document be and/or what would it look like?

    Read the article

  • Which Linux distro for Mac Mini?

    - by spoon16
    I recently received a Mac Mini and would like to set it up as a web server and git source server. I would like to learn Linux so am interested in setting up my Mac Mini with Linux instead of OSX. Here are the main things that I will be using the Mac Mini for. git Repositories (via Gitosis) build server (build projects in git repositories using commit hooks and run tests) simple websites (PHP) learning C++ in a non-Windows environment What distribution would you recommend? Please provide some detail in your answer so that I can make an meaningful decision. Because I am looking to use the mini as more of a server than a normal desktop machine I was thinking of Ubuntu Server, I'm not sure if that is over kill though given the hardware I am using.

    Read the article

  • Remove the elements and contents before an element

    - by Jerry
    Hello guys I am trying to remove the elements and contents before a link inside a div when a user clicks a button. What is the best way to do it?? <div id="dialog" class="window"> //will be inserted a <select> element and few text here //but I want to clear them after the user click a button <a href="#" class="close">Close it</a> // I want to keep this <a> link. </div> My Jquery $('.model').click(function(e) { $("#dialog").empty(); //I can't use this because <a> will be deleted. Any better ideas? }); Thanks for the reply...

    Read the article

  • html5 / flash video player

    - by Donnie
    I'm working on a website in which I'm going to embed some videos. Are there any good open source html5 / flash video players around so I can avoid having to code up one of my own from scratch?

    Read the article

  • Close PrintPreviewDialog when ESC is pressed

    - by Emerick Rogul
    I'm working on a WinForms application that uses System.Windows.Forms.PrintPreviewDialog to display a Print Preview dialog. When the user presses ESC in that dialog, I'd like to close the dialog. Unfortunately, I can't figure out how to do this. I've tried to install a KeyDown/PreviewKeyDown event handler, but it never gets called. I also tried setting focus to the dialog (and to its PrintPreviewControl), thinking that was the issue, but that didn't help either. Does anyone have any idea how to make this work?

    Read the article

  • Why is this class library dll not getting information from app.config

    - by baron
    I am developing a custom HttpHandler, to do so I write a C# Class Library and compile to DLL. As part of this I have some directory locations which I want not hard coded in the app, so i'm trying to put it in the app.config which I've used before. Before this has worked by just going building the app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Share" value="C:\...\"/> </appSettings> </configuration> And then obtaining this in code like: var shareDirectory = ConfigurationManager.AppSettings["Share"]; But when I compile it and put it in the bin folder for the webservice, it keeps getting null for shareDirectory, probably because it can't find app.config. So how do I make sure this is included so I don't have to hard code my direcotry locations? I notice it will essentially after compiled we get the assembly.dll and the assembly.dll.config which is the app.config file, so it's definetly there in the bin folder!

    Read the article

  • UIScrollView. Any thoughts on implementing "infinite" scroll/zoom?

    - by dugla
    So, UITableView supports essentially "infinite" scrolling. There' may be a limit but that sucker can scroll for a looonnnggg time. I would like to mimic this behavior with a UIScrollView but there are two fundamental impediments: 1) scrollView.contentSize is fixed at creation time. 2) zooming can blow any lazy-loading scheme all to hell since it can cause infinte data explosion. Have others out there pondered this idea? Yah, I know, we are essentially talking about re-creating Google Maps here. Any insights would be much appreciated. Cheers, Doug

    Read the article

  • Is there a PHP refactoring tool to tell what functions are never called?

    - by ae
    I have a large codebase which has suffered many changes over the years. I would like to remove the functions that are no longer called or relevant. Is there a tool that will analysis the codebase and determine if a method is ever used? I'm also using phpunit/xdebug which reports which functions have not been run for the unit tests, however coverage is only at 55% and will require a massive amount of work to bring it up to 100% (I'm working on it!). Anything that was a command line tool would be extra good as I could hook it into hudson (CI).

    Read the article

  • Lucene.NET 2.9 and BitArray/DocIdSet

    - by Paul Knopf
    I found a great example on grabbing facet counts on a base query. It stores the bitarray of the base query to improve the performance each time the a facet gets counted. var genreQuery = new TermQuery(new Term("genre", genre)); var genreQueryFilter = new QueryFilter(genreQuery); BitArray genreBitArray = genreQueryFilter.Bits(searcher.GetIndexReader()); Console.WriteLine("There are " + GetCardinality(genreBitArray) + " document with the genre " + genre); // Next perform a regular search and get its BitArray result Query searchQuery = MultiFieldQueryParser.Parse(term, new[] {"title", "description"}, new[] {BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD}, new StandardAnalyzer()); var searchQueryFilter = new QueryFilter(searchQuery); BitArray searchBitArray = searchQueryFilter.Bits(searcher.GetIndexReader()); Console.WriteLine("There are " + GetCardinality(searchBitArray) + " document containing the term " + term); The only problem is that I am using a newer version of Lucene.NET (2.9) and Filter.Bits is obsolete. We are told to use DocIdSet instead (rather than BitArray). I cannot found out how to do the bitArray.And(bitArray) with a docIdSet. I looked in reflector and found OpenIdSet which has And operations. Not sure if OpenIdSet is the route to go, I'm just stating. Thanks in advance!

    Read the article

  • Flex: Dynamically create a preview image for a video....

    - by onekidney
    I'm using the VideoDisplay to play flv's, mov's, and mp4's and everything is working great. They are all being loaded via progressive download and are not being streamed. What I'd like to do is to grab a single specified frame (like whatever is being shown at the 10 second mark), convert it to a bitmap and use that bitmap as the preview image for the video. I'd like to do this at runtime so I don't have to create a preview image for every video that would be shown. Any idea's on how to do this? I'd rather not fake it by playing it - seeking for that specific frame and then pausing it but I may have no other choice?

    Read the article

  • Smoothing touch-based animation in iPhone OpenGL?

    - by quixoto
    I know this is vague, but looking for general tips/help on this, as it's not an area of significant expertise for me. I have some iPhone code that's basically an EAGL view handling a single touch. The app draws (using GL) a circle via triangle fan at the touch point, and moves it when the user moves the touch point, and re-renders the view then. When dragging a finger slowly, the circle keeps up and consistent with the finger as it moves. If I scribble my finger quickly back and forth across the screen, the rendering doesn't keep up with the touch motion, so you see an optical illusion of "multiple" discrete circles on the screen "at once". (Normal persistence of vision illusion). This optical illusion is jarring. How can I make this look more natural? Can I blur the motion of the circle somehow? Is this result the evidence of some bad frame rate issue? I see this artifact even when nothing else is being rendered, so I think this might just be as fast as we can go. Any hints or suggestions? Much appreciated. Thanks.

    Read the article

  • XML: content is not allowed in trailing section

    - by Capsud
    I'm getting these errors Multiple annotations found at this line: - error: Error parsing XML: not well-formed (invalid token) - Content is not allowed in trailing section. on this XML file... <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@drawable/btn_red" /> <item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/btn_orange" /> <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/btn_orange" /> <item android:state_enabled="true" android:drawable="@drawable/btn_black" /> </selector> Probably quite simple for you people who know XML. Any idea?

    Read the article

  • Finding and Printing all Links within a DIV

    - by Abs
    Hello all, I am trying to find all links in a div and then printing those links. I am using the Simple HTML Dom to parse the HTML file. Here is what I have so far, please read the inline comments and let me know where I am going wrong. include('simple_html_dom.php'); $html = file_get_html('tester.html'); $articles = array(); //find the div the div with the id abcde foreach($html->find('#abcde') as $article) { //find all a tags that have a href in the div abcde foreach($article->find('a[href]') as $link){ //if the href contains singer then echo this link if(strstr($link, 'singer')){ echo $link; } } } What currently happens is that the above takes a long time to load (never got it to finish). I printed what it was doing in each loop since it was too long to wait and I find that its going through things I don't need it to! This suggests my code is wrong. The HTML is basically something like this: <div id="abcde"> <!-- lots of html elements --> <!-- lots of a tags --> <a href="singer/tom" /> <img src="image..jpg" /> </a> </div> Thanks all for any help

    Read the article

  • In C, is it possible do free only an array first ou last position?

    - by user354959
    Hi there! I've an array, but I don't need its first (or last) position. So I point a new variable to the rest of the array, but I should free the array first/last position. For instance: p = read_csv_file(); q = p + 1; // I don't need the first CSV file field // Here I'd like to free only the first position of p return q; Otherwise I've to memcpy the array to other variable, excluding the first position, and then free the original array. Like this: p = read_csv_file(); q = (int*) malloc(sizeof(int) * (SOME_SIZE - 1)); memcpy(q, p+1, sizeof(int) * (SOME_SIZE - 1)); free(p); return q; But then I'll have the overhead of copying all the array. Is this possible to only free a single position of an array?

    Read the article

  • The problem of outsourcing

    - by Dave
    I work on a project for like two years..but because all the programming stuff was outsourced I dun hav a chance to do more prograing or even technical work... I got very demoralized that nowadaysy job scope is all about delegating other to do the work but I can't learn much technical stuff? What should I do to let myself do more technical stuff like programming at work I thought of coming up with tools that will aid my main application or just resolve issues on my own which I doing so right now any other suggestion anyone?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >