Search Results

Search found 557 results on 23 pages for 'anthony aziz'.

Page 14/23 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How to rewrite a url based on accept-language

    - by Anthony Faull
    I have a website in three languages with a directory for each: i.e. /en-US/, /de-DE/ and /fr-FR/. I would like the web server to use the browser's accept-language string to return content in the language of the user. Examples: (a) "pl-PL;fr-FR;en-US" should redirect to /fr-FR/. (b) "de;fr-FR" redirects to /de-DE/ (c) "jp-JP" redirects to /en-US/. How would I do this in an .htaccess file?

    Read the article

  • Browser for cross-site-script testing (for testing Mozilla Add-On)

    - by Anthony
    I am working on a Firefox extension that will involve ajax calls to domains that would normally fail due to the same-origin policy set by Firefox (and most modern browsers). I was wondering if there is a way to either turn off the same-origin restriction (in about:config, perhaps) or if there was a standard lite-browser that developers turn to for this. I really would like to avoid using any blackhat tools, if possible. Not because I'm against them, I just don't want to add another learning curve to the process. I can use curl in PHP to confirm that the requests work, but I want to get started on writing the js that the addon will actually use, so I need a client that will execute js. I also tried spidermonkey, but since I'm doing the ajax with jquery, it threw a fit at all of the browser-based default variables. So, short version: is there a reliable browser/client for cross site scripting that isn't primarily a hacker app? Or can I just turn off same-domain policy in Firefox?

    Read the article

  • Git error "fatal: 'my_blog_tmp' does not appear to be a git repository"

    - by Anthony
    Hi, I'm very new to Git and I've been following this online tutorial for converting my existing SVN repository to a Git repository and am stuck at the final hurdle. http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/ On the last step of the tutorial it says to do this: git clone my_blog_tmp my_blog However, when I do, I get the following error: fatal: 'my_blog_tmp' does not appear to be a git repository fatal: The remote end hung up unexpectedly Some points: 1) I'm entering the above command from within the "my_blog_tmp" directory 2) I've tried entering "git init" to make sure Git is initialised inside the "my_blog_tmp" folder but no joy. Please help! Thank you :)

    Read the article

  • Performance in SQL Mobile with one big column that's not being selected

    - by Anthony Mastrean
    I have a SQL Mobile database with one table. It has several columns with useful, often queried data and one column that stores a relatively large string per record (1000+ characters) that is not queried often. Imagine this fake schema, the "lifeStory" field is the large one. table1 String firstName String lastName String address String lifeStory A representative query would be SELECT firstName, lastName, address FROM table1 WHERE firstName = :p1 Does anyone know of any performance concerns leaving that large, infrequently queried column in this table?

    Read the article

  • youtube embeded player: change video link with javascript, dinamically

    - by Anthony Koval'
    here is a part of html code (video urls marked with a django-template language variables): <div class="mainPlayer"> <object width="580" height="326"> <param name="movie" value="{{main_video.video_url}}"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="{{main_video.video_url}}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="580" height="326"></embed> </object> </div> and JS-code (using jQuery 1.4.x) $(document).ready(function(){ ..... $(".activeMovie img").live("click", function(){ video_url = ($(this).parent().find('input').val()); $('.mainPlayer').find('param:eq(0)').val(video_url); $('.mainPlayer').find('embed').attr('src', video_url); }) ... }) such a algorithm works fine in ff 3.6.3, but any luck in chrome4 or opera 10.x., src and value are changed, but youtube player still shows an old video.

    Read the article

  • Persisting hashlib state

    - by anthony
    I'd like to create a hashlib instance, update() it, then persist its state in some way. Later, I'd like to recreate the object using this state data, and continue to update() it. Finally, I'd like to get the hexdigest() o the total cumulative run of data. State persistence has to survive across multiple runs. Example: import hashlib m = hashlib.sha1() m.update('one') m.update('two') # somehow, persist the state of m here #later, possibly in another process # recreate m from the persisted state m.update('three') m.update('four') print m.hexdigest() # at this point, m.hexdigest() should be equal to hashlib.sha1().update('onetwothreefour').hextdigets()

    Read the article

  • WCF JSON Service returns XML on Fault

    - by Anthony Johnston
    I am running a ServiceHost to test one of my services and all works fine until I throw a FaultException - bang I get XML not JSON my service contract - lovely /// <summary> /// <para>Get category by id</para> /// </summary> [OperationContract(AsyncPattern = true)] [FaultContract(typeof(CategoryNotFound))] [FaultContract(typeof(UnexpectedExceptionDetail))] IAsyncResult BeginCategoryById( CategoryByIdRequest request, AsyncCallback callback, object state); CategoryByIdResponse EndCategoryById(IAsyncResult result); Host Set-up - scrummy yum var host = new ServiceHost(serviceType, new Uri(serviceUrl)); host.AddServiceEndpoint( serviceContract, new WebHttpBinding(), "") .Behaviors.Add( new WebHttpBehavior { DefaultBodyStyle = WebMessageBodyStyle.Bare, DefaultOutgoingResponseFormat = WebMessageFormat.Json, FaultExceptionEnabled = true }); host.Open(); Here's the call - oo belly ache var request = WebRequest.Create(serviceUrl + "/" + serviceName); request.Method = "POST"; request.ContentType = "application/json; charset=utf-8"; request.ContentLength = 0; try { // receive response using (var response = request.GetResponse()) { var responseStream = response.GetResponseStream(); // convert back into referenced object for verification var deserialiser = new DataContractJsonSerializer(typeof (TResponseData)); return (TResponseData) deserialiser.ReadObject(responseStream); } } catch (WebException wex) { var response = wex.Response; using (var responseStream = response.GetResponseStream()) { // convert back into fault //var deserialiser = new DataContractJsonSerializer(typeof(FaultException<CategoryNotFound>)); //var fex = (FaultException<CategoryNotFound>)deserialiser.ReadObject(responseStream); var text = new StreamReader(responseStream).ReadToEnd(); var fex = new Exception(text, wex); Logger.Error(fex); throw fex; } } the text var contains the correct fault, but serialized as Xml What have I done wrong here?

    Read the article

  • Is F# a good language for card game AI?

    - by Anthony Brien
    I'm writing a Mahjong Game in C# (the Chinese traditional game, not the solitaire kind). While writing the code for the bot player's AI, I'm wondering if a functional language like F# would be a more suitable language than what I currently use which is C# with a lot of Linq. I don't know much about F# which is why I ask here. To illustrate what I try to solve, here's a quick summary of Mahjong: Mahjong plays a bit like Gin Rummy. You have 13 tiles in your hand, and each turn, you draw a tile and discard another one, trying to improve your hand towards a winning Mahjong hand, which consists or 4 sets and a pair. Sets can be a 3 of a kind (pungs), 4 of a kind (kongs) or a sequence of 3 consecutive tiles (chows). You can also steal another player's discard, if it can complete one of your sets. The code I had to write to detect if the bot can declare 3 consecutive tiles set (chow) is pretty tedious. I have to find all the unique tiles in the hand, and then start checking if there's a sequence of 3 tiles that contain that one in the hand. Detecting if the bot can go Mahjong is even more complicated since it's a combination of detecting if there's 4 sets and a pair in his hand. And that's just a standard Mahjong hand. There's also numerous "special" hands that break those rules but are still a Mahjong hand. For example, "13 unique wonders" consists of 13 specific tiles, "Jade Empire" consists of only tiles colored green, etc. In a perfect world, I'd love to be able to just state the 'rules' of Mahjong, and have the language be able to match a set of 13 tiles against those rules to retrieve which rules it fulfills, for example, checking if it's a Mahjong hand or if it includes a 4 of a kind. Is this something F#'s pattern matching feature can help solve?

    Read the article

  • Use Lambda in Attribute constructor to get method's parameters

    - by Anthony Shaw
    I'm not even sure if this is possible, but I've exhausted all of my ideas trying to figure this out, so I figured I'd send this out to the community and see what you thought. And, if it's not possible, maybe you'd have some ideas as well. I'm trying to make an Attribute class that I can add to a method that would allow me to use a lambda expression to get each parameter of the method public ExampleAttribute : Attribute { public object Value { get; set; } public ExampleAttribute(--something here to make the lambda work--, object value) { Value = value; } } I'd like to be able to something like this below: [Example(x=x.Id, 4)] [Example(x=x.filter, "string value")] public ActionResult Index(int Id, string filter) { return View(); } I understand that I might be completely dreaming with this idea. I'm basically trying to write a model to allow for self-documenting REST API Documentation. In a recent project here at work we wrote a dozen or so services with 5 to 15 methods on each, I figure it's easier to write something to do this, than to hand code a documentation page for each. I would plan to eventually release this as an open-source project once I have it in a place that I feel it's releasable.

    Read the article

  • How do I [legally] get the current first responder on the screen on an iPhone?

    - by Anthony D
    I submitted my app a little over a week ago and got the dreaded rejection email today. It reads as follows: Dear -----------, Thank you for submitting --------- to the App Store. Unfortunately it cannot be added to the App Store because it is using a private API. Use of non-public APIs, which as outlined in the iPhone Developer Program License Agreement section 3.3.1 is prohibited: "3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs." The non-public API that is included in your application is firstResponder. Regards, iPhone Developer Program Now, the offending API call is actually a solution I found here on SO: UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; UIView *firstResponder = [keyWindow performSelector:@selector(firstResponder)]; So this is my question; How do I get the current first responder on the screen? I'm looking for a legal way that won't get my app rejected. Thanks. I figured this out based on the solution provided by Thomas below. Here is what the final code looks like: @implementation UIView (FindFirstResponder) - (UIView *)findFirstResonder { if (self.isFirstResponder) { return self; } for (UIView *subView in self.subviews) { UIView *firstResponder = [subView findFirstResonder]; if (firstResponder != nil) { return firstResponder; } } return nil; } @end

    Read the article

  • .htaccess and url

    - by Anthony
    Is it possible somehow using mod_rewrite change the url from http://www.mywebsite.com/company/123/reviews to http://www.mywebsite.com/company-123/reivews? It's not a redirect. The problem is that the real path is the first one and I need my browser to display the second path. So when the user goes to company-123/reviews the content of the page is displayed from company/123/reviews. Thank you.

    Read the article

  • remove specific values from multi value dictionary

    - by Anthony
    I've seen posts here on how to make a dictionary that has multiple values per key, like one of the solutions presented in this link: Multi Value Dictionary it seems that I have to use a List< as the value for the keys, so that a key can store multiple values. the solution in the link is fine if you want to add values. But my problem now is how to remove specific values from a single key. I have this code for adding values to a dictionary: private Dictionary<TKey, List<TValue>> mEventDict; // this is for initializing the dictionary public void Subscribe(eVtEvtId inEvent, VtEvtDelegate inCallbackMethod) { if (mEventDict.ContainsKey(inEvent)) { mEventDict[inEvent].Add(inCallbackMethod); } else { mEventDict.Add(inEvent, new List<TValue>() { v }); } } // this is for adding values to the dictionary. // if the "key" (inEvent) is not yet present in the dictionary, // the key will be added first before the value my problem now is removing a specific value from a key. I have this code: public void Unsubscribe(eVtEvtId inEvent, VtEvtDelegate inCallbackMethod) { try { mEventDict[inEvent].Remove(inCallbackMethod); } catch (ArgumentNullException) { MessageBox.Show("The event is not yet present in the dictionary"); } } basically, what I did is just replace the Add() with Remove() . Will this work? Also, if you have any problems or questions with the code (initialization, etc.), feel free to ask. Thanks for the advice.

    Read the article

  • iPhone AVAudioPlayer failed to find codec

    - by Anthony
    Hello, I am writing an app that downloads a wav file from a server and needs to play that file. The files use the mulaw codec with 2:1 compression. These wav files are dynamically created by a seperate process so there is no way for me to preconvert the files to a different format or codec, I need to be able to play them as is. I am using an AVAudioPlayer instance initialized as follows: NSURL *audioURL = [[NSURL alloc] initWithString:@"http://xxx.../file.wav"]; NSData *audioData = [[NSData alloc] initWithContentsOfURL:audioURL]; AVAudioPlayer *audio = [[AVAudioPlayer alloc] initWithData:audioData error:nil]; [audio play]; However, when the play method executes, I get the following Console Output when executing on the Simulator: AudioQueue codec policy 1: failed to find a codec of the requested type I also tried saving the downloaded data to a local file and using a file URL, however that yeilds the same results. The downloaded file does play fine on both Mac and Windows based desktop media players. The SDK docs state that the mulaw codec is supported on the iPhone, so I am unsure why it is failing to find it. Any assistance would be greatly appreciated. Thanks.

    Read the article

  • Binding to static property

    - by Anthony Brien
    I'm having a hard time binding a simple static string property to a text box. Here's the class with the static property: public class VersionManager { private static string filterString; public static string FilterString { get { return filterString; } set { filterString = value; } } } In my xaml, I just want to bind this static property to a text box: <TextBox> <TextBox.Text> <Binding Source="{x:Static local:VersionManager.FilterString}"/> </TextBox.Text> </TextBox> Everything compiles, but at run time, I get the following exception: Cannot convert the value in attribute 'Source' to object of type 'System.Windows.Markup.StaticExtension'. Error at object 'System.Windows.Data.Binding' in markup file 'BurnDisk;component/selectversionpagefunction.xaml' Line 57 Position 29. Any idea what I'm doing wrong?

    Read the article

  • can bound negative space be used in SVG?

    - by Anthony
    If I have a map of three countries, and their borders form the outline of a sea, is their a way with SVG to give that bound area attributes and style? Another example might be three triangles which form a third triangle in the center (like the triforce). If someone wanted to make that middle empty area glow (or whatever)...

    Read the article

  • iPad book / cartoon contents plus Marvel like cartoons

    - by anthony
    Hi, I want to create and sell book / cartoons by individual episodes. What's the best way to to this? iBook from the apple store tends to sell by entire volume / book... I see an App from Marvel sells its contents by individual episodes, but I don't want to create / maintain shopping carts and stuff. (I am assuming iPad / iPhone users are downloading each cartoon episodes by their Marvel servers) I want to utilize Apple iBook / iTune store... Second questions: Is Marvel-like cartoons all jpg pictures showing frame by frame? Thanks in advance!!!

    Read the article

  • (N)Hibernate: deleting orphaned ternary association rows when either associated row is deleted.

    - by anthony
    I have a ternary association table created using the following mapping: <map name="Associations" table="FooToBar"> <key column="Foo_id"/> <index-many-to-many class="Bar" column="Bar_id"/> <element column="AssociationValue" /> </map> I have 3 tables, Foo, Bar, and FooToBar. When I delete a row from the Foo table, the associated row (or rows) in FooToBar is automatically deleted. This is good. When I delete a row from the Bar table, the associated row (or rows) in FooToBar remain, with a stale reference to a Bar id that no longer exists. This is bad. How can I modify my hbm.xml to remove stale FooToBar rows when deleting from the Bar table?

    Read the article

  • Variable declarations following if statements

    - by Anthony Pegram
    An issue came up on another forum and I knew how to fix it, but it revealed a feature of the compiler peculiar to me. The person was getting the error "Embedded statement cannot be a declaration or labeled statement" because they had a declaration of a variable following an if statement with no brackets. That was not their intent, but they had commented out the line of code immediately following the if statement, which made the variable declaration the de facto line of code to execute. Anyway, that's the background, which brings me to this. The following code is illegal if (true) int i = 7; However, if you wrap that in brackets, it's all legal. if (true) { int i - 7; } Neither piece of code is useful. Yet the second one is OK. What specifically is the explanation for this behavior? I have a hypothesis, but I'd rather ask the brilliant people on stackoverflow.

    Read the article

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