Search Results

Search found 291 results on 12 pages for 'jesse aldridge'.

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

  • Getting a binary file from resource in C#

    - by Jesse Knott
    Hello, I am having a bit of a problem, I am trying to get a PDF as a resource in my application. At this point I have a fillable PDF that I have been able to store as a file next to the binary, but now I am trying to embed the PDF as a resource in the binary. byte[] buffer; try { s = typeof(BattleTracker).Assembly.GetManifestResourceStream("libReports.Resources.DAForm1594.pdf"); buffer = new byte[s.Length]; int read = 0; do { read = s.Read(buffer, read, 32768); } while (read > 0); } catch (Exception e) { throw new Exception("Error: could not import report:", e); } // read existing PDF document PdfReader r = new PdfReader( // optimize memory usage buffer, null ); Every time I run the code I get an error saying "Rebuild trailer not found. Original Error: PDF startxref not found" When I was just opening the file via a path to the static file in my directory it worked fine. I have tried using different encodings UTF-8, UTF-32, UTF-7, ASCII, etc etc.... As a side note I had the same problem with getting a Powerpoint file as a resource, I was finally able to fix that problem by converting the Powerpoint to xml and using that. I have considered doing the same for the PDF but I am referencing elements by field name which does not seem to work with XML PDFs. Can anyone help me out with this? Thanks in advance!

    Read the article

  • Tortoise SVN tree conflict with myself

    - by Jesse Pepper
    Has anyone had the experience of moving a file in tortoise and committing successfully, only to later commit a different change and be told of a tree conflict where: the file in its original location has been deleted, but in tortoise is marked as missing the file in its new location is there, but marked as already added. (I use tortoise SVN, and we have client and server 1.60) Nobody else changed either the directory or the file (according to svn log). Why is this happening? Is there a way to avoid it happening? If it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?

    Read the article

  • Can Nokogiri Parse a Nokogiri Object?

    - by Jesse J
    I'm trying to parse a part of the result of a parse, like this: queries = @doc.xpath("//spectrum_query") queries.each do |query| hits = query.xpath("//search_hit") end But instead of Nokogiri only searching for search_hits inside the query, it searches for search_hits in the whole document. I'm sure there's a different way to accomplish what I want, but doing it like this would be the simplest. Anyone know if it's possible to search just the query object?

    Read the article

  • jQuery fadeOut, replaceWith, animate almost working

    - by Jesse
    I am trying to accomplish the following: 1. On click, have a div with id="fader" fadeout 2. replaceHtml of fader with new html (this new HTML will appear below the fold of the browser) 3. Animate new HTML to slide up to the specified location Step 1 and 2 are working, step 3 is not and I'm stumped as to why. Here's the javascript: $("#fader").fadeOut(1000, function() { $(this).replaceWith('<div id=\"fader\" style=\"margin-top:-500px;width:500px;height:400px;border:1px solid black;\">new div</div>', function() { $("#fader").animate({marginTop: "500px"}); }); }); Any thoughts on why the div won't animate would be greatly appreciated, thanks in advance!

    Read the article

  • Securing a license key with RSA key.

    - by Jesse Knott
    Hello, it's late, I'm tired, and probably being quite dense.... I have written an application that I need to secure so it will only run on machines that I generate a key for. What I am doing for now is getting the BIOS serial number and generating a hash from that, I then am encrypting it using a XML RSA private key. I then sign the XML to ensure that it is not tampered with. I am trying to package the public key to decrypt and verify the signature with, but every time I try to execute the code as a different user than the one that generated the signature I get a failure on the signature. Most of my code is modified from sample code I have found since I am not as familiar with RSA encryption as I would like to be. Below is the code I was using and the code I thought I needed to use to get this working right... Any feedback would be greatly appreciated as I am quite lost at this point the original code I was working with was this, this code works fine as long as the user launching the program is the same one that signed the document originally... CspParameters cspParams = new CspParameters(); cspParams.KeyContainerName = "XML_DSIG_RSA_KEY"; cspParams.Flags = CspProviderFlags.UseMachineKeyStore; // Create a new RSA signing key and save it in the container. RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(cspParams) { PersistKeyInCsp = true, }; This code is what I believe I should be doing but it's failing to verify the signature no matter what I do, regardless if it's the same user or a different one... RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(); //Load the private key from xml file XmlDocument xmlPrivateKey = new XmlDocument(); xmlPrivateKey.Load("KeyPriv.xml"); rsaKey.FromXmlString(xmlPrivateKey.InnerXml); I believe this to have something to do with the key container name (Being a real dumbass here please excuse me) I am quite certain that this is the line that is both causing it to work in the first case and preventing it from working in the second case.... cspParams.KeyContainerName = "XML_DSIG_RSA_KEY"; Is there a way for me to sign/encrypt the XML with a private key when the application license is generated and then drop the public key in the app directory and use that to verify/decrypt the code? I can drop the encryption part if I can get the signature part working right. I was using it as a backup to obfuscate the origin of the license code I am keying from. Does any of this make sense? Am I a total dunce? Thanks for any help anyone can give me in this..

    Read the article

  • Getting a JPEG image from a hex string in XML.

    - by Jesse Knott
    Well here goes, I am trying to collect a picture that is encoded as a hex string in an xml file. I have been looking all over for the answer to this and have not been able to find it any where. Here is what I have now. byte[] bytes = Convert.FromBase64String(FilterResults("PHOTOGRAPH")); MemoryStream mem = new MemoryStream(bytes); Image bmp2 = Image.FromStream(mem); return bmp2; The FilterResults function just returns the string from the XML. I am able to get the string of characters and convert it into a byte[] but as soon as I execute the Image.FromStream(mem) I get an "Parameter Incorrect" error. Any ideas?

    Read the article

  • ExternalInterface

    - by Jesse
    Hey, so I'm having a bunch of trouble getting ExternalInterface to work, which is odd, because I use it somewhat often. I'm hoping it's something I just missed because I've been looking at it too long. The flash_ready function is correctly returning the objectID, and as far as I can tell, everything else is in order. Unfortunately, when I run it, I get an error (varying by browser) telling me that basically document.getElementById(<movename>).test() is not a valid method. Here's the code: javascript: function flash_ready(i){ document.getElementById(i).test('success!'); } Embed Html (Generated): <script type="text/javascript"> swfobject.embedSWF("/chainmaille/includes/media/flash/upload_image.swf", "/chainmaille/includes/media/flash/upload_image", "500", "50", "9.0.0","expressInstall.swf", {}, {allowScriptAccess:'always', wmode:'transparent'},{id:'uploader_flash',name:'uploader_flash'}); </script> <object type="application/x-shockwave-flash" id="uploader_flash" name="uploader_flash" data="/chainmaille/includes/media/flash/upload_image.swf" width="500" height="50"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object> AS3 : package com.jesseditson.uploader { import flash.display.MovieClip; import flash.external.ExternalInterface; import flash.system.Security; public class UI extends MovieClip { // Initialization: public function UI() { Security.allowDomain('*'); ExternalInterface.addCallback("test", test); var jscommand:String = "flash_ready('"+ExternalInterface.objectID+"');"; var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);"); navigateToURL(url, "_self"); } public function test(t){ trace(t); } } } Swfobject is being included via google code, and the flash embeds just fine, so that's not the problem. I've got a very similar setup working on another server, but can't seem to get it working on this one. It's a Hostgator shared server. Could it be the server's fault? Anybody see any obvious syntax problems? Thanks in advance!

    Read the article

  • Set-Cookie error appearing in logs when deployed to google appengine

    - by Jesse
    I have been working towards converting one of our applications to be threadsafe. When testing on the local dev app server everything is working as expected. However, upon deployment of the application it seems that Cookies are not being written correctly? Within the logs there is an error with no stack trace: 2012-11-27 16:14:16.879 Set-Cookie: idd_SRP=Uyd7InRpbnlJZCI6ICJXNFdYQ1ZITSJ9JwpwMAou.Q6vNs9vGR-rmg0FkAa_P1PGBD94; expires=Wed, 28-Nov-2012 23:59:59 GMT; Path=/ Here is the block of code in question: # area of the code the emits the cookie cookie = Cookie.SimpleCookie() if not domain: domain = self.__domain self.__updateCookie(cookie, expires=expires, domain=domain) self.__updateSessionCookie(cookie, domain=domain) print cookie.output() Cookie helper methods: def __updateCookie(self, cookie, expires=None, domain=None): """ Takes a Cookie.SessionCookie instance an updates it with all of the private persistent cookie data, expiry and domain. @param cookie: a Cookie.SimpleCookie instance @param expires: a datetime.datetime instance to use for expiry @param domain: a string to use for the cookie domain """ cookieValue = AccountCookieManager.CookieHelper.toString(self.cookie) cookieName = str(AccountCookieManager.COOKIE_KEY % self.partner.pid) cookie[cookieName] = cookieValue cookie[cookieName]['path'] = '/' cookie[cookieName]['domain'] = domain if not expires: # set the expiry date to 1 day from now expires = datetime.date.today() + datetime.timedelta(days = 1) expiryDate = expires.strftime("%a, %d-%b-%Y 23:59:59 GMT") cookie[cookieName]['expires'] = expiryDate def __updateSessionCookie(self, cookie, domain=None): """ Takes a Cookie.SessionCookie instance an updates it with all of the private session cookie data and domain. @param cookie: a Cookie.SimpleCookie instance @param expires: a datetime.datetime instance to use for expiry @param domain: a string to use for the cookie domain """ cookieValue = AccountCookieManager.CookieHelper.toString(self.sessionCookie) cookieName = str(AccountCookieManager.SESSION_COOKIE_KEY % self.partner.pid) cookie[cookieName] = cookieValue cookie[cookieName]['path'] = '/' cookie[cookieName]['domain'] = domain Again, the libraries in use are: Python 2.7 Django 1.2 Any suggestion on what I can try?

    Read the article

  • Wanting a simple overview on how to connect to a SQLite database in Cocoa/Objective-C

    - by Jesse
    Hi, everyone. I've been experimenting with Cocoa and Objective-C programming on the Mac for a few months now, and I am wanting to start developing applications that manage large amounts of data. The trouble is, I'm not really sure where to start with databases. I have a good background in Java programming with SQLite. I've read a bit about CoreData and I haven't been able to find any good resources for just manually connecting to the database. I'm looking for recommendations. Should I try CoreData, and if so, can anyone recommend a good tutorial for someone new to the language? Or, should I try to manually connect and query an SQLite database somehow, and, if so, any tutorials? Any help would be greatly appreciated! Thanks!

    Read the article

  • How do I antialias the clip boundary on Android's canvas?

    - by Jesse Wilson
    I'm using Android's android.graphics.Canvas class to draw a ring. My onDraw method clips the canvas to make a hole for the inner circle, and then draws the full outer circle over the hole: clip = new Path(); clip.addRect(outerCircle, Path.Direction.CW); clip.addOval(innerCircle, Path.Direction.CCW); canvas.save(); canvas.clipPath(clip); canvas.drawOval(outerCircle, lightGrey); canvas.restore(); The result is a ring with a pretty, anti-aliased outer edge and a jagged, ugly inner edge: What can I do to antialias the inner edge? I don't want to cheat by drawing a grey circle in the middle because the dialog is slightly transparent. (This transparency isn't as subtle on on other backgrounds.)

    Read the article

  • Conditionan Action in SSRS

    - by Jesse
    I want my textbox to have an action ONLY if the condition is true, otherwise no action. This is what I have as my current action expression for going to another report: =IIf(Fields!MyTextbox.Value = "0", "Report2","") This does not produce my desired result. It gives the textbox an action regardless of the condition result. Is there a 'No Action' or 'Cancel Action' value?

    Read the article

  • Using ManagementObject to retrieve a single WMI property

    - by Jesse
    This probably isn't the best way, but I am currently retrieving the amount of RAM on a machine using: manageObjSearch.Query = new ObjectQuery("SELECT TotalVisibleMemorySize FROM Win32_OperatingSystem"); manageObjCol = manageObjSearch.Get(); foreach (ManagementObject mo in manageObjCol) sizeInKilobytes = Convert.ToInt64(mo["TotalVisibleMemorySize"]); It works well and good, but I feel I could be doing this more directly and without a foreach over a single element, but I can't figure out how to index a ManagementObjectCollection I want to do something like this: ManagementObject mo = new ManagementObject("Win32_OperatingSystem.TotalVisibleMemorySize") mo.Get(); Console.WriteLine(mo["TotalVisibleMemorySize"].ToString()) or maybe even something like ManagementClass mc = new ManagementClass("Win32_OperatingSystem"); Console.WriteLine(mc.GetPropertyValue("TotalVisibleMemorySize").ToString()); I just can't seem to figure it out. Any ideas?

    Read the article

  • Images in database vs file system

    - by Jesse
    We have a project coming up where we will be building a whole backend CMS system that will power our entire extranet and intranet with one package. The question I have been trying to find an answer to is which is better: storing images in the database (SQL Server 2005) so we may have integrity, single replication plan, etc OR storing on the file system? One issue we have is that we have multiple servers load balanced that require to have the same data at all times. As of now we have SQL replication taking care of that but file replication seems to be a little tougher. Another concern we have is that we would like to have multiple resolutions of the same image, we are not sure if creating and storing each version on the file system would be best or maybe dynamically pulling and creating the resolution image we would like upon request. Our concerns are the with the following: Data integrity Data replication Multiple resolutions Speed of database vs file system Overhead load of database vs file system Data management and backup Does anyone have a similar situation or have any input on what would be recommended? Thanks in advance for the help!

    Read the article

  • how to remove dynamically loaded images in javascript

    - by jesse
    I'm loading in 3 images (named 1.jpg, 2.jpg, 3jpg) dynamically to 3 divs called "div1", "div2" and "div3". function loadImages() { for (var i = 1; i < 3; i++ ) { var img = document.createElement("img"); img.src = "vegetables/"+i+".jpg"; img.id = "a"+i+""; var divName = "div"+i+""; document.getElementById(divName).appendChild(img); } } That works, but the removing part I can't seem to get to work.. function removeImages() { for (var i = 1; i < 3; i++ ) { var oldImages = "a"+i+""; var divName = "div"+i+""; document.getElementById(divName).removeChild(oldImages); } } Thank you.

    Read the article

  • View an item without republishing everything?

    - by Jesse Millikan
    I'm getting this error when trying to view a Sitecore item based on a template that contains nothing but one sublayout played in a placeholder in another layout. I can place the sublayout in other sublayouts and view it on another item, and I can preview the item, but when I go to view that item I get this: The layout for the requested document was not found. [blah blah blah] Requested Layout: {00000000-0000-0000-0000-000000000000} [blah blah blah some more] The only way I've found to view the new item is to do a "Publish Site" from the Publish tab. Is there a way to get that one item working without republishing everything?

    Read the article

  • What is the best way to limit the amount of text that can be entered into a 'textarea'?

    - by Jesse Taber
    What is the best way to limit the amount of text that a user can enter into a 'textarea' field on a web page? The application in question is ASP .NET, but a platform agnostic answer is preferred. I understand that some amount of javascript is likely needed to get this done as I do not wish to actually perform the 'post' with that amount of data if possible as ASP .NET does have an upper limit to the size of the request that it will service (though I don't know what that is exactly). So maybe the real question is, what's the best way to do this in javascript that will meet the following criteria: -Must work equally well for both users simply typing data and copy/paste'ing data in from another source. -Must be as '508 compliance' friendly as possible.

    Read the article

  • Patterns for simulating optional "out" parameters in C#?

    - by Jesse McGrew
    I'm translating an API from C to C#, and one of the functions allocates a number of related objects, some of which are optional. The C version accepts several pointer parameters which are used to return integer handles to the objects, and the caller can pass NULL for some of the pointers to avoid allocating those objects: void initialize(int *mainObjPtr, int *subObjPtr, int *anotherSubObjPtr); initialize(&mainObj, &subObj, NULL); For the C# version, the obvious translation would use out parameters instead of pointers: public static void Initialize(out int mainObj, out int subObj, out int anotherSubObj); ... but this leaves no way to indicate which objects are unwanted. Are there any well-known examples of C# APIs doing something similar that I could imitate? If not, any suggestions?

    Read the article

  • How to deal with symbolic links when going between Linux and Windows?

    - by Jesse Beder
    I have a django project that runs on a Linux server, and I've been working on it both on Linux and OS X. I've noticed that some of the pages are a bit off, to put it politely, in Internet Explorer, and so I checked out the subversion repository on Windows and tried to run a local server. My media directory has symbolic links to all of the media from each different app, and obviously Windows doesn't know what to do with them. I could simply hard-copy or link everything manually in Windows, but then I wouldn't be able to check that in (since the site runs on a Linux server), so it'd be a pain in the neck. What is typically done in this case?

    Read the article

  • Question about member function pointers in a heirarchy

    - by Jesse Beder
    I'm using a library that defines an interface: template<class desttype> void connect(desttype* pclass, void (desttype::*pmemfun)()); and I have a small heirarchy class base { void foo(); }; class derived: public base { ... }; In a member function of derived, I want to call connect(this, &derived::foo); but it seems that &derived::foo is actually a member function pointer of base; gcc spits out error: no matching function for call to ‘connect(derived* const&, void (base::* const&)())’ I can get around this by explicitly casting this to base *; but why can't the compiler match the call with desttype = base (since derived * can be implicitly cast to base *)? Also, why is &derived::foo not a member function pointer of derived?

    Read the article

  • CommandBuilder and SqlTransaction to insert/update a row

    - by Jesse
    I can get this to work, but I feel as though I'm not doing it properly. The first time this runs, it works as intended, and a new row is inserted where "thisField" contains "doesntExist" However, if I run it a subsequent time, I get a run-time error that I can't insert a duplicate key as it violate the primary key "thisField". static void Main(string[] args) { using(var sqlConn = new SqlConnection(connString) ) { sqlConn.Open(); var dt = new DataTable(); var sqlda = new SqlDataAdapter("SELECT * FROM table WHERE thisField ='doesntExist'", sqlConn); sqlda.Fill(dt); DataRow dr = dt.NewRow(); dr["thisField"] = "doesntExist"; //Primary key dt.Rows.Add(dr); //dt.AcceptChanges(); //I thought this may fix the problem. It didn't. var sqlTrans = sqlConn.BeginTransaction(); try { sqlda.SelectCommand = new SqlCommand("SELECT * FROM table WITH (HOLDLOCK, ROWLOCK) WHERE thisField = 'doesntExist'", sqlConn, sqlTrans); SqlCommandBuilder sqlCb = new SqlCommandBuilder(sqlda); sqlda.InsertCommand = sqlCb.GetInsertCommand(); sqlda.InsertCommand.Transaction = sqlTrans; sqlda.DeleteCommand = sqlCb.GetDeleteCommand(); sqlda.DeleteCommand.Transaction = sqlTrans; sqlda.UpdateCommand = sqlCb.GetUpdateCommand(); sqlda.UpdateCommand.Transaction = sqlTrans; sqlda.Update(dt); sqlTrans.Commit(); } catch (Exception) { //... } } } Even when I can get that working through trial and error of moving AcceptChanges around, or encapsulating changes within Begin/EndEdit, then I begin to experience a "Concurrency violation" in which it won't update the changes, but rather tell me it failed to update 0 of 1 affected rows. Is there something crazy obvious I'm missing?

    Read the article

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