Search Results

Search found 808 results on 33 pages for 'greg mcnulty'.

Page 25/33 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Join Where Rows Don't Exist or Where Criteria Matches...?

    - by Greg
    I'm trying to write a query to tell me which orders have valid promocodes. Promocodes are only valid between certain dates and optionally certain packages. I'm having trouble even explaining how this works (see psudo-ish code below) but basically if there are packages associated with a promocode then the order has to have one of those packages and be within a valid date range otherwise it just has to be in a valid date range. The whole "if PrmoPackage rows exist" thing is really throwing me off and I feel like I should be able to do this without a whole bunch of Unions. (I'm not even sure if that would make it easier at this point...) Anybody have any ideas for the query? if `OrderPromoCode` = `PromoCode` then if `OrderTimestamp` is between `PromoStartTimestamp` and `PromoEndTimestamp` then if `PromoCode` has packages associated with it //yes then if `PackageID` is one of the specified packages //yes code is valid //no invalid //no code is valid Order: OrderID* | OrderTimestamp | PackageID | OrderPromoCode 1 | 1/2/11 | 1 | ABC 2 | 1/3/11 | 2 | ABC 3 | 3/2/11 | 2 | DEF 4 | 4/2/11 | 3 | GHI Promo: PromoCode* | PromoStartTimestamp* | PromoEndTimestamp* ABC | 1/1/11 | 2/1/11 ABC | 3/1/11 | 4/1/11 DEF | 1/1/11 | 1/11/13 GHI | 1/1/11 | 1/11/13 PromoPackage: PromoCode* | PromoStartTimestamp* | PromoEndTimestamp* | PackageID* ABC | 1/1/11 | 2/1/11 | 1 ABC | 1/1/11 | 2/1/11 | 3 GHI | 1/1/11 | 1/11/13 | 1 Desired Result: OrderID | IsPromoCodeValid 1 | 1 2 | 0 3 | 1 4 | 0

    Read the article

  • log4net - why would the same MyLog.Debug line not work at one point of startup, but work at another

    - by Greg
    Hi, During startup of my WinForms application I'm noting that there are a couple of points (before the MainForm renders) that do a "MyDataSet.GetInstance()". For the first one the MyLog.Debug line comes through in the VS2008 output window, but for a later one it does work and come through. What could explain this? What settings could I check at debug time to see why an output line for a MyLog.Debug line doesn't come out in the output window? namespace IntranetSync { public class MyDataSet { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MyDataSet)); public static MyDataSet GetInstance() { MyLog.Debug("MyDataSet GetInstance() ====================================="); if (myDataSet == null) { myDataSet = new MyDataSet(); } return myDataSet; } . . . PS. What I have been doing re log4net repository initialization is putting the following line as a private variables in the classes I use logging - is this OK? static class Program { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MainForm)); . . . public class Coordinator { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MainForm)); . . . public class MyDataSet { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MyDataSet)); . . .

    Read the article

  • What is the simplest, but solid, interface from WinForms to a SQL Server database?

    - by Greg
    Hi, If I wanted to have my data in SQL Server, but wanted to use a thick client WinForms application for users, what would be the best practice way to have calls occurring from WinForms to database? And how simple is this? I guess I'm trying to gauge to what extent there are issues with this approach and one needs to go for some (a) middle tier with web services, or (b) have to go asp.net or something. I really just have a simple app that needs a database and I'll only have a 10 - 30 clients on a LAN/WAN network that would be connecting in.

    Read the article

  • All UITableCells rendered at once... why?

    - by Greg
    I'm extremely confused by the proper behavior of UITableView cell rendering. Here's the situation: I have a list of 250 items that are loading into a table view, each with an image. To optimize the image download, I followed along with Apple's LazyTableImages sample code... pretty much following it exactly. Really good system... for reference, here's the cell renderer within the Apple sample code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // customize the appearance of table view cells // static NSString *CellIdentifier = @"LazyTableCell"; static NSString *PlaceholderCellIdentifier = @"PlaceholderCell"; // add a placeholder cell while waiting on table data int nodeCount = [self.entries count]; if (nodeCount == 0 && indexPath.row == 0) { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier] autorelease]; cell.detailTextLabel.textAlignment = UITextAlignmentCenter; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.detailTextLabel.text = @"Loading…"; return cell; } UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } // Leave cells empty if there's no data yet if (nodeCount > 0) { // Set up the cell... AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row]; cell.textLabel.text = appRecord.appName; cell.detailTextLabel.text = appRecord.artist; // Only load cached images; defer new downloads until scrolling ends if (!appRecord.appIcon) { if (self.tableView.dragging == NO && self.tableView.decelerating == NO) { [self startIconDownload:appRecord forIndexPath:indexPath]; } // if a download is deferred or in progress, return a placeholder image cell.imageView.image = [UIImage imageNamed:@"Placeholder.png"]; } else { cell.imageView.image = appRecord.appIcon; } } return cell; } So – my implementation of Apple's LazyTableImages system has one crucial flaw: it starts all downloads for all images immediately. Now, if I remove this line: //[self startIconDownload:appRecord forIndexPath:indexPath]; Then the system behaves exactly like you would expect: new images load as their placeholders scroll into view. However, the initial view cells do not automatically load their images without that prompt in the cell renderer. So, I have a problem: with the prompt in the cell renderer, all images load at once. Without the prompt, the initial view doesn't load. Now, this works fine in Apple sample code, which got me wondering what was going on with mine. It's almost like it was building all cells up front rather than just the 8 or so that would appear within the display. So, I got looking into it, and this is indeed the case... my table is building 250 unique cells! I didn't think the UITableView worked like this, I guess I thought it only built as many items as were needed to populate the table. Is this the case, or is it correct that it would build all 250 cells up front? Also – related question: I've tried to compare my implementation against the Apple LazyTableImages sample, but have discovered that NSLog appears to be disabled within the Apple sample code (which makes direct behavior comparisons extremely difficult). Is that just a simple publish setting somewhere, or has Apple somehow locked down their samples so that you can't log output at runtime? Thanks!

    Read the article

  • Replacing Text Nodes With DOM Nodes

    - by Greg
    Hey, say I have a text node via XPath. How would I replace the text node with a new DOM node? For example, this little patch of code will go through text nodes, and if text matches something, it will replace it with a corresponding image via img element. I wanted something faster then a global page regex or even a element innerHTML regex. Any help would be appreciated. EDIT: Never mind. I figured it out.

    Read the article

  • Twitter feed appears to be both RSS 2.0 and Atom?

    - by Greg K
    I'm parsing various site feeds, and putting together a small library to help me do it. Looking at the Atom RFC and RSS 2.0 specification, feeds from Twitter seem to be a combination. Twitter specifies an Atom namespace in an RSS 2.0 structure? GitHub uses Atom, whereas Flickr (offers multiple but the default 'Latest' feed from user profiles) appears to be RSS 2.0. How can Twitter specify a Atom namespace and then use RSS? This makes parsing feeds a little ambiguous, unless I ignore any specified namespace and just examine the document structure.

    Read the article

  • try-catch in JavaScript : how to get stack trace or line number of the original error

    - by Greg Bala
    When using TRY-CATCH in JavaScript, how to get the line number of the line that caused the error? On many browsers, the below code will work great and I will get the stack trace that points to the actual line that throw the exception. However, some browsers do not have "e.stack". Iphone's safari is one example. Is there someway to get the line number that will work for all browsers? try { // lots of code here var i = v.WillGenerateError; // how to get this line number in catch?? // lots of code here } catch (e) { alert (e.stack) // this will not work on iPhone, for example } Many thanks!

    Read the article

  • how do use Ninject with class libraries I am developing?

    - by Greg
    Hi, If I am working on a class library how do I make use of Ninject here? Ie from the internal class library point of view and also from the client code? For example: should the class library have it's own IOC set up, or should it always assume the client code will supply? if no (ie it's upto the client to have the IOC in place) then where is the mapping data stored here'. Is this mapping of the class library's functionality to be places in the client? have a reusable library that is available, that uses interfaces with classes that use the getInstance concept to create concrete classes for you to use, then in this case would that make sense on the client side to use the IOC container to create instances of these classes? Or is that really applying a double layer of abstraction? Q2 Or in the cases where I'm building the reusable library myself and want the client to use an IOC container, then in my reusable library would I then dispense with any overhead of having factories or "getInstance" methods to instantiate the classes in the client? (i.e. as the IOC container would do this no?)

    Read the article

  • Bypass using Alter Access Mappings for to Open Web from SPItemEventProperties

    - by Greg Ogle
    In the following code, // class overrides SPItemEventreceiver public override void ItemAdding(SPItemEventProperties properties) { using (var site = new SPSite(properties.SiteId)) //SiteId is integer { ... } } The following exception is thrown: System.IO.FileNotFoundException: The Web application at http://URL could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. One way to work around this is to hard-code (or configure) the URL specified in Alternate Access Mappings. Putting the correct URL in Alternate Access Mappings is ultimately the correct solution, but if possible, I need a work-around that doesn't require configuration.

    Read the article

  • How to get notification of workflow errors?

    - by Greg McGuffey
    I am having issues were a workflow is stalled because there is an issue with sending an email (send email activity). Typically, this is simply solved by resuming the workflow. I'm wondering if there any way to react to a workflow error, so the user knows they need to go in and resume the workflow. I'm also wondering about this relative to a workflow that is attempting to assign a task to a user who no longer exists in the CRM or one that has an invalid email address, which I'm assuming would cause errors in workflows as well. Any other suggestions related to this sort if issue would be welcome. Thanks!

    Read the article

  • Meaning of tA tC and tP

    - by Greg Wiley
    If this is a duplicate I appoligize, but looking for two-letter strings is quite hard in any search. I'm looking for the meaning of tA tC and tP in the context of a mysql query. And in the spirit of "teaching a man how to fish" it would be great if you could point me in the right direction of where to find this info in the future. Edit: The Query $wpdb->get_row($wpdb->prepare("SELECT tA.* FROM ".AMYLITE_ADS." tA, ".AMYLITE_ADS_CAMPAIGNS." tC, ".AMYLITE_PACKAGES." tP WHERE tA.id=tC.ad_id AND tC.campaign_id=tP.campaign_id AND tP.zone_id=%d AND tP.date_end>CURDATE() GROUP BY tA.id ORDER BY RAND()", $zone->id));

    Read the article

  • How to get around DnsRecordListFree error in .NET Framework 4.0?

    - by Greg Finzer
    I am doing an MxRecordLookup. I am getting an error when calling the DnsRecordListFree in the .NET Framework 4.0. I am using Windows 7. How do I get around it? Here is the error: System.MethodAccessException: Attempt by security transparent method to call native code through method. Here is my code: [DllImport("dnsapi", EntryPoint = "DnsQuery_W", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] private static extern int DnsQuery([MarshalAs(UnmanagedType.VBByRefStr)]ref string pszName, QueryTypes wType, QueryOptions options, int aipServers, ref IntPtr ppQueryResults, int pReserved); [DllImport("dnsapi", CharSet = CharSet.Auto, SetLastError = true)] private static extern void DnsRecordListFree(IntPtr pRecordList, int FreeType); public List<string> GetMXRecords(string domain) { List<string> records = new List<string>(); IntPtr ptr1 = IntPtr.Zero; IntPtr ptr2 = IntPtr.Zero; MXRecord recMx; try { int result = DnsQuery(ref domain, QueryTypes.DNS_TYPE_MX, QueryOptions.DNS_QUERY_BYPASS_CACHE, 0, ref ptr1, 0); if (result != 0) { if (result == 9003) { //No Record Exists } else { //Some other error } } for (ptr2 = ptr1; !ptr2.Equals(IntPtr.Zero); ptr2 = recMx.pNext) { recMx = (MXRecord)Marshal.PtrToStructure(ptr2, typeof(MXRecord)); if (recMx.wType == 15) { records.Add(Marshal.PtrToStringAuto(recMx.pNameExchange)); } } } finally { DnsRecordListFree(ptr1, 0); } return records; }

    Read the article

  • Android Set up Question - Which API Level do I Install?

    - by Greg
    Hi all, I'm trying to set up the Android SDK on Ubuntu. Someday I want to make apps that can reach most of the market. I've heard I need to make the apps compatible with Android 1.6 for this. Does that mean everything I install should be for Android 1.6 (API level 4?). Will I have any trouble running the apps on my phone with is Android 2.1?

    Read the article

  • How do I get the sequence of numbers in a sorted-set that are between two integers in clojure?

    - by Greg Rogers
    Say I have a sorted-set of integers, xs, and I want to retrieve all the integers in xs that are [x, y), ie. between x and y. I can do: (select #(and (>= % x) (< % y)) xs) But this is inefficient - O(n) when it could be O(k log n) where k is the number of integers returned. I am just learning clojure so here is how I would do it in C++: set<int>::iterator first = xs.lower_bound(x); set<int>::iterator last = xs.upper_bound(y); for (; first != last; ++first) // do something with *first Can I do this in clojure?

    Read the article

  • Issues with format in reporting services

    - by Greg Lorenz
    In a report a have a cell that contains a System.Decimal type value. I am using the cells format property to format the value to "D2". This works in VS but not when I run the report on the report server or in my application. If I switch the format string to "0.00" then it works. The confusing part is that it seems that sometimes it works and sometimes it doesn't. Does anyone have any viable explaination for this? I'm not particularly confortable with saying "sometimes it works and sometimes it doesn't"! Is this something that might happen when you have a report written in VS2005 but is running using sql server 2008. I ask because I noticed that when we run the report in our application which is using sql server 2005 it works fine but when we run it against the application where the report is VS2005 and the sql server is 2008 that is where the issue occurs. Thanks.

    Read the article

  • Logging to a file on Android

    - by Greg B
    Is there any way of retrieving log messages from an Android handset. I'm building an application which uses the GPS of my HTC Hero. I can run and debug the application from eclipse but this isn't a good use case of GPS, sat at my desk. When I fire the app up when I am walking around, I get an intermittent exception. Is there anyway I can output these exceptions to a text file on the SD card or output calls to Log.x("") to a text file so that I can see what the exception is. Thanks EDIT : Solution Here is the code I finally went with... Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread thread, Throwable ex) { PrintWriter pw; try { pw = new PrintWriter( new FileWriter(Environment.getExternalStorageDirectory()+"/rt.log", true)); ex.printStackTrace(pw); pw.flush(); pw.close(); } catch (IOException e) { e.printStackTrace(); } } }); I had to wrap the line pw = new PrintWriter(new FileWriter(Environment.getExternalStorageDirectory()+"/rt.log", true)); in a try/catch as Eclipse would not let me compile the app. It kept saying Unhandled exception type IOException 1 quick fix Sorround with try/catch So I did and it all works which is fine by me but it does make me wonder what Eclipse was on about...

    Read the article

  • Sqlite issues with HTC Desire HD

    - by Greg
    Recently I have been getting a lot of complaints about the HTC Desire series and it failing while invoking sql statements. I have received reports from users with log snapshots that contain the following. I/Database( 2348): sqlite returned: error code = 8, msg = statement aborts at 1: [pragma journal_mode = WAL;] E/Database( 2348): sqlite3_exec to set journal_mode of /data/data/my.app.package/files/localized_db_en_uk-1.sqlite to WAL failed followed by my app basically burning in flames because the call to open the database results in a serious runtime error that manifests itself as the cursor being left open. There shouldn't be a cursor at this point as we are trying to open it. This only occurs with the HTC Desire HD and Z. My code basically does the following (changed a little to isolate the problem area). SQLiteDatabase db; String dbName; public SQLiteDatabase loadDb(Context context) throws IOException{ //Close any old db handle if (db != null && db.isOpen()) { db.close(); } // The name of the database to use from the bundled assets. String dbAsset = "/asset_dir/"+dbName+".sqlite"; InputStream myInput = context.getAssets().open(dbAsset, Context.MODE_PRIVATE); // Create a file in the app's file directory since sqlite requires a path // Not ideal but we will copy the file out of our bundled assets and open it // it in another location. FileOutputStream myOutput = context.openFileOutput(dbName, Context.MODE_PRIVATE); byte[] buffer = new byte[1024]; int length; while ((length = myInput.read(buffer)) > 0) { myOutput.write(buffer, 0, length); } // Close the streams myOutput.flush(); // Guarantee Write! myOutput.getFD().sync(); myOutput.close(); myInput.close(); // Not grab the newly written file File fileObj = context.getFileStreamPath(dbName); // and open the database return db = SQLiteDatabase.openDatabase(fileObj.getAbsolutePath(), null, SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS); } Sadly this phone is only available in the UK and I don't have one in my inventory. I am only getting reports of this type from the HTC Desire series. I don't know what changed as this code has been working without any problem. Is there something I am missing?

    Read the article

  • Best way to use PL/SQL Pacakge Cursors from Pro*C

    - by Greg Reynolds
    I have a cursor defined in PL/SQL, and I am wondering what the best way to use it from Pro*C is. Normally for a cursor defined in Pro*C you would do: EXEC SQL DECLARE curs CURSOR FOR SELECT 1 FROM DUAL; EXEC SQL OPEN curs; EXEC SQL FETCH curs INTO :foo; EXEC SQL CLOSE cusr; I was hoping that the same (or similar) syntax would work for a packaged cursor. For example, I have a package MyPack, with a declaration type MyType is record (X integer); cursor MyCurs(x in integer) return MyType; Now I have in my Pro*C code a rather unsatisfying piece of embedded PL/SQL that opens the cursor, does the fetching etc., as I couldn't get the first style of syntax to work. Using the example EXEC SQL EXECUTE DECLARE XTable is table of MyPack.MyType; BEGIN OPEN MyPack.MyCurs(:param); FETCH MyPack.MyCurs INTO XTable; CLOSE MyPack.MyCurs; END; END-EXEC; Does anyone know if there is a more "Pure" Pro*C approach?

    Read the article

  • How can I save a directory tree to an array in PHP?

    - by Greg
    I'm trying to take a directory with the structure: top folder1 file1 folder2 file1 file2 And save it into an array like: array ( 'folder1' => array('file1'), 'folder2' => array('file1', 'file2') ) This way, I can easily resuse the tree throughout my site. I've been playing around with this code but it's still not doing what I want: private function get_tree() { $uploads = __RELPATH__ . DS . 'public' . DS . 'uploads'; $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($uploads), RecursiveIteratorIterator::SELF_FIRST); $output = array(); foreach($iterator as $file) { $relativePath = str_replace($uploads . DS, '', $file); if ($file->isDir()) { if (!in_array($relativePath, $output)) $output[$relativePath] = array(); } } return $output; }

    Read the article

  • JQuery cookie access has stopped working for GAE app

    - by Greg
    I have a google app engine app that has been running for some time, and some javascript code that checks for a login cookie has suddenly stopped working. As far as I can tell, NO code has changed. The relevant code uses the jquery cookies plugin (jquery.cookies.2.2.0.min.js)... // control the default screen depending // if someone is logged in if( $.cookies.get('dev_appserver_login') != null || $.cookies.get('ACSID') != null ) { alert("valid cookie!") $("#inventory-container").show(); } else { alert("INvalid cookie!") $("#welcome-container").show(); } The reason for the two checks is that in the GAE SDK, the cookies are named differently. The production system uses 'ACSID'. This if statement works in the SDK and now fails 100% of the time in production. I have verified that the cookie is, in fact, present when I inspect the page. Thoughts?

    Read the article

  • How to create programming flowchart/documentation from VB.NET source code?

    - by Greg
    Hi, what tools do you use to create programming flowchart/documentation from VB.NET source code? There are absolutely no comments/documentation at present. I am a beginner, i.e. I tried Sandcastle but it is way over my head and could not get it going, not even with GUI. Fatesoft's CodeVisual To Flowchart is OK but it is almost the same as the code and I still don't understand the code.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >