Search Results

Search found 142 results on 6 pages for 'amir rachum'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Exception_Record in python2.5 problem

    - by amir
    I'm using Python2.5 & the following code produce 2 errors. Can any body help me? class EXCEPTION_RECORD(Structure): _fields_ = [ ("ExceptionCode", DWORD), ("ExceptionFlags", DWORD), ("ExceptionRecord", POINTER(EXCEPTION_RECORD)), ("ExceptionAddress", LPVOID), ("NumberParameters", DWORD), ("ExceptionInformation", ULONG_PTR * EXCEPTION_MAXIMUM_PARAMETERS)] Python Error: Traceback (most recent call last): File "E:\Python25\my_debugger_defines.py", line 70, in <module> class EXCEPTION_RECORD(Structure): File "E:\Python25\my_debugger_defines.py", line 74, in EXCEPTION_RECORD ("ExceptionRecord", POINTER(EXCEPTION_RECORD)), NameError: name 'EXCEPTION_RECORD' is not defined Microsoft Document: The EXCEPTION_RECORD structure describes an exception. typedef struct _EXCEPTION_RECORD { // exr DWORD ExceptionCode; DWORD ExceptionFlags; struct _EXCEPTION_RECORD *ExceptionRecord; PVOID ExceptionAddress; DWORD NumberParameters; DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD; Thanks in advance

    Read the article

  • How to show that the double-checked-lock pattern with Dictionary's TryGetValue is not threadsafe in

    - by Amir
    Recently I've seen some C# projects that use a double-checked-lock pattern on a Dictionary. Something like this: private static readonly object _lock = new object(); private static volatile IDictionary<string, object> _cache = new Dictionary<string, object>(); public static object Create(string key) { object val; if (!_cache.TryGetValue(key, out val)) { lock (_lock) { if (!_cache.TryGetValue(key, out val)) { val = new object(); // factory construction based on key here. _cache.Add(key, val); } } } return val; } This code is incorrect, since the Dictionary can be "growing" the collection in _cache.Add() while _cache.TryGetValue (outside the lock) is iterating over the collection. It might be extremely unlikely in many situations, but is still wrong. Is there a simple program to demonstrate that this code fails? Does it make sense to incorporate this into a unit test? And if so, how?

    Read the article

  • objective c and NSDate

    - by Amir
    hello all, I am looking for component that can handle a spesific date. what i am trying to do is to get Astring fron sever that represent date(for example 04-08-2012) in my iphone i want to be able to "work" with this date. such to compare it to another date , check if the date in the past or future and to print it to the app GUI i tried work with NSDate but i didnt found how can i set a spesific date? thanks

    Read the article

  • objective c - memory managment

    - by Amir
    lets say I have aclass @interface Foo :NSobject { NSstring *a; NSDate *b; } Foo *temp; my question is: when i use [temp retain] does the counter of the members also retain? lets say that i got ref of the class from some method and i want to retain the class do i need to retain each member?

    Read the article

  • Proxy Issues with Javascript Cross Domain RSS Feed Parsing

    - by Amir
    This is my Javascript function which grabs an rss feed via the proxy script and then spits out the 5 latest rss items from the feed along with a link to my stylesheet: function getWidget (feed,limit) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest() } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP") } xhttp.open("GET","http://MYSITE/proxy.php?url="+feed,false); xhttp.send(""); xmlDoc=xhttp.responseXML; var x = 1; var div = document.getElementById("div"); srdiv.innerHTML = '<link type="text/css" href="http://MYSITE/css/widget.css" rel="stylesheet" /><div id="rss-title"></div></h3><div id="items"></div><br /><br /><a href="http://MYSITE">Powered by MYSITE</a>'; document.body.appendChild(div); content=xmlDoc.getElementsByTagName("title"); thelink=xmlDoc.getElementsByTagName("link"); document.getElementByTagName("rss-title").innerHTML += content[0].childNodes[0].nodeValue; for (x=1;x<=limit;srx++) { y=x; y--; var shout = '<div class="item"><a href="'+thelink[y].childNodes[0].nodeValue+'">'+content[x].childNodes[0].nodeValue+'</a></div>'; document.getElementById("items").innerHTML += shout; } } Here is the the code from proxy.php: $session = curl_init($_GET['url']); // Open the Curl session curl_setopt($session, CURLOPT_HEADER, false); // Don't return HTTP headers curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Do return the contents of the call $xml = curl_exec($session); // Make the call header("Content-Type: text/xml"); // Set the content type appropriately echo $xml; // Spit out the xml curl_close($session); // And close the session Now when I try to load this on any domain that's not my site nothing loads. I get no JS errors, but I in the Console tab in firebug I get "407 Proxy Authentication Required" So I'm not really sure how to make this work. The goal is to be able to grab the RSS feed, parse it to grab the titles and links and spit it out into some HTML on any website on the web. I"m basically making a simple RSS widget for my site's various RSS feeds. My Javascript is wack Also, I'm really a beginner with Javascript. I know jQuery pretty well, but I wasn't able to use it in this case, because this script will be embeded on any site and I can't really rely on the jQuery library. So I was decided to write some basic Javascript relying on the default XML parsing options available. Any suggestions here would be cool. Thanks! What's with the x and y They way my site creates RSS feeds is that the first title is actually the RSS feed title. The second title is the title of the first item. The first link is the link to the first item. So when using the javascript to get the title, I had to first grab the first title (which is the RSS title) and then start with the second title that being the first title of the item. Sorry for the confusion, but I don't think this is related to my issue. Just wanted to clarify my code.

    Read the article

  • Is a sharepoint developer technically "equipped" to do custom app dev and vise-versa?

    - by Amir
    This may be an opinion based question, but it's something that I wanted to ask (even if it does end up getting closed or deleted). I do custom app dev (asp.net/aspMVC) and have absolutely no knowledge about sharepoint and was wondering: If you have a "rock solid" custom app dev, asp.net/aspMVC web developer can he jump into sharepoint development fairly easily? What about the other way around? Does a seasoned sharepoint developer have the "chops" to do custom app dev using asp.net/aspMVC? By no means do I want to offend any sharepoint developers or any custom app dev developers. I'm merely trying to see how much knowledge you can take with you when going from one type of development to another.

    Read the article

  • Home_path issue with RoR testing locally on mobile device

    - by Amir
    When I use <%= link_to image_tag("foo.png"), home_path %> and display it on my localhost on my iPhone, it's broken. When I inspect on with firebug, the src of the image is http://localhost:3000/images/foo.png thus causing it to break on my iPhone. When I use <img src="/images/foo.png" /> it displays fine on my iPhone. I am pointing to the IP address of my PC running the server of my rails app in Safari. It's loading the text but all the css, JavaScript, and images are missing unless the path is absolute with using the rails default helpers. Is there a way to correct this path issue locally so it's absolute like /images/foo.png instead of http://localhost:3000/images/foo.png. Update CSS file paths are also affected. Instead of just making the path /stylesheets/foo.css, it's http://localhost:3000/stylesheets/foo.css. Update: Solution It's the Facebook plugin changing the asset host to the callback url of my facebook app settings which is currently set to http://localhost:3000/

    Read the article

  • Flash: Using mouse wheel events in full screen mode (Windows and Mac)

    - by Amir
    Although Flash has a mouse wheel event (MouseEvent.MOUSE_WHEEL), it comes with quite a few problems. The first is that the event is not yet supported on the Mac. So there are a bunch of solutions, all of which (basically) capture the mousewheel (or DOMMouseScroll) event in javascript and pass it into the flash app. Luckily, under all the Mac browsers I tested, this also works when flash is in fullscreen mode. Problem 2 is that flash ignores mouse wheel events with small "deltas". For example, Microsoft's IntelliPoint Mice with "Smooth Scroll" causes this problem. A solution to this is the same as the solution for the mac... i.e. capture the javascript mouse wheel event in the browser and pass it to the app. The issue is that of the browsers in windows that I tested (firefox, ie, safari, and chrome), they don't seem to capture this event when flash is in full screen mode. Does anyone know why or how to fix that? I currently have a hybrid solution that always takes events from javascript (in non-fullscreen or fullscreen mode) except when it's in fullscreen mode on Windows (at which point it takes them from the flash mousewheel event). So the only times it fails is in full screen mode on Windows with a mouse that has small deltas. Anyone have a full solution? Or just a better one?

    Read the article

  • How to make a report with count of type of cases in each month in Acess 2010

    - by amir shadaab
    I have a database is access with each record having a date and yes/no type columns for each record which shows which category the record comes under. I want to create a report which shows the types of cases in each month by taking a date range as a parameter through prompts. I have done the prompt part but I'm not sure how the query should be to show values for each month in that date range. Can someone please help me with this?

    Read the article

  • Is reverse engineering evil?

    - by Amir Arad
    Lately I've been pondering on how a specific beloved old game actually works. I had some mild progress, but then a friend pointed out that if I really loved the game and appreciate it, I wouldn't try to reverse-engineer it. Note that the game is long considered an abandonware and is offerd for download publicly in lawful game sites, and I have no commercial / other large scale intentions - just to learn and "mess around" with it. Did I miss something? Is there an ethical taboo regarding reverse-engeneering? Alternatively, is there a legal issue?

    Read the article

  • Array of pointers in Objective-C using NSArray

    - by Amir
    Hello, I am writting program for my iphone and have a qestion. lets say i have class named my_obj class my_obj { NSString *name; NSinteger *id; NSinteger *foo; NSString *boo; } now i allocate 100 objects from type my_obj and insert them to array from type NSArray. then i want to sort the Array in two different ways. one by the name and the second by the id. i want to allocate another two arrays from type NSArray *arraySortByName *arraySortById what i need to do if i just want the sorted arrays to be referenced to the original array so i will get two sorted arrays that point to the original array (that didnt changed!) i other word i dont want to allocate another 100 objects to each sorted array.

    Read the article

  • objective c - release problem

    - by amir
    Hello, I have the following code: NSNumber *number = [NSNumber numberWithInt:5]; int i = [number retainCount]; [number release]; i = [number retainCount]; [number release]; i = [number retainCount]; the problem is that in line 2 , the value of parameter i is 2 and in line 4 the value is 1. then in line 6 the value is still 1.???????? first i dont understand why after init *number the retaincount is 2 and not 1?? second i dont understand why after release it 2 times retaincount is not 0? it doesnt matter how many times i release the object the retaincount stay 1.

    Read the article

  • What is fastest way to convert bool to byte?

    - by Amir Rezaei
    What is fastest way to convert bool to byte? I want this mapping: False=0, True=1 Note: I don't want to use any if statement. Update: I don't want to use conditional statement. I don't want the CPU to halt or guess next statement. I want to optimize this code: private static string ByteArrayToHex(byte[] barray) { char[] c = new char[barray.Length * 2]; byte k; for (int i = 0; i < barray.Length; ++i) { k = ((byte)(barray[i] >> 4)); c[i * 2] = (char)(k > 9 ? k + 0x37 : k + 0x30); k = ((byte)(barray[i] & 0xF)); c[i * 2 + 1] = (char)(k > 9 ? k + 0x37 : k + 0x30); } return new string(c); } Update: The length of the array is very large, it's in terabyte order! Therefore I need to do optimization if possible. I shouldn't need to explain my self. The question is still valid. Update: I'm working on a project and looking at others code. That's why I didn't provide with the function at first place. I didn't want to spend time on explaining for people when they have opinion about the code. I shouldn’y need to provide in my question the background of my work, and a function that is not written by me. I have started to optimize it part by part. If I needed help with the whole function I would asked that in another question. That is why I asked this very simple at the beginning. Unfortunately people couldn’t keep themselves to the question. So please if you want to help answer the question. Update: For dose who want to see the point of this question. This example shows how two if statement are reduced from the code. byte A = k > 9 ; //If it was possible (k>9) == 0 || 1 c[i * 2] = A * (k + 0x30) - (A - 1) * (k + 0x30);

    Read the article

  • How to load a jar file at runtime

    - by Amir Arad
    Hi, I was asked to build a java system that will have the ability to load new code (expantions) while running. How do I re-load a jar file while my code is running? or how do I load a new jar? Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if it does not complicate things too much). What are the things I should look out for? (think of it as two different questions - one regarding reloading classes at runtime, the other regarding adding new classes).

    Read the article

  • Convert ISO/Windows charsets to UTF-8 in Javascript

    - by Amir
    I'm developing a firefox plugin and i fetch web pages to do some analysis for the user. The problem is when i try to get (XMLHttpRequest) pages that are not utf-8 encoded the string i see is messed up. For example hebrew pages with windows-1125 or Chinese pages with gb2312. I already tried the following: var uDecoder=Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].getService(Components.interfaces.nsIScriptableUnicodeConverter); uDecoder.charset="windows-1255"; alert( xhr.responseText ); var decoder=Components.classes["@mozilla.org/intl/utf8converterservice;1"].getService(Components.interfaces.nsIUTF8ConverterService); alert(decoder.convertStringToUTF8(xhr.responseText,"WINDOWS-1255",true)); I also tried escape/unescape/encodeURIComponent any ideas???

    Read the article

  • Client / Server security from mobile to website

    - by Amir Latif
    Hey. Am new to the world of web programming and learning a bunch of fairly simple new pieces of tech, trying to piece them all together. So, we have a simple client (currently iPhone, to move to J2ME soon) that's pulling down lists of data via PHP, which is talking to a MySQL db. I have a rudimentary user/login system so that data is only served to someone who matches a known user etc, either on the website or on the client. All the php scripts on the website that query the DB check to make sure an active session is in place, otherwise dumping the user back to the login screen. I've read a little about SSL and want to know if that is sufficient to protect the website AND the data passing between the server and the client?

    Read the article

  • iOS: RestKit loadObject & send params

    - by Alon Amir
    using loadObjectAtResourcePath, on GET method, doesn't include my parameters on the requests. for example, i send: [RKObjectManager objectManagerWithBaseURL:@"http://something/ws"]; [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/res" delegate:self block:^(RKObjectLoader *loader) { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"val", @"param1", nil]; loader.params = [RKParams paramsWithDictionary:dict]; }]; the final url request doesn't include the "?param1=val" part - why is that?

    Read the article

  • Image not loading from cache after it's loaded in an iframe

    - by Amir
    I'm loading an image in an iframe and then (once the iframe is loaded) loading the image on the page. But most browsers seem to be loading the image twice. Why isn't the img tag being loading from the cache? Something like this: var loader = $('<iframe />').appendTo('body')[0]; loader.onload = function() { $('body').append('<img src="' + imgsrc + '" />'); }; loader.src = imgsrc; http://jsfiddle.net/amirshim/na3UA/ I'm using fiddler2 to see the network traffic. In case you want to know why I want to do this, check out this question

    Read the article

  • is it possible to make a child element visible if the parent is hidden

    - by amir
    Hi just wondering if its possible to have a hidden parent and a visible child with css or jQuery, basically on some certain pages I'm trying to make a child element visible even though the parents are hidden, var bodyClass = jQuery('body').attr('class'); //alert (bodyClass); var searchTerm = 'category-mens'; var searchTerm2 = 'category-ladies'; if((bodyClass.search(searchTerm) || bodyClass.search(searchTerm2)) != -1) { jQuery('.nav-container ul.level0 li.level1 ul.level1 li.level2 ul.level2 li.first a span').css({ 'display':'block', 'position':'absolute', 'top':'500px', 'left':'500px' }); } at the moment it doesn't work because the li.level2 is hidden. Thanks for the help.

    Read the article

  • how to make an ajax search

    - by amir
    I'm trying to make an ajax search for a website, HTML : <form id="search" method="post" action="search.php"> <input type="text" name="search" /> <input type="image" name="submit" alt="search" src="images/buttons/search.gif" /> </form> $(function() { var search_text = ''; $('form#search input[name=submit]').click(function() { search_text = $('form#search input[name=search]').val(); $.get('../search.php',{ s: search_text }); return false; }); }); in the search.php file I have the following <?php $search = $_GET['s']; if (isset($_POST['submit_x'])) { $search = $_POST['search']; $search = str_replace(' ','',$search); $search = strtolower($search); if($search == 'kingbabychosenheart' || $search == 'chosenheart' || $search == 'beltchosenheart') { echo "<meta http-equiv='refresh' content='0;url=chosen_heart.php'>"; } else { echo "<meta http-equiv='refresh' content='0;url=not_found.php'>"; } } ?> but this doesn't work, what else do I have to do to make this work? thanks

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >