Search Results

Search found 1788 results on 72 pages for 'debugger'.

Page 58/72 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • How to find out where a thread lock happend?

    - by SchlaWiener
    One of our company's Windows Forms application had a strange problem for several month. The app worked very reliable for most of our customers but on some PC's (mostly with a wireless lan connection) the app sometimes just didn't respond anymore. (You click on the UI and windows ask you to wait or kill the app). I wasn't able to track down the problem for a long time but now I figured out what happend. The app had this line of code // don't blame me for this. Wasn't my code :D Control.CheckForIllegalCrossThreadCalls = false and used some background threads to modify the controls. No I found a way to reproduce the application stopping responding bug on my dev machine and tracked it down to a line where I actually used Invoke() to run a task in the main thread. Me.Invoke(MyDelegate, arg1, arg2) Obviously there was a thread lock somewhere. After removing the Control.CheckForIllegalCrossThreadCalls = false statement and refactoring the whole programm to use Invoke() if modifying a control from a background thread, the problem is (hopefully) gone. However, I am wondering if there is a way to find such bugs without debugging every line of code (Even if I break into debugger after the app stops responding I can't tell what happend last, because the IDE didn't jump to the Invoke() statement) In other words: If my apps hangs how can I figure out which line of code has been executed last? Maybe even on the customers PC. I know VS2010 offers some backwards debugging feature, maybe that would be a solution, but currently I am using VS2008.

    Read the article

  • Custom server control disappears from page when UpdatePanel updates

    - by Sasha
    Hi all. I created a custom asp.net server control. It works fine on a regular asp.net page and as a DOM object inside of the browser. But I've never used the UpdatePanel before and now I'm trying to make sure that this control works there as well. It doesn't. If I add my control to the page outside of an update panel and click some panel's inside button (trigger), everything works fine. But if I place my control inside of update panel and click that button again, the control "disappears" from the page completely. I still can see my control in javascript debugger and the update, meaning that the object itself is still in DOM. It looks like the panel just "hides" the outer div element of my control for some reason. I tried to call panel's Update() method on button click handler, set panel's UpdateMode to both Conditional and Always. All with the same result. How can I fix that? Thank you!

    Read the article

  • Porting a web application to work in IE7

    - by Bears will eat you
    I'm developing a web application that uses lots of Javascript and CSS, both of my own creation and through third-party libraries. These include jQuery and Google Maps & Visualization JS APIs. I've been testing everything in Firefox 3. Things are peachy until it turns out the main target of this webapp is (cue sad trombone) IE7. I'm looking for caveats, advice, libraries, or other references to help make this transition as easy as possible (not that it's actually going to be easy). I've already tried IE7.js though it hasn't yet shown itself to be the silver bullet I was hoping for. I'm sure that it works as advertised, I think it's just not as all-encompassing as I'd like (example: colors like #4684EE and #DC3912, which are correctly rendered in FF3, are rendered as black in IE7, with or without IE7.js). Are there other libraries out there to help bring IE7 (more) in line with FF3? A corollary question: what debugger would you recommend for IE7? I'm currently using Firebug Lite, but it runs painfully slowly. Is there anything out there with similar features that I might have missed?

    Read the article

  • Why won't WPF databindings show text when ToString() has a collaborating object?

    - by Jay
    In a simple form, I bind to a number of different objects -- some go in listboxes; some in textblocks. A couple of these objects have collaborating objects upon which the ToString() method calls when doing its work -- typically a formatter of some kind. When I step through the code I see that when the databinding is being set up, ToString() is called the collaborating object is not null and returns the expected result when inspected in the debugger, the objects return the expected result from ToString() BUT the text does not show up in the form. The only common thread I see is that these use a collaborating object, whereas the other bindings that show up as expected simply work from properties and methods of the containing object. If this is confusing, here is the gist in code: public class ThisThingWorks { private SomeObject some_object; public ThisThingWorks(SomeObject s) { some_object = s; } public override string ToString() { return some_object.name; } } public class ThisDoesntWork { private Formatter formatter; private SomeObject some_object; public ThisDoesntWork(SomeObject o, Formatter f) { formatter = f; some_object = o; } public override string ToString() { return formatter.Format(some_object.name); } } Again, let me reiterate -- the ToString() method works in every other context -- but when I bind to the object in WPF and expect it to display the result of ToString(), I get nothing. Update: The issue seems to be what I see as a buggy behaviour in the TextBlock binding. If I bind the Text property to a property of the DataContext that is declared as an interface type, ToString() is never called. If I change the property declaration to an implementation of the interface, it works as expected. Other controls, like Label work fine when binding the Content property to a DataContext property declared as either the implementation or the interface. Because this is so far removed from the title and content of this question, I've created a new question here: http://stackoverflow.com/questions/2917878/why-doesnt-textblock-databinding-call-tostring-on-a-property-whose-compile-tim

    Read the article

  • UILabel + IRR, KRW and KHR currencies with wrong symbol

    - by serb
    Hi, I'm experiencing issues when converting decimal to currency for Korean Won, Cambodian Riel and Iranian Rial and showing the result to the UILabel text. Conversion itself passes just fine and I can see correct currency symbol at the debugger, even the NSLog prints the symbol well. If I assign this NSString instance to the UILabel text, the currency symbol is shown as a crossed box instead of the correct symbol. There is no other code between, does not matter what font I use. I tried to print ? (Korean Won) using the unicode value (0x20A9) or even using UTF8 representation (\xe2\x82\xa9), but all I get is the crossed box on the label. Any other supported currency in iPhone SDK and NSLocale (nearly 170 currencies) works perfectly fine no matter how exotic the currency is. Anyone else experiencing the same problem? Is there a "cure" for this? Thanks EDIT: -(NSString *)decimalToCurrency:(NSDecimalNumber *)value byLocale:(NSLocale *)locale { NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init]; [fmt setLocale: locale]; [fmt setNumberStyle: NSNumberFormatterCurrencyStyle]; NSString *res = [fmt stringFromNumber: value]; [fmt release]; return res; } lbValue.text = [self decimalToCurrency: price byLocale: koreanLocale];

    Read the article

  • Rows added to table are not showing up

    - by Lars
    This has been asked before, but I have found no solution that worked for me yet: When adding rows to a table from code, the rows are not showing up in the application. There is one row I specified in XML, that one is showing up, but nothing below it. This is the code: public void addRow(LocationMessage locationMsg){ View messageView = theInflater.inflate(R.layout.homepage, null); TableLayout table = (TableLayout)messageView.findViewById(R.id.distanceTable); TextView senderNameTextView = new TextView(thisContext); senderNameTextView.setText(locationMsg.getSenderName()); TableRow tr = new TableRow(thisContext); tr.addView(distanceTextView); table.addView(tr); rows.addFirst(messageView); } homepage.xml contains this, I removed some elements and parameters: <?xml version="1.0" encoding="utf-8"?> <LinearLayout> <TabHost> <TabWidget /> <FrameLayout> [..] <LinearLayout> [..] <TableLayout android:id="@+id/distanceTable" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:background="#DDDDDD" android:stretchColumns="1" > <TableRow> <TextView android:textColor="#000000" android:text="@string/label_device" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_distance" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_time" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> </TableRow> </TableLayout> </LinearLayout> </FrameLayout> </TabHost> </LinearLayout> Unfortunately hierarchyviewer.bat doesn't work for me in order to check if the rows are there but just not visible. In the debugger it looks fine to me.

    Read the article

  • Using reflection to find all linq2sql tables and ensure they match the database

    - by Jake Stevenson
    I'm trying to use reflection to automatically test that all my linq2sql entities match the test database. I thought I'd do this by getting all the classes that inherit from DataContext from my assembly: var contexttypes = Assembly.GetAssembly(typeof (BaseRepository<,>)).GetTypes().Where( t => t.IsSubclassOf(typeof(DataContext))); foreach (var contexttype in contexttypes) { var context = Activator.CreateInstance(contexttype); var tableProperties = type.GetProperties().Where(t=> t.PropertyType.Name == typeof(ITable<>).Name); foreach (var propertyInfo in tableProperties) { var table = (propertyInfo.GetValue(context, null)); } } So far so good, this loops through each ITable< in each datacontext in the project. If I debug the code, "table" is properly instantiated, and if I expand the results view in the debugger I can see actual data. BUT, I can't figure out how to get my code to actually query that table. I'd really like to just be able to do table.FirstOrDefault() to get the top row out of each table and make sure the SQL fetch doesn't fail. But I cant cast that table to be anything I can query. Any suggestions on how I can make this queryable? Just the ability to call .Count() would be enough for me to ensure the entities don't have anything that doesn't match the table columns.

    Read the article

  • LuaEdit can't find module when Lua files all in the same folder

    - by joverboard
    I downloaded LuaEdit to use as an IDE and debug tool however I'm having trouble using it for even the simplest things. I've created a solution with 2 files in it, all of which are stored in the same folder. My files are as follows: --startup.lua require("foo") test("Testing", "testing", "one, two, three") --foo.lua foo = {} print("In foo.lua") function test(a,b,c) print(a,b,c) end This works fine when in my C++ compiler when accessed through some embed code, however when I attempt to use the same code in LuaEdit, it crashes on line 3 require("foo") with an error stating: module 'foo' not found: no field package.preload['foo'] no file 'C:\Program Files (x86)\LuaEdit 2010\lua\foo.lua' no file 'C:\Program Files (x86)\LuaEdit 2010\lua\foo\init.lua' no file 'C:\Program Files (x86)\LuaEdit 2010\foo.lua' no file 'C:\Program Files (x86)\LuaEdit 2010\foo\init.lua' no file '.\foo.lua' no file 'C:\Program Files (x86)\LuaEdit 2010\foo.dll' no file 'C:\Program Files (x86)\LuaEdit 2010\loadall.dll' no file '.\battle.dll' I have also tried creating these files prior to adding them to a solution and still get the same error. Is there some setting I'm missing? It would be great to have an IDE/debugger but it's useless to me if it can't run linked functions.

    Read the article

  • iOS Simulator is black on app execution

    - by Terryn
    I am running xcode 5.1.1 and have been trying to learn objective C / iOS development. Right now whenever I try to run my code on the emulator (I do not have an actual device atm) it comes up with a black screen. Code can be found here. Compiling and running gives me the following error: 2014-08-23 10:42:57.429 Calculator[1862:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<XYZViewController 0xe436640> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key didgetPressed.' *** First throw call stack: ( 0 CoreFoundation 0x017ed1e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x0156c8e5 objc_exception_throw + 44 2 CoreFoundation 0x0187cfe1 -[NSException raise] + 17 3 Foundation 0x0122cd9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 4 Foundation 0x011991d7 _NSSetUsingKeyValueSetter + 88 5 Foundation 0x01198731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 6 Foundation 0x011fab0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 7 UIKit 0x004e31f4 -[UIRuntimeOutletConnection connect] + 106 8 libobjc.A.dylib 0x0157e7de -[NSObject performSelector:] + 62 9 CoreFoundation 0x017e876a -[NSArray makeObjectsPerformSelector:] + 314 10 UIKit 0x004e1d4d -[UINib instantiateWithOwner:options:] + 1417 11 UIKit 0x0034a6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 12 UIKit 0x0034ae9d -[UIViewController loadView] + 302 13 UIKit 0x0034b0d3 -[UIViewController loadViewIfRequired] + 78 14 UIKit 0x0034b5d9 -[UIViewController view] + 35 15 UIKit 0x0026b267 -[UIWindow addRootViewControllerViewIfPossible] + 66 16 UIKit 0x0026b5ef -[UIWindow _setHidden:forced:] + 312 17 UIKit 0x0026b86b -[UIWindow _orderFrontWithoutMakingKey] + 49 18 UIKit 0x002763c8 -[UIWindow makeKeyAndVisible] + 65 19 UIKit 0x00226bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097 20 UIKit 0x0022b667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 21 UIKit 0x0023ff92 -[UIApplication handleEvent:withNewEvent:] + 3517 22 UIKit 0x00240555 -[UIApplication sendEvent:] + 85 23 UIKit 0x0022d250 _UIApplicationHandleEvent + 683 24 GraphicsServices 0x037e2f02 _PurpleEventCallback + 776 25 GraphicsServices 0x037e2a0d PurpleEventCallback + 46 26 CoreFoundation 0x01768ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 27 CoreFoundation 0x017689db __CFRunLoopDoSource1 + 523 28 CoreFoundation 0x0179368c __CFRunLoopRun + 2156 29 CoreFoundation 0x017929d3 CFRunLoopRunSpecific + 467 30 CoreFoundation 0x017927eb CFRunLoopRunInMode + 123 31 UIKit 0x0022ad9c -[UIApplication _run] + 840 32 UIKit 0x0022cf9b UIApplicationMain + 1225 33 Calculator 0x00002c8d main + 141 34 libdyld.dylib 0x01e34701 start + 1 35 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) I have attempted the following things, and so far nothing has worked 1) checked the deployment info, it has the main interface set to main 2) double checked all break points to turn them off and disabled all of them through Debug-Disable Breakpoints 3) Reset Content and Settings on the iOS Simulator. 4) Checked the issue with the LLDB Debugger, however from what I have read the issue is no longer present with the 5.1.1 xcode. 5) checked the local host is still set to 127.0.0.1 Thanks! - Terryn

    Read the article

  • Memory leaks after using typeinfo::name()

    - by icabod
    I have a program in which, partly for informational logging, I output the names of some classes as they are used (specifically I add an entry to a log saying along the lines of Messages::CSomeClass transmitted to 127.0.0.1). I do this with code similar to the following: std::string getMessageName(void) const { return std::string(typeid(*this).name()); } And yes, before anyone points it out, I realise that the output of typeinfo::name is implementation-specific. According to MSDN The type_info::name member function returns a const char* to a null-terminated string representing the human-readable name of the type. The memory pointed to is cached and should never be directly deallocated. However, when I exit my program in the debugger, any "new" use of typeinfo::name() shows up as a memory leak. If I output the information for 2 classes, I get 2 memory leaks, and so on. This hints that the cached data is never being freed. While this is not a major issue, it looks messy, and after a long debugging session it could easily hide genuine memory leaks. I have looked around and found some useful information (one SO answer gives some interesting information about how typeinfo may be implemented), but I'm wondering if this memory should normally be freed by the system, or if there is something i can do to "not notice" the leaks when debugging. I do have a back-up plan, which is to code the getMessageName method myself and not rely on typeinfo::name, but I'd like to know anyway if there's something I've missed.

    Read the article

  • Spring 3 MVC validation BindingResult doesn't contain any errors

    - by Travelsized
    I'm attempting to get a Spring 3.0.2 WebMVC project running with the new annotated validation support. I have a Hibernate entity annotated like this: @Entity @Table(name = "client") public class Client implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "clientId", nullable = false) @NotEmpty private Integer clientId; @Basic(optional = false) @Column(name = "firstname", nullable = false, length = 45) @NotEmpty @Size(min=2, max=45) private String firstname; ... more fields, getters and setters } I've turned on mvc annotation support in my applicationContext.xml file: <mvc:annotation-driven /> And I have a method in my controller that responds to a form submission: @RequestMapping(value="/addClient.htm") public String addClient(@ModelAttribute("client") @Valid Client client, BindingResult result) { if(result.hasErrors()) { return "addClient"; } service.storeClient(client); return "clientResult"; } When my app loads in the server, I can see in the server log file that it loads a validator: 15 [http-8084-2] INFO org.hibernate.validator.util.Version - Hibernate Validator 4.0.2.GA The problem I'm having is that the validator doesn't seem to kick in. I turned on the debugger, and when I get into the controller method, the BindingResult contains 0 errors after I submit an empty form. (The BindingResult does show that it contains the Client object as a target.) It then proceeds to insert a record without an Id and throws an exception. If I fill out an Id but leave the name blank, it creates a record with the Id and empty fields. What steps am I missing to get the validation working?

    Read the article

  • Mail Rule to Run Applescript Not Working?

    - by William Andy Hainline
    Question for my fellow AppleScripters. I have the following script which runs just fine if you run it in AppleScript Editor or Script Debugger, but that won't run at all if you try to run it from a Mail rule. The script is correctly placed in ~/Library/Application Scripts/com.apple.mail, and shows up in the "Run AppleScript" menu in the Mail rule, but simply refuses to work when new mail arrives. on perform_mail_action(info) tell application "Mail" set theMessages to |SelectedMessages| of info repeat with thisMessage in theMessages set AppleScript's text item delimiters to {""} set thisSender to sender of thisMessage as string set quotepos to offset of "\"" in thisSender if (quotepos is not 0) then set thisSender to (text items (quotepos + 1) through -1) ¬ of thisSender as string set quotepos to offset of "\"" in thisSender if (quotepos is not 0) then set thisSender to (text items 1 through (quotepos - 1)) ¬ of thisSender as string end if else set atpos to offset of "@" in thisSender if (atpos is not 0) then set thisSender to (text items 1 through (atpos - 1)) ¬ of thisSender as string end if set brkpos to offset of "<" in thisSender if (brkpos is not 0) then set thisSender to (text items (brkpos + 1) through -1) ¬ of thisSender as string end if end if tell application "Finder" to say "Mail from " & thisSender end repeat end tell end perform_mail_action Any ideas?

    Read the article

  • Delphi SQLite Update causing errors to appear.

    - by NeoNMD
    I have used Inserts, selects, updates, deleted without problem all over the program but for some reason this specific section causes it to except and not run the SQL I send it. I am trying to "UPDATE SectionTable(AreaID) VALUES ('+IntToStr(ActClient.AreaID)+') WHERE SectionID='+IntToStr(iCount)" The section with the ID "iCount" exists deffinately. The ActClient.AreaID is "2" and its overwriting null data in the "SectionTable" table. What is the problem here? OpenDatabase(slDb); sltb:=sldb.GetTable('SELECT * FROM SectionTable WHERE SectionID='+IntToStr(iCount)); OutputDebugString(PAnsiChar(sltb.FieldAsString(sltb.FieldIndex['SectionID'])+sltb.FieldAsString(sltb.FieldIndex['Gender'])+sltb.FieldAsString(sltb.FieldIndex['CompetitionID']))); sSQL := 'UPDATE SectionTable(AreaID) VALUES ('+IntToStr(ActClient.AreaID)+') WHERE SectionID='+IntToStr(iCount); sldb.ExecSQL(sSQL); CloseDatabase(slDb); I get this error message appear when this is ran. --------------------------- Debugger Exception Notification --------------------------- Project CompetitionServer.exe raised exception class ESQLiteException with message 'Error executing SQL. Error [1]: SQL error or missing database. "UPDATE SectionTable(AreaID) VALUES (2) WHERE SectionID=2": near "(": syntax error'. Process stopped. Use Step or Run to continue. --------------------------- OK Help ---------------------------

    Read the article

  • Why might my PHP log file not entirely be text?

    - by Fletcher Moore
    I'm trying to debug a plugin-bloated Wordpress installation; so I've added a very simple homebrew logger that records all the callbacks, which are basically listed in a single, ultimately 250+ row multidimensional array in Wordpress (I can't use print_r() because I need to catch them right before they are called). My logger line is $logger->log("\t" . $callback . "\n"); The logger produces a dandy text file in normal situations, but at two points during this particular task it is adding something which causes my log file to no longer be encoded properly. Gedit (I'm on Ubuntu) won't open the file, claiming to not understand the encoding. In vim, the culprit corrupt callback (which I could not find in the debugger, looking at the array) is about in the middle and printed as ^@lambda_546 and at the end of file there's this cute guy ^M. The ^M and ^@ are blue in my vim, which has no color theme set for .txt files. I don't know what it means. I tried adding an is_string($callback) condition, but I get the same results. Any ideas?

    Read the article

  • ASP.NET MVC 2 - Custom route doesn't find controller action

    - by mcfroob
    For some reason my application isn't routing to my controller method correctly. I have a routelink like this in my webpage - <%= Html.RouteLink("View", "Blog", new { id=(item.BlogId), slug=(item.Slug) }) %> In global.asax.cs I have the following routes - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "MoreBlogs", "Blog/Page/{page}", new { controller = "Blog", action = "Index" } ); routes.MapRoute( "Blog", "Blog/View/{id}/{slug}", new { controller = "Blog", action = "View"} ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Blog", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); And then I have a class BlogController that has a method - public ActionResult View(int id, string slug) { ... etc. } I put a breakpoint in the first line of the View method but it's not getting hit at all. I checked with a route debugger for the format localhost/Blog/View/1/test and it matched my custom route. All I'm getting is a 404 while running this, I can't work out why the route won't post to the view method in my controller - any ideas?

    Read the article

  • SQL Aggregate all Purchases for a certain product with same rebatecode

    - by debuggerlikeanother
    Hi SO, i would like to aggregate all purchases for a certain product that used the same rebatecode (using SQL Server 2005) Assume we have the following table: ID ProductID Product RebateCode Amount 1 123 7HM ABC 1 2 123 7HM XYZ 2 3 124 7HM ABC 10 4 124 7HM XYZ 20 5 125 2EB LOI 4 6 126 2EB LOI 40 CREATE TABLE #ProductSales(ID SMALLINT, ProductID int, Product varchar(6), RebateCode varchar(4), Amount int) GO INSERT INTO #ProductSales select 1, 123, '7HM', 'A', 1 union all select 2, 123, '7HM', 'B', 2 union all select 3, 124, '7HM', 'A', 10 union all select 4, 124, '7HM', 'B', 20 union all select 5, 125, '7HM', 'A', 100 union all select 6, 125, '7HM', 'B', 200 union all select 7, 125, '7HM', 'C', 3 union all select 8, 126, '2EA', 'E', 4 union all select 8, 127, '2EA', 'E', 40 union all select 9, 128, '2EB', 'F', 5 union all select 9, 129, '2EB', 'F', 50 union all select 10, 130, '2EB', 'F', 500 GO SELECT * FROM #ProductSales GO /* And i would like to have the following result Product nrOfProducts CombinationRebateCode SumAmount ABC LOI XYZ 7HM 2 ABC, XYZ 33 11 0 22 2EB 2 LOI 44 0 44 0 .. */ CREATE TABLE #ProductRebateCode(Product varchar(6), nrOfProducts int, sumAmountRebateCombo int, rebateCodeCombination varchar(80), A int, B int, C int, E int, F int) Go INSERT INTO #ProductRebateCode select '7HM', 2, 33, 'A, B', 2, 2, 0, 0, 0 union all select '7HM', 1, 303, 'A, B, C', 1, 1, 1, 0, 0 union all select '2EA', 2, 44, 'E', 0, 0, 0, 2, 0 union all select '2EB', 3, 555, 'E', 0, 0, 0, 0, 2 Select * from #ProductRebateCode -- Drop Table #ProductSales IF EXISTS ( SELECT * FROM tempdb.dbo.sysobjects WHERE name LIKE '#ProductSales%') DROP TABLE #ProductSales -- Drop Table #ProductRebateCode IF EXISTS ( SELECT * FROM tempdb.dbo.sysobjects WHERE name LIKE '#ProductRebateCode%') DROP TABLE #ProductRebateCode I would like to have the result like in the example (see second select (#ProductRebateCode). I tried to achieve it with the crosstab from this post: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6216&whichpage=6. exec CrossTab2b @SQL = 'SELECT [ProductID], Product, RebateCode, Amount FROM #ProductSales' ,@PivotCol = 'RebateCode' ,@Summaries = 'Sum(Amount ELSE 0)[_Sum], Count([ProductID])[_nrOfProducts]' /* SUM(Amount ELSE 0)[Amount], COUNT(Amount)[Qty] */ ,@GroupBy = 'RebateCode, Product' ,@OtherFields = 'Product' I believe that this could work, but i am unable to solve it. Do you believe that it is possible to achieve what i am trying without MDX or the other fancy ?DX-Stuff? Best regards And Thanks a lot debugger the other

    Read the article

  • In a combobox, how do I determine the highlighted item (not selected item)?

    - by Harold Bamford
    First, fair warning: I am a complete newbie with C# and WPF. I have a combobox (editable, searchable) and I would like to be able to intercept the Delete key and remove the currently highlighted item from the list. The behavior I'm looking for is like that of MS Outlook when entering in email addresses. When you give a few characters, a dropdown list of potential matches is displayed. If you move to one of these (with the arrow keys) and hit Delete, that entry is permanently removed. I want to do that with an entry in the combobox. Here is the XAML (simplified): <ComboBox x:Name="Directory" KeyUp="Directory_KeyUp" IsTextSearchEnabled="True" IsEditable="True" Text="{Binding Path=CurrentDirectory, Mode=TwoWay}" ItemsSource="{Binding Source={x:Static self:Properties.Settings.Default}, Path=DirectoryList, Mode=TwoWay}" / The handler is: private void Directory_KeyUp(object sender, KeyEventArgs e) { ComboBox box = sender as ComboBox; if (box.IsDropDownOpen && (e.Key == Key.Delete)) { TrimCombobox("DirectoryList", box.HighlightedItem); // won't compile! } } When using the debugger, I can see box.HighlightedItem has the value I want but when I try and put in that code, it fails to compile with: System.Windows.Controls.ComboBox' does not contain a definition for 'HighlightedItem'... So: how do I access that value? Keep in mind that the item has not been selected. It is merely highlighted as the mouse hovers over it. Thanks for your help.

    Read the article

  • Instrumenting a string

    - by George Polevoy
    Somewhere in C++ era i have crafted a library, which enabled string representation of the computation history. Having a math expression like: TScalar Compute(TScalar a, TScalar b, TScalar c) { return ( a + b ) * c; } I could render it's string representation: r = Compute(VerbalScalar("a", 1), VerbalScalar("b", 2), VerbalScalar("c", 3)); Assert.AreEqual(9, r.Value); Assert.AreEqual("(a+b)*c==(1+2)*3", r.History ); C++ operator overloading allowed for substitution of a simple type with a complex self-tracking entity with an internal tree representation of everything happening with the objects. Now i would like to have the same possibility for NET strings, only instead of variable names i would like to see a stack traces of all the places in code which affected a string. And i want it to work with existing code, and existing compiled assemblies. Also i want all this to hook into visual studio debugger, so i could set a breakpoint, and see everything that happened with a string. Which technology would allow this kind of things? I know it sound like an utopia, but I think visual studio code coverage tools actually do the same kind of job while instrumenting the assemblies.

    Read the article

  • How do I make software that preserves database integrity and correctness? Please help, confused.

    - by user287745
    i have made an application project in vs 08 c#, sql server from vs 08. the database has like 20 tables and many fields in each have made an interface for adding deleting editting and retrieving data according to predefined needs of the users. now i have to 1) make to project in to a software which i can deliver to professor. that is he can just double click the icon and the software simply starts. no vs 08 needed to start the debugging 2) the database will be on one powerful computer (dual core latest everything win xp) and the user will access it from another computer connected using LAN i am able to change the connection string to the shared database using vs 08/ debugger whenever the server changes but how am i supposed to do that when its a software? 3)there will by many clients am i supposed to give the same software to every one, so they all can connect to the database, how will the integrity and correctness of the database be maintained? i mean the db.mdf file will be in a folder which will be shared with read and write access. so its not necessary that only one user will write at a time. so is there any coding for this or? please help me out here i am stuck do not know what to do i have no practical experience, would appreciate all the help thank you

    Read the article

  • C++ class with char pointers returning garbage

    - by JMP
    I created a class "Entry" to handle Dictionary entries, but in my main(), I create the Entry() and try to cout the char typed public members, but I get garbage. When I look at the Watch list in debugger, I see the values being set, but as soon as I access the values, there is garbage. Can anyone elaborate on what I might be missing? #include <iostream> using namespace std; class Entry { public: Entry(const char *line); char *Word; char *Definition; }; Entry::Entry(const char *line) { char tmp[100]; strcpy(tmp, line); Word = strtok(tmp, ",") + '\0'; Definition = strtok(0,",") + '\0'; } int main() { Entry *e = new Entry("drink,What you need after a long day's work"); cout << "Word: " << e->Word << endl; cout << "Def: " << e->Definition << endl; cout << endl; delete e; e = 0; return 0; }

    Read the article

  • FormsAuthentication authCookie is null only for some users

    - by mbalkema
    I am experiencing a strange problem with asp.net forms authentication. This problem only occurs for 3 users out of 30+ users that have successfully logged in. I am using very basic auth code that I have used many times and have never seen this problem. After the users successfully authenticates and the auth cookie is created, cookie added, and response.redirect to FormsAuthentication.GetRedirect(userid, false) is called. The Application_AuthenticateRequest method in Global.asax is hit. // Extract the forms authentication cookie string cookieName = FormsAuthentication.FormsCookieName; HttpCookie authCookie = Context.Request.Cookies[cookieName]; if (null == authCookie) { // There is no authentication cookie. return; } So immediately after a "good" cookie is saved and the redirect occurs the cookie is null. I have run the code through the debugger and the cookie is only null on these 3 users. But the cookie looks the same as the cookie for the many users that login successfully. Any ideas? This is standard code that should just work.

    Read the article

  • Limit CPU usage of a process

    - by jb
    I have a service running which periodically checks a folder for a file and then processes it. (Reads it, extracts the data, stores it in sql) So I ran it on a test box and it took a little longer thaan expected. The file had 1.6 million rows, and it was still running after 6 hours (then I went home). The problem is the box it is running on is now absolutely crippled - remote desktop was timing out so I cant even get on it to stop the process, or attach a debugger to see how far through etc. It's solidly using 90%+ CPU, and all other running services or apps are suffering. The code is (from memory, may not compile): List<ItemDTO> items = new List<ItemDTO>(); using (StreamReader sr = fileInfo.OpenText()) { while (!sr.EndOfFile) { string line = sr.ReadLine() try { string s = line.Substring(0,8); double y = Double.Parse(line.Substring(8,7)); //If the item isnt already in the collection, add it. if (items.Find(delegate(ItemDTO i) { return (i.Item == s); }) == null) items.Add(new ItemDTO(s,y)); } catch { /*Crash*/ } } return items; } - So I am working on improving the code (any tips appreciated). But it still could be a slow affair, which is fine, I've no problems with it taking a long time as long as its not killing my server. So what I want from you fine people is: 1) Is my code hideously un-optimized? 2) Can I limit the amount of CPU my code block may use? Cheers all

    Read the article

  • jquery autosuggest: what is wrong with this code?

    - by Abu Hamzah
    i have been struggling to make it work my autosugest/autocomplete and its acting strange unless i am doing completely silly here. please have a look 1) does not do anything, does not work or nor fire the event. <script src="Scripts/jquery-1.4.2.js" type="text/javascript"></script> <script src="Scripts/jquery.autocomplete.js" type="text/javascript"></script> <form id="form1" runat="server"> <script type="text/javascript"> $(document).ready(function() { $("#<%=txtHost.UniqueID %>").autocomplete("HostService.asmx/GetHosts", { dataType: 'json' , contentType: "application/json; charset=utf-8" , parse: function(data) { var rows = Array(); debugger for (var i = 0; i < data.length; i++) { rows[i] = { data: data[i], value: data[i].LName, result: data[i].LName }; } return rows; } , formatItem: function(row, i, max) { return data.LName + ", " + data.FName; } }); }); </script> 2) this works if i remove the above code and replace with this code: <script type="text/javascript"> $(document).ready(function() { $("#txtHost").autocomplete("lazy blazy crazy daisy maisy ugh".split(" ")); }); </script> any help ?

    Read the article

  • Bizzare results when running two Visual Studio Express C++ 2008 solutions

    - by Jamie Keeling
    This is a follow on from my previous question although this is about something else. I've been having a problem where for some reason my message that I pass from one process to another only displays the first letter, in this case "M". My application based on a MSDN sample so to make sure I hadn't missed something I create a seperate solution, added the MSDN sample (Without any changes for my needs) and unsuprisingly it works fine. Now for the weird bit, when I run the MSDN sample running (As in debugging) and have my own application running, the text prints out fine without any problems. The second I run my on it's own without the original MSDN sample being open it fails to work and only shows an "M". I've looked in the debugger and don't seem to notice anything suspicious (It's a slightly dated picture, I've fixed the data type inconsistency). Can anyone provide a solution as to this? I've never encountered anything like this before. To look at my source code it's easier to just look at the link I posted at the top of the question, there's no point in me posting it twice. Thank you for any help.

    Read the article

  • object.valid? returns false but object.errors.full_messages is empty

    - by user549563
    Hello I'm confuse about objects that I can't save, simplified model is class Subscription < ActiveRecord::base belongs_to :user, :class_name => "User", :foreign_key => "user_id" has_many :transactions, :class_name => "SubscriptionTransaction" validates_presence_of :first_name, :message => "ne peut être vide" validates_presence_of :last_name, :message => "ne peut être vide" validates_presence_of :card_number, :message => "ne peut être vide" validates_presence_of :card_verification, :message => "ne peut être vide" validates_presence_of :card_type, :message => "ne peut être vide" validates_presence_of :card_expires_on, :message => "ne peut être vide" attr_accessor :card_number, :card_verification validate_on_create :validate_card def validate_card unless credit_card.valid? credit_card.errors.full_messages.each do |message| errors.add_to_base message end end end def credit_card @credit_card ||= ActiveMerchant::Billing::CreditCard.new( :type => card_type, :number => card_number, :verification_value => card_verification, :month => card_expires_on.month, :year => card_expires_on.year, :first_name => first_name, :last_name => last_name ) end end and in my subscription_controller if subscription.save # do something else debugger # means breakpoint where i try subscription.errors.full_messages # do something else end I tried to use ruby-debug for this adding a breakpoint before. And subscription.valid? return false which explains that ActiveRecord doesn't allow the save method. Unfortunately i can't know why the object is invalid. subscription.errors.full_messages # => [] I'm stucked, if you have any idea, thank you.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >