Search Results

Search found 2403 results on 97 pages for 'alex peta'.

Page 40/97 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Tomcat JAXB 1 and 2 linkage error

    - by Alex
    I'm running a tomcat 6, spring, apache cxf webservice, know it is a must to add one third party library to my webapp to fulfill an order. I have jaxb-impl-2.1.12.jar for apache cxf in WEB-INF/lib folder and the new library which contains the JAXB 1.0 runtime. JAXB 2 ist used by apache cxf for dynamic clients (i need them). So is there a possibility to run the webapps with both libraries? Error: Caused by: java.lang.LinkageError: You are trying to run JAXB 2.0 runtime but you have old JAXB 1.0 runtime earlier in the classpath. Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.

    Read the article

  • JQuery AJAX is not sending UTF-8 to my server, only in IE.

    - by alex
    I am sending UTF-8, japanese text, to my server. It works in Firefox. My access.log and headers are: /ajax/?q=%E6%BC%A2%E5%AD%97 Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Howeer, in IE8, my access.log says: /ajax/?q=?? For some reason, IE8 is turning my AJAX call into question marks. Why!? I added the scriptCharset and ContentType according to some tutorials, but still no luck. And this is my code: $.ajax({ >---method:"get", >---url:"/ajax/", scriptCharset: "utf-8" , contentType: "application/x-www-form-urlencoded; charset=UTF-8", >---data:"q="+query ... ...

    Read the article

  • How important is managing memory in Objective-C?

    - by Alex Mcp
    Background: I'm (jumping on the bandwagon and) starting learning about iPhone/iPad development and Objective-C. I have a great background in web development and most of my programming is done in javascript (no libraries), Ruby, and PHP. Question: I'm learning about allocating and releasing memory in Objective-C, and I see it as quite a tricky task to layer on top of actually getting the farking thing to run. I'm trying to get a sense of applications that are out there and what will happen with a poorly memory-managed program. A) Are apps usually released with no memory leaks? Is this a feasible goal, or do people more realistically just excise the worst offenders and that's ok? B) If I make an NSString for a title of a view, let's say, and forget to deallocate it it, does this really only become a problem if I recreate that string repeatedly? I imagine what I'm doing is creating an overhead of the memory needed to store that string, so it's probably quite piddling (a few bytes?) However if I have a rapidly looping cycle in a game that 'leaks' an int every cycle or something, that would overflow the app quite quickly. Are these assumptions correct? Sorry if this isn't up the community-wiki alley, I'm just trying to get a handle on how to think about memory and how careful I'll need to be. Any anecdotes or App Store-submitted app experiences would be awesome to hear as well.

    Read the article

  • Problem with XML Deserialization C#

    - by alex
    I am having trouble with XML deserialization. In a nutshell - I have 2 classes: SMSMessage SMSSendingResponse I call an API that takes a bunch of parameters (represented by SMSMessage class) It returns an XML response. The response looks like this: <?xml version="1.0" encoding="utf-8"?> <data> <status>1</status> <message>OK</message> <results> <result> <account>12345</account> <to>012345678</to> <from>054321</from> <message>Testing</message> <flash></flash> <replace></replace> <report></report> <concat></concat> <id>f8d3eea1cbf6771a4bb02af3fb15253e</id> </result> </results> </data> Here is the SMSMessage class (with the xml serialization attributes so far) using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("results")] public class SMSMessage { public string To { get { return Result.To; } } public string From { get { return Result.From; } } public string Message { get { return Result.Message; } } [XmlElement("result")] public Result Result { get; set; } } } Here is SMSMessageSendingResponse: using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("data")] public class SMSSendingResponse { //should come from the results/result/account element. in our example "12345" public string AccountNumber { get { return SMSMessage.Result.AccountNumber; } } //should come from the "status" xml element [XmlElement("status")] public string Status { get; set; } //should come from the "message" xml element (in our example - "OK") [XmlElement("message")] public string Message { get; set; } //should come from the "id" xml element (in our example - "f8d3eea1cbf6771a4bb02af3fb15253e") public string ResponseID { get { return SMSMessage.Result.ResponseID; } } //should be created from the results/result element - ignore flash, replace, report and concat elements for now. [XmlElement("results")] public SMSMessage SMSMessage { get; set; } } } Here is the other class (Result) - I want to get rid of this, so only the 2 previously mentioned classes remain using System.Xml.Serialization; namespace XMLSerializationHelp { [XmlRoot("result")] public class Result { [XmlElement("account")] public string AccountNumber{ get; set; } [XmlElement("to")] public string To { get; set; } [XmlElement("from")] public string From { get; set; } [XmlElement("message")] public string Message { get; set; } [XmlElement("id")] public string ResponseID { get; set; } } } I don't want SMSMessage to be aware of the SMSSendingResponse - as this will be handled by a different part of my application

    Read the article

  • JavaScript types

    - by Alex Ivasyuv
    Hi, as per http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf JavaScript has 6 types: undefined, null, boolean, string, number, object. var und; console.log(typeof und); // <-- undefined var n = null; console.log(typeof n); // <--- **object**! var b = true; console.log(typeof b); // <-- boolean var str = "myString" console.log(typeof str); // <-- string var int = 10; console.log(typeof int); // <-- number var obj = {} console.log(typeof obj); // <-- object Question 1: Why null is object type, if it has to be a null type. Question 2: What about function? var f = function() {}; console.log(typeof f); // <-- function Variable f has "function" type. Why it doesn't specified in specification as separate type. Thanks,

    Read the article

  • ASP.NET MVC Ajax.ActionLink's weird behavior

    - by Alex
    I'm doing the simplest ajax request possible: public ActionResult SayHello() { return Content("YYAAAY"); } ////////// <div id="Div1"> <%= Ajax.ActionLink("SAY HELLO", "SayHello", new AjaxOptions { UpdateTargetId = "Div1" })%> </div> It works when I start an empty ASP.NET MVC project, but when I use it in my current project, it displays the whole page recursively instead of YYAAAY phrase only. Where might be the problem?

    Read the article

  • Facebook access_token invalid?

    - by Alex Cook
    I'm attempting to use the new Graph API Facebook recently released, but I can't seem to get it to work correctly. I've gone through the steps, and after the /authorize call, I receive an access_token: access_token=109002049121898|nhKwSTJVPbUZ5JYyIH3opCBQMf8. When I attempt to use that token I get: { "error": { "type": "QueryParseException", "message": "An active access token must be used to query information about the current user." } } I'm stumped as too why... -AC

    Read the article

  • Please help me correct the small bugs in this image editor

    - by Alex
    Hi, I'm working on a website that will sell hand made jewelry and I'm finishing the image editor, but it's not behaving quite right. Basically, the user uploads an image which will be saved as a source and then it will be resized to fit the user's screen and saved as a temp. The user will then go to a screen that will allow them to crop the image and then save it to it's final versions. All of that works fine, except, the final versions have 3 bugs. First is some black horizontal line on the very bottom of the image. Second is an outline of sorts that follows the edges. I thought it was because I was reducing the quality, but even at 100% it still shows up... And lastly, I've noticed that the cropped image is always a couple of pixels lower than what I'm specifying... Anyway, I'm hoping someone whose got experience in editing images with C# can maybe take a look at the code and see where I might be going off the right path. Oh, by the way, this in an ASP.NET MVC application. Here's the code: using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Web; namespace Website.Models.Providers { public class ImageProvider { private readonly ProductProvider ProductProvider = null; private readonly EncoderParameters HighQualityEncoder = new EncoderParameters(); private readonly ImageCodecInfo JpegCodecInfo = ImageCodecInfo.GetImageEncoders().Single( c => (c.MimeType == "image/jpeg")); private readonly string Path = HttpContext.Current.Server.MapPath("~/Resources/Images/Products"); private readonly short[][] Dimensions = new short[3][] { new short[2] { 640, 480 }, new short[2] { 240, 0 }, new short[2] { 80, 60 } }; ////////////////////////////////////////////////////////// // Constructor ////////////////////////////////////////// ////////////////////////////////////////////////////////// public ImageProvider( ProductProvider ProductProvider) { this.ProductProvider = ProductProvider; HighQualityEncoder.Param[0] = new EncoderParameter(Encoder.Quality, 100L); } ////////////////////////////////////////////////////////// // Crop ////////////////////////////////////////////// ////////////////////////////////////////////////////////// public void Crop( string FileName, Image Image, Crop Crop) { using (Bitmap Source = new Bitmap(Image)) { using (Bitmap Target = new Bitmap(Crop.Width, Crop.Height)) { using (Graphics Graphics = Graphics.FromImage(Target)) { Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; Graphics.SmoothingMode = SmoothingMode.HighQuality; Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; Graphics.CompositingQuality = CompositingQuality.HighQuality; Graphics.DrawImage(Source, new Rectangle(0, 0, Target.Width, Target.Height), new Rectangle(Crop.Left, Crop.Top, Crop.Width, Crop.Height), GraphicsUnit.Pixel); }; Target.Save(FileName, JpegCodecInfo, HighQualityEncoder); }; }; } ////////////////////////////////////////////////////////// // Crop & Resize ////////////////////////////////////// ////////////////////////////////////////////////////////// public void CropAndResize( Product Product, Crop Crop) { using (Image Source = Image.FromFile(String.Format("{0}/{1}.source", Path, Product.ProductId))) { using (Image Temp = Image.FromFile(String.Format("{0}/{1}.temp", Path, Product.ProductId))) { float Percent = ((float)Source.Width / (float)Temp.Width); short Width = (short)(Temp.Width * Percent); short Height = (short)(Temp.Height * Percent); Crop.Height = (short)(Crop.Height * Percent); Crop.Left = (short)(Crop.Left * Percent); Crop.Top = (short)(Crop.Top * Percent); Crop.Width = (short)(Crop.Width * Percent); Img Img = new Img(); this.ProductProvider.AddImageAndSave(Product, Img); this.Crop(String.Format("{0}/{1}.cropped", Path, Img.ImageId), Source, Crop); using (Image Cropped = Image.FromFile(String.Format("{0}/{1}.cropped", Path, Img.ImageId))) { this.Resize(this.Dimensions[0], String.Format("{0}/{1}-L.jpg", Path, Img.ImageId), Cropped, HighQualityEncoder); this.Resize(this.Dimensions[1], String.Format("{0}/{1}-T.jpg", Path, Img.ImageId), Cropped, HighQualityEncoder); this.Resize(this.Dimensions[2], String.Format("{0}/{1}-S.jpg", Path, Img.ImageId), Cropped, HighQualityEncoder); }; }; }; this.Purge(Product); } ////////////////////////////////////////////////////////// // Queue ////////////////////////////////////////////// ////////////////////////////////////////////////////////// public void QueueFor( Product Product, HttpPostedFileBase PostedFile) { using (Image Image = Image.FromStream(PostedFile.InputStream)) { this.Resize(new short[2] { 1152, 0 }, String.Format("{0}/{1}.temp", Path, Product.ProductId), Image, HighQualityEncoder); }; PostedFile.SaveAs(String.Format("{0}/{1}.source", Path, Product.ProductId)); } ////////////////////////////////////////////////////////// // Purge ////////////////////////////////////////////// ////////////////////////////////////////////////////////// private void Purge( Product Product) { string Source = String.Format("{0}/{1}.source", Path, Product.ProductId); string Temp = String.Format("{0}/{1}.temp", Path, Product.ProductId); if (File.Exists(Source)) { File.Delete(Source); }; if (File.Exists(Temp)) { File.Delete(Temp); }; foreach (Img Img in Product.Imgs) { string Cropped = String.Format("{0}/{1}.cropped", Path, Img.ImageId); if (File.Exists(Cropped)) { File.Delete(Cropped); }; }; } ////////////////////////////////////////////////////////// // Resize ////////////////////////////////////////////// ////////////////////////////////////////////////////////// public void Resize( short[] Dimensions, string FileName, Image Image, EncoderParameters EncoderParameters) { if (Dimensions[1] == 0) { Dimensions[1] = (short)(Image.Height / ((float)Image.Width / (float)Dimensions[0])); }; using (Bitmap Bitmap = new Bitmap(Dimensions[0], Dimensions[1])) { using (Graphics Graphics = Graphics.FromImage(Bitmap)) { Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; Graphics.SmoothingMode = SmoothingMode.HighQuality; Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; Graphics.CompositingQuality = CompositingQuality.HighQuality; Graphics.DrawImage(Image, 0, 0, Dimensions[0], Dimensions[1]); }; Bitmap.Save(FileName, JpegCodecInfo, EncoderParameters); }; } } } Here's one of the images this produces:

    Read the article

  • Can I have Visual Studio IDE auto-comple brackets?

    - by Alex K
    Suppose I have a line of code that starts like the following: Func1(Func2(Func3 Is it possible to set up Visual Studio (2005, 2008, 2010) IDE, so that when I hit ';' it will auto-complete all the brackets. I am only interested in brackets, nothing fancier. It doesn't have to be ';' key, it can be another key that auto-completes both brackets and ';'. This is a tiny thing that pops-up time and time again, and I've always wondered if I had to live with it. Thanks.

    Read the article

  • How to make this .htaccess rule case insensitive?

    - by alex
    This is a rule in my .htaccess # those CSV files are under the DOCROOT ... so let's hide 'em <FilesMatch "\.CSV$"> Order Allow,Deny Deny from all </FilesMatch> I've noticed however that if there is a file with a lowercase or mixed case extension of CSV, it will be ignored by the rule and displayed. How do I make this case insensitive? I hope it doesn't come down to "\.(?:CSV|csv)$" (which I'm not sure would even work, and doesn't cover all bases) Note: The files are under the docroot, and are uploaded automatically there by a 3rd party service, so I'd prefer to implement a rule my end instead of bothering them. Had I set this site up though, I'd go for above the docroot. Thanks

    Read the article

  • What's the best library to do a URL hash/history in JQuery?

    - by alex
    I've been looking around JQuery libraries for the URL hash, but found none that were good. There is the "history plugin", but we all know it's buggy and isn't flexible. I am loading my pages inside a div. I'll need a way to do back/forward along with the url hashing. mydomain.com/#home mydomain.com/#aboutus mydomain.com/#register What's the best library that can handle all of this?

    Read the article

  • How to use acts-as-commentable-with-threading in Rails

    - by alex
    Hi All, I am developing my first rails site (yup, i am a rails idiot). I'm writing a blog, and i got to the comments part. I installed acts-as-commentable-with-threading ( GitHub ), i made and ran the migration like the install instructions said. I have added acts_as_commentable to my Posts model and i have a Comments controller When i add @comment = Comment.build_from(params[:id],1, params[:body] ) I get the error. undefined method `build_from' for # Clearly i am doing something terribly wrong, and i don't really get the example. What should i be feeding to build_from? Can somebody explain this plugin step by step? :) Or is there an easier way to get simple threaded comments?

    Read the article

  • Can someone help fix my vimrc config?

    - by alex
    set nohlsearch set ai set bg=dark set showmatch highlight SpecialKey ctermfg=DarkGray set listchars=tab:>-,trail:~ set list autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class set tabstop=4 set shiftwidth=4 set expandtab set autoindent set smartindent syntax on set listchars=tab:>- set listchars+=trail:. set ignorecase set smartcase map <C-t><up> :tabr<cr> map <C-t><down> :tabl<cr> map <C-t><left> :tabp<cr> map <C-t><right> :tabn<cr> map <F1> <Esc> imap <F1> <Esc> set pastetoggle=<F5> This is my vimrc. I want to fix it so that it doesn't show ---- ---- when other people tab. Thank.

    Read the article

  • Blurry UILabel as programmatic subview of UITableViewCell contentView

    - by Alex Reynolds
    I am adding a UILabel instance as a subview of my custom UITableViewCell instance's contentView. When I select the cell, the row is highlighted blue, except for the background of the label. The label text is sharp. When I set the label and content view backgroundColor property to [UIColor clearColor], the label text becomes blurry. How do I set the label background color to be clear, to allow the row highlight to come through, while still keeping the label text sharp? One suggestion I read elsewhere was to round the label's frame values, but this did not have any effect. CODE Here is a snippet of my custom UITableViewCell subview's -setNeedsLayout method: UILabel *_objectTitleLabel = [[UILabel alloc] initWithFrame:CGRectNull]; _objectTitleLabel.text = [self.awsObject cleanedKey]; _objectTitleLabel.font = [UIAppDelegate defaultObjectLabelFont]; _objectTitleLabel.highlightedTextColor = [UIColor clearColor]; //[UIAppDelegate defaultLabelShadowTint]; _objectTitleLabel.backgroundColor = [UIColor clearColor]; //[UIAppDelegate defaultWidgetBackgroundTint]; _objectTitleLabel.frame = CGRectMake( kCellImageViewWidth + 2.0 * self.indentationWidth, 0.5 * (self.tableView.rowHeight - 1.5 * kCellLabelHeight) + kCellTitleYPositionNudge, contentViewWidth, kCellLabelHeight ); _objectTitleLabel.frame = CGRectIntegral(_objectTitleLabel.frame); _objectTitleLabel.tag = kObjectTableViewCellTitleSubviewType; //NSLog(@"_objectTitleLabel: %@", NSStringFromCGRect(_objectTitleLabel.frame)); [self.contentView addSubview:_objectTitleLabel]; [_objectTitleLabel release], _objectTitleLabel = nil; ... self.contentView.backgroundColor = [UIAppDelegate defaultWidgetBackgroundTint]; self.contentView.clearsContextBeforeDrawing = YES; self.contentView.autoresizesSubviews = YES; self.contentView.clipsToBounds = YES; self.contentView.contentMode = UIViewContentModeRedraw;

    Read the article

  • IE7 float/clear bug

    - by alex
    I am having the weirdest behavior in IE7 on this page. I have a clear: left on #moored that makes sure that #content-container will expand to the height of the float: left'd #content. Of course, Firefox and IE8 do it right. The weird thing though, is in IE7, it appears that #content-container is automatically expanding to contain the #secondary-content, which it shouldn't. Even weirder is when I view with IE8 with developer tools, the boundary boxes seem to show the that the #content-container is the expanding to the height of the #secondary-container, even though the background: #fff tells a different story. The background goes to where it should, and the void is now black. I've Googled a bit and came across heaps of similar float bugs, but I don't think I've found one which offers a fix yet for this circumstance. Can anyone please help me?

    Read the article

  • abstract class NumberFormat - very confuse about getInstance()

    - by Alex
    Hi, I'm new to Java and I have a beginner question: NumberFormat is an abstract class and so I assume I can't make an instance of it. But there is a public static (factory?) method getInstance() that allow me to do NumberFormat nf = NumberFormat.getInstance(); I'm quite confuse. I'll be glad if someone could give me hints on: 1) If there is a public method to get an instance of this abstract class, why don't we have also a constructor? 2) This is an abstract class ; how can we have this static method giving us an instance of the class? 3) Why choosing such a design? If I assume it's possible to have an instance of an abstract class (???), I don't get why this class should be abstract at all. Thank you.

    Read the article

  • warning: incompatible implicit declaration of built-in function ‘xyz’

    - by Alex Reynolds
    I'm getting a number of these warnings when compiling a few binaries: warning: incompatible implicit declaration of built-in function ‘strcpy’ warning: incompatible implicit declaration of built-in function ‘strlen’ warning: incompatible implicit declaration of built-in function ‘exit’ To try to resolve this, I have added #include <stdlib.h> at the top of the C files associated with this warning, in addition to compiling with the following flags: CFLAGS = -fno-builtin-exit -fno-builtin-strcat -fno-builtin-strncat -fno-builtin-strcpy -fno-builtin-strlen -fno-builtin-calloc I am using GCC 4.1.2: $ gcc --version gcc (GCC) 4.1.2 20080704 What should I do to resolve these warnings? Thanks for your advice.

    Read the article

  • Windows Vista, Default Programs API, file format associations, and (un)installers - explosive mix!

    - by Alex T.
    My application is a rather well behaved Windows citizen, so when I ported it to Windows Vista/7 I replaced my custom file format association code with support for the Default Programs API. However I ran into a problem when trying to make uninstaller for my application - there seems to be no way to remove file format associations via Default Programs API. I tried to call IApplicationAssociationRegistration::ClearUserAssociations but it actually removes all associations, including the ones for other applications - completely restoring default state of the OS (which is of course unacceptable). I tried to call IApplicationAssociationRegistration::SetAppAsDefault to return file format associations to the previous "owner" - but it does not help, because my application handles many unique file formats which the OS does not support and there is no previous "owners". And Windows does not allow to pass empty strings to SetAppAsDefault... So what do I do? Any good solutions?

    Read the article

  • KISS: Simple C# application which communicates with a RESTful web service.

    - by Workshop Alex
    Following the KISS principle, I suddenly realised the following: In .NET, you can use the Entity Model Framework to wrap around a database. This model can be exposed as a web service through WCF. This web service would have a very standardized definition. A client application could be created which could consume any such RESTful web service. I don't want to re-invent the wheel and it wouldn't surprise me if someone has already done this, so my question is simple: Has anyone already created a simple (desktop, not web) client application that can consume a RESTful service that's based on the Entity Framework and which will allow the user to read and write data directly to this service? Otherwise, I'll just have to "invent" this myself. :-)Problem is, the database layer and RESTful service is already finished. The RESTful service will only stay in the project during it's development phase, since we can use the database-layer assembly directly from the web applications that are build around it. When the web application is deployed, the RESTful services are just kept out of the deployment. But the database has a lot of data to manage over nearly 50 tables. When developing against a local database, we can have straight access to the database so I wouldn't need this tool for this. When it's deployed, the web application would be the only way to access the data so I could not use this tool. But we're also having a test phase where the database is stored on another system outside the local domain and this database is not available for developers. Only administrators have direct access to this database, making tests a bit more complex. However, through the RESTful service, I can still access the data directly. Thus, when some test goes wrong, I can repair the data through this connection or just create a copy of the data for tests on my local system. There's plenty of other functionality and it's even possible to just open the URL to a table service straight in Excel or XMLSpy to see the contents. But when I want to write something back, I have to write special code to do just that. A generic tool that would allow me to access the data and modify it would be easier. Since it's a generic setup around the ADO.NET Data services, this should be reasonable easy too. Thus, I can do it but hoped someone else has already done something similar. But it appears that there's no such tool made yet...

    Read the article

  • Django BigInteger auto-increment field as primary key?

    - by Alex Letoosh
    Hi all, I'm currently building a project which involves a lot of collective intelligence. Every user visiting the web site gets created a unique profile and their data is later used to calculate best matches for themselves and other users. By default, Django creates an INT(11) id field to handle models primary keys. I'm concerned with this being overflown very quickly (i.e. ~2.4b devices visiting the page without prior cookie set up). How can I change it to be represented as BIGINT in MySQL and long() inside Django itself? I've found I could do the following (http://docs.djangoproject.com/en/dev/ref/models/fields/#bigintegerfield): class MyProfile(models.Model): id = BigIntegerField(primary_key=True) But is there a way to make it autoincrement, like usual id fields? Additionally, can I make it unsigned so that I get more space to fill in? Thanks!

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >