Search Results

Search found 1214 results on 49 pages for 'jeff sheldon'.

Page 12/49 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How you would you describe the Observer pattern in beginner language?

    - by Sheldon
    Currently, my level of understanding is below all the coding examples on the web about the Observer Pattern. I understand it simply as being almost a subscription that updates all other events when a change is made that the delegate registers. However, I'm very unstable in my true comprehension of the benefits and uses. I've done some googling, but most are above my level of understanding. I'm trying to implement this pattern with my current homework assignment, and to truly make sense on my project need a better understanding of the pattern itself and perhaps an example to see what its use. I don't want to force this pattern into something just to submit, I need to understand the purpose and develop my methods accordingly so that it actually serves a good purpose. My text doesn't really go into it, just mentions it in one sentence. MSDN was hard for me to understand, as I'm a beginner on this, and it seems more of an advanced topic. How would you describe this Observer pattern and its uses in C# to a beginner? For an example, please keep code very simple so I can understand the purpose more than complex code snippets. I'm trying to use it effectively with some simple textbox string manipulations and using delegates for my assignment, so a pointer would help!

    Read the article

  • Weak References and Disposable objects.

    - by Steve Sheldon
    In C# it is possible to create weak references to objects as described here: WeakReference Class In .net some classes also implement the IDisposable interface. Calling the Dispose method of this interface is performed to manually dispose of any managed or unmanaged resources currently being held onto. An example might be a Bitmap object or class. If I assign an object that implements IDisposable to a weak reference, will Dispose be called if the weak reference collects the object?

    Read the article

  • javafx doesnt repaint label till method has finished, why?

    - by jeff porter
    Hi all, I have a JavaFX app with a some code like this... public class MainListener extends EventListener{ override public function event (arg0 : String) : Void { statusText.content = arg0; } } statusText is defined like this... var statusText = Text { x: 30 y: stageHeight - 40 font: Font { name: "Bitstream Vera Sans Bold" size: 10 } wrappingWidth: 420 fill: Color.WHITE textAlignment: TextAlignment.CENTER content: "Status: awaiting DBF file." }; I also have some other Javacode that is load data, much like this.. public ArrayList<CustomerRecord> read(EventListener listener) { ArrayList<CustomerRecord> listOfCustomerRecords = new ArrayList<CustomerRecord>(); listener.event("Status: Starting read"); // ** takes a while... List<Map<String, CustomerField>> customerRecords = new Reader(file).readData(listener); // ** long running method over. listener.event("Status: Loaded all customers, count:" + listOfCustomerRecords.size()); return listOfCustomerRecords; } Now while the last method is in its long running call, I would expect to see my statusText updated to have 'Status: Starting read', but its doesn't. Its only when the read() method returns that the text is updated. If its was 'straight' java I would presume that the long running job is hogging the CPU, or the statusText needed to have repaint() called on it. Can anyone give me any ideas? Thanks Jeff Porter

    Read the article

  • Open .NET app from Web Page.

    - by Sheldon
    Hi, I just need to be able to open a .NET app (click once) from within an ASP.NET web page, and pass 2 string parameter to the app. How can I do this? Any example please, with any method to do it. Thank you in advance.

    Read the article

  • ImageMagick: Tiff to PDF from PHP

    - by Sheldon
    How can I convert 2 tiff images to PDF, I already knows how to get the image out of the DB, and I print it using echo and setting up the MIME type. But, right know I need to use a duplex printer option, so I need a way to generate a PDF from inside my PHP page, that PDF must containt both TIFF images (one per page) How can I do that? What do I need for php to work with that library. Thank you very much. EDIT: Is a self hosted app, I own the server (actually I'm using WAMP 2). I extract the images from the MySQL DB (stored using LONGBLOBS).

    Read the article

  • Javascript new object (function ) vs inline invocation

    - by Sheldon Ross
    Is there any considerations to determine which is better practice for creating an object with private members? var object = new function () { var private = "private variable"; return { method : function () { ..dosomething with private; } } } VS var object = function () { ... }(); Basically what is the difference between using NEW here, and just invoking the function immediately after we define it?

    Read the article

  • Javascript getElementsByTagName broken firefox?

    - by Sheldon Ross
    I'm getting the weirdest issues with Javascript in Firefox today. I'm trying to manipulate some table rows, but .getElementsByTagName("tr"); is pulling back junk. dynamicTable.tableBody = dynamicTable.getElementsByTagName("tbody")[0]; var tableRows = dynamicTable.tableBody.getElementsByTagName("TR"); var actualTableRows = new Array(); for(var i in tableRows) { var row = tableRows[i]; alert(row.tagName); if(row.tagName == "TR"){ actualTableRows.push(row); } } dynamicTable.bodyRows = actualTableRows; The puzzling part of course is my temporary hack to fix the error. For some reason .getElementsByTagName("tr") is pulling back some functions also. Incidently the alert above goes something like this TR TR TR TR undefined undefined undefined. The code I wanted was something like this dynamicTable.bodyRows = dynamicTable.tableBody.getElementsByTagName("tr"); But then bodyrows does not contain just tr elements it has the aforementioned junk in it. Any thoughts?

    Read the article

  • How to append \line into RTF using RichTextBox control

    - by Steve Sheldon
    When using the Microsoft RichTextBox control it is possible to add new lines like this... richtextbox.AppendText(System.Environment.NewLine); // appends \r\n However, if you now view the generated rtf the \r\n characters are converted to \par not \line How do I insert a \line control code into the generated RTF? What does't work: Token Replacement Hacks like inserting a token at the end of the string and then replacing it after the fact, so something like this: string text = "my text"; text = text.Replace("||" "|"); // replace any '|' chars with a double '||' so they aren't confused in the output. text = text.Replace("\r\n", "_|0|_"); // replace \r\n with a placeholder of |0| richtextbox.AppendText(text); string rtf = richtextbox.Rtf; rtf.Replace("_|0|_", "\\line"); // replace placeholder with \line rtf.Replace("||", "|"); // set back any || chars to | This almost worked, it breaks down if you have to support right to left text as the right to left control sequence always ends up in the middle of the placeholder. Sending Key Messages public void AppendNewLine() { Keys[] keys = new Keys[] {Keys.Shift, Keys.Return}; SendKeys(keys); } private void SendKeys(Keys[] keys) { foreach(Keys key in keys) { SendKeyDown(key); } } private void SendKeyDown(Keys key) { user32.SendMessage(this.Handle, Messages.WM_KEYDOWN, (int)key, 0); } private void SendKeyUp(Keys key) { user32.SendMessage(this.Handle, Messages.WM_KEYUP, (int)key, 0); } This also ends up being converted to a \par Is there a way to post a messaged directly to the msftedit control to insert a control character? I am totally stumped, any ideas guys? Thanks for your help!

    Read the article

  • Start with remoting or with WCF

    - by Sheldon
    Hi. I'm just starting with distributed application development. I need to create (all by myself) an enterprise application for document management. That application will run on an intranet (within the firewall, no internet access is required now, BUT is probably that will be later). The application needs to manage images that will be stored within MySQL Server (as blobs) and those images will be then recovered by the app and eventually one or more of them will be converted to PDF. Performance is the most important non-functional requirement. I have a couple of doubts. What do you suggest to use, .NET Remoting or WCF over TCP-IP (I think second one is the best for the moment I need to expose the business logic over internet, changing the protocol). Where do you suggest to make the transformation of the images to pdf files, I'm using iText. (I have thought to have the business logic stored within the IIS and exposed via WCF, and that business logic to be responsible of getting the images and transforming them to PDF, that because the IIS and the MySQL Server are the same physical machine). I ask about where to do the transformation because the app must be accessible from multiple devices, and for example, for mobile devices, the pdf maybe is not necessary. Thank you very much in advance.

    Read the article

  • C# Step by Step Execution

    - by Sheldon
    Hi. I'm building an app that uses and scanner API and a image to other format converter. I have a method (actually a click event) that do this: private void ButtonScan&Parse_Click(object sender, EventArgs e) { short scan_result = scanner_api.Scan(); if (scan_result == 1) parse_api.Parse(); // This will check for a saved image the scanner_api stores on disk, and then convert it. } The problem is that the if condition (scan_result == 1) is evaluated inmediatly, so it just don't work. How can I force the CLR to wait until the API return the convenient result. NOTE Just by doing something like: private void ButtonScan&Parse_Click(object sender, EventArgs e) { short scan_result = scanner_api.Scan(); MessageBox.Show("Result = " + scan_result); if (scan_result == 1) parse_api.Parse(); // This will check for a saved image the scanner_api stores on disk, and then convert it. } It works and display the results. Is there a way to do this, how? Thank you very much!

    Read the article

  • The program fails to display `cout` when it is run

    - by Jeff - FL
    Hello, I justed started a C++ course & I wrote, compiled, debugged & ran my first program: // This program calculates how much a little league team spent last year to purchase new baseballs. #include <iostream> using namespace std; int baseballs; int cost; int total; int main() { baseballs, cost, total; // Get the number of baseballs were purchased. cout << "How many baseballs were purchased? "; cin >> baseballs; // Get the cost of baseballs purchased. cout << "What was the cost of each baseball purchased? "; cin >> cost; // Calculate the total. total = baseballs * cost; // Display the total. cout << "The total amount spent $" << total << endl; return 0; } The only probelm that I encountered was that when I ran the program it failed to display the total amount spent (cout). Could someone please explain why? Thanks Jeff H - Sarasota, FL

    Read the article

  • g:countrySelect with full country name as value

    - by Sheldon
    I want to store the exact country name using g:countrySelect. Example Germany instead of DEU. It is the value in the drop down menu. The drop down text is Germany but when it saves it to the database it changes back to the country code. Sorry if I am somewhat naive but I have been searching for almost 3 hours for solutions and it isn't well documented at the grails website. I could opt for any alternative even ajax. Just to have an easy way to display a list of countries and will be able to store the REAL NAME of the country NOT country code. Thank you!

    Read the article

  • Getting dialogue snippets from text using regular expressions

    - by sheldon
    I'm trying to extract snippets of dialogue from a book text. For example, if I have the string "What's the matter with the flag?" inquired Captain MacWhirr. "Seems all right to me." Then I want to extract "What's the matter with the flag?" and "Seem's all right to me.". I found a regular expression to use here, which is "[^"\\]*(\\.[^"\\]*)*". This works great in Eclipse when I'm doing a Ctrl+F find regex on my book .txt file, but when I run the following code: String regex = "\"[^\"\\\\]*(\\\\.[^\"\\\\]*)*\""; String bookText = "\"What's the matter with the flag?\" inquired Captain MacWhirr. \"Seems all right to me.\""; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(bookText); if(m.find()) System.out.println(m.group(1)); The only thing that prints is null. So am I not converting the regex into a Java string properly? Do I need to take into account the fact that Java Strings have a \" for the double quotes?

    Read the article

  • Best way to set a default button (or trigger its event in javascript) for an input field, not part of a form

    - by Sheldon Pinkman
    I've got a stand-alone input field, not part of any form. I also got a button, that has some onclick event. When I type something in the input field, and press the Enter key, I want it do effectively press the button, or trigger its onclick event. So that the button is "the input field's default button" so to speak. <input id='myText' type='text' /> <button id='myButton' onclick='DoSomething()'>Do it!</button> I guess I can mess around with the input field's onkeypress or onkeydown events and check for the Enter key, etc. But is there a more 'clean' way, I mean something that associated the button with that input field, so that the button is the 'default action' or something for that field? Note that I'm not inside a form, I am not sending, posting, or submitting something. The DoSomething() function just changes some of the HTML content locally, depending on the text input.

    Read the article

  • Selenium : Handling Loading screens obscuring the web elements. (Java)

    - by Sheldon Cooper
    I'm writing an automated test case for a web page. Here's my scenario. I have to click and type on various web elements in an html form. But, sometimes while typing on a text field, an ajax loading image appears , fogging all elements i want to interact with. So, I'm using web-driver wait before clicking on the actual elements like below, WebdriverWait innerwait=new WebDriverWait(driver,30); innerwait.until(ExpectedConditions.elementToBeClickable(By.xpath(fieldID))); driver.findelement(By.xpath(fieldID)).click(); But the wait function returns the element even if it is fogged by another image and is not clickable. But the click() throws an exception as Element is not clickable at point (586.5, 278). Other element would receive the click: <div>Loading image</div> Do I have to check every time if the loading image appeared before interacting with any elements?.(I can't predict when the loading image will appear and fog all elements.) Is there any efficient way to handle this? Currently I'm using the following function to wait till the loading image disappears, public void wait_for_ajax_loading() throws Exception { try{ Thread.sleep(2000); if(selenium.isElementPresent("id=loadingPanel")) while(selenium.isElementPresent("id=loadingPanel")&&selenium.isVisible("id=loadingPanel"))//wait till the loading screen disappears { Thread.sleep(2000); System.out.println("Loading...."); }} catch(Exception e){ Logger.logPrint("Exception in wait_for_ajax_loading() "+e); Logger.failedReport(report, e); driver.quit(); System.exit(0); } } But I don't know exactly when to call the above function, calling it at a wrong time will fail. Is there any efficient way to check if an element is actually clickable? or the loading image is present? Thanks..

    Read the article

  • Kerberos & signle-sign-on for website

    - by Dylan Klomparens
    I have a website running on a Linux computer using Apache. I've employed mod_auth_kerb for single-sign-on Kerberos authentication against a Windows Active Directory server. In order for Kerberos to work correctly, I've created a service account in Active Directory called dummy. I've generated a keytab for the Linux web server using ktpass.exe on the Windows AD server using this command: ktpass /out C:\krb5.keytab /princ HTTP/[email protected] /mapuser [email protected] /crypto RC4-HMAC-NT /ptype KRB5_NT_PRINCIPAL /pass xxxxxxxxx I can successfully get a ticket from the Linux web server using this command: kinit -k -t /path/to/keytab HTTP/[email protected] ... and view the ticket with klist. I have also configured my web server with these Kerberos properties: <Directory /> AuthType Kerberos AuthName "Example.com Kerberos domain" KrbMethodK5Passwd Off KrbAuthRealms EXAMPLE.COM KrbServiceName HTTP/[email protected] Krb5KeyTab /path/to/keytab Require valid-user SSLRequireSSL <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> However, when I attempt to log in to the website (from another Desktop with username 'Jeff') my Kerberos credentials are not automatically accepted by the web server. It should grant me access immediately after that, but it does not. The only information I get from the mod_auth_kerb logs is: kerb_authenticate_user entered with user (NULL) and auth_type Kerberos However, more information is revealed when I change the mod_auth_kerb setting KrbMethodK5Passwd to On: [Fri Oct 18 17:26:44 2013] [debug] src/mod_auth_kerb.c(1939): [client xxx.xxx.xxx.xxx] kerb_authenticate_user entered with user (NULL) and auth_type Kerberos [Fri Oct 18 17:26:44 2013] [debug] src/mod_auth_kerb.c(1031): [client xxx.xxx.xxx.xxx] Using HTTP/[email protected] as server principal for password verification [Fri Oct 18 17:26:44 2013] [debug] src/mod_auth_kerb.c(735): [client xxx.xxx.xxx.xxx] Trying to get TGT for user [email protected] [Fri Oct 18 17:26:44 2013] [debug] src/mod_auth_kerb.c(645): [client xxx.xxx.xxx.xxx] Trying to verify authenticity of KDC using principal HTTP/[email protected] [Fri Oct 18 17:26:44 2013] [debug] src/mod_auth_kerb.c(1110): [client xxx.xxx.xxx.xxx] kerb_authenticate_user_krb5pwd ret=0 [email protected] authtype=Basic What am I missing? I've studied a lot of online tutorials and cannot find a reason why the Kerberos credentials are not allowing access.

    Read the article

  • ensime scala errors (class scala.Array not found, object scala not found)

    - by Jeff Bowman
    I've installed ensime according to the README.md file, however, I get errors in the inferior-ensime-server buffer with the following: INFO: Fatal Error: scala.tools.nsc.MissingRequirementError: object scala not found. scala.tools.nsc.MissingRequirementError: object scala not found. at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:516) at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:43) at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass(Definitions.scala:44) at scala.tools.nsc.symtab.Definitions$definitions$.UnitClass(Definitions.scala:89) at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scala:786) at scala.tools.nsc.Global$Run.(Global.scala:593) at scala.tools.nsc.interactive.Global$TyperRun.(Global.scala:473) at scala.tools.nsc.interactive.Global.newTyperRun(Global.scala:535) at scala.tools.nsc.interactive.Global.reloadSources(Global.scala:289) at scala.tools.nsc.interactive.Global$$anonfun$reload$1.apply(Global.scala:300) at scala.tools.nsc.interactive.Global$$anonfun$reload$1.apply(Global.scala:300) at scala.tools.nsc.interactive.Global.respond(Global.scala:276) at scala.tools.nsc.interactive.Global.reload(Global.scala:300) at scala.tools.nsc.interactive.CompilerControl$$anon$1.apply$mcV$sp(CompilerControl.scala:81) at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:132) at scala.tools.nsc.interactive.Global$$anon$2.run(Global.scala:192) also: INFO: Fatal Error: scala.tools.nsc.MissingRequirementError: class scala.Array not found. scala.tools.nsc.MissingRequirementError: class scala.Array not found. at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:516) at scala.tools.nsc.symtab.Definitions$definitions$.getClass(Definitions.scala:474) at scala.tools.nsc.symtab.Definitions$definitions$.ArrayClass(Definitions.scala:217) at scala.tools.nsc.backend.icode.TypeKinds$REFERENCE.(TypeKinds.scala:258) at scala.tools.nsc.backend.icode.GenICode$ICodePhase.(GenICode.scala:55) at scala.tools.nsc.backend.icode.GenICode.newPhase(GenICode.scala:43) at scala.tools.nsc.backend.icode.GenICode.newPhase(GenICode.scala:25) at scala.tools.nsc.Global$Run$$anonfun$4.apply(Global.scala:606) at scala.tools.nsc.Global$Run$$anonfun$4.apply(Global.scala:605) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:62) at scala.collection.immutable.List.foreach(List.scala:46) at scala.tools.nsc.Global$Run.(Global.scala:605) at scala.tools.nsc.interactive.Global$TyperRun.(Global.scala:473) at scala.tools.nsc.interactive.Global.newTyperRun(Global.scala:535) at scala.tools.nsc.interactive.Global.reloadSources(Global.scala:289) at scala.tools.nsc.interactive.Global.typedTreeAt(Global.scala:309) at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:326) at scala.tools.nsc.interactive.Global$$anonfun$getTypedTreeAt$1.apply(Global.scala:326) at scala.tools.nsc.interactive.Global.respond(Global.scala:276) at scala.tools.nsc.interactive.Global.getTypedTreeAt(Global.scala:326) at scala.tools.nsc.interactive.CompilerControl$$anon$2.apply$mcV$sp(CompilerControl.scala:89) at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:132) at scala.tools.nsc.interactive.Global$$anon$2.run(Global.scala:192) Also none of the type identification works for me, I get 'NA' if I get anything at all. C-c t causes emacs to lock up. I'm running: Ubuntu 10.04 (64bit version) emacs 23.1.50.1 ensime from git (as of 3 May 2010) scala is version 2.8.0.RC1 java is 1.6.0_20 (from sun) here is a copy of the log: http://dl.dropbox.com/u/5309017/ensime.log Thanks! Jeff

    Read the article

  • Tuning SQL Server 2008 for web applications

    - by Kibbee
    In one of the Stackoverflow podcasts, I remember Jeff Atwood saying that there was a configuration option in SQL Server 2008 which cuts down on locking, and was kind of an alternative to using "with (nolock)" in all your queries. Does anybody know how to enable the feature he was talking about, possibly even Jeff himself. I'm looking at deploying SQL Server 2008, and want to see if using a feature like this would help out my web application.

    Read the article

  • Implementing User-Defined Hierarchies in SQL Server Analysis Services

    To be able to drill into multidimensional cube data at several levels, you must implement all of the hierarchies on the database dimensions. Then you'll create the attribute relationships necessary to optimize performance. Analysis Services hierarchies offer plenty of possibilities for displaying the data that your business requires. Rob Sheldon continues his series on SQL Server Analysis Services 2008.

    Read the article

  • Implementing User-Defined Hierarchies in SQL Server Analysis Services

    To be able to drill into multidimensional cube data at several levels, you must implement all of the hierarchies on the database dimensions. Then you'll create the attribute relationships necessary to optimize performance. Analysis Services hierarchies offer plenty of possibilities for displaying the data that your business requires. Rob Sheldon continues his series on SQL Server Analysis Services 2008.

    Read the article

  • Adding Actions to a Cube in SQL Server Analysis Services 2008

    Actions are powerful way of extending the value of SSAS cubes for the end user. They can click on a cube or portion of a cube to start an application with the selected item as a parameter, or to retrieve information about the selected item. Actions haven't been well-documented until now; Robert Sheldon once more makes everything clear.

    Read the article

  • SQL Server CTE Basics

    The CTE was introduced into standard SQL in order to simplify various classes of SQL Queries for which a derived table just wasn't suitable. For some reason, it can be difficult to grasp the techniques of using it. Well, that's before Rob Sheldon explained it all so clearly for us.

    Read the article

  • Adding Actions to a Cube in SQL Server Analysis Services 2008

    Actions are powerful way of extending the value of SSAS cubes for the end user. They can click on a cube or portion of a cube to start an application with the selected item as a parameter, or to retrieve information about the selected item. Actions haven't been well-documented until now; Robert Sheldon once more makes everything clear.

    Read the article

  • Adding a KPI to an SQL Server Analysis Services Cube

    Key Performance Indicators, which vary according to the application, are widely used as a measure of the performance of parts of an organisation. Analysis Services makes this KPI data easily available to your cube. All you have to do is to follow Rob Sheldon's simple instructions.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >