Search Results

Search found 4300 results on 172 pages for 'mark virtue'.

Page 79/172 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Sort an array via x86 Assembly (embedded in C++)?? Possible??

    - by Mark V.
    I am playing around with x86 assembly for the first time and I can't figure out how to sort an array (via insertion sort).. I understand the algorithm, but assembly is confusing me as I primarily use Java & C++. Heres all I have so far int ascending_sort( char arrayOfLetters[], int arraySize ) { char temp; __asm{ push eax push ebx push ecx push edx push esi push edi //// ??? pop edi pop esi pop edx pop ecx pop ebx pop eax } } Basically nothing :( Any ideas?? Thanks in advance.

    Read the article

  • How to reserve public API to internal usage in .NET?

    - by mark
    Dear ladies and sirs. Let me first present the case, which will explain my question. This is going to be a bit long, so I apologize in advance :-). I have objects and collections, which should support the Merge API (it is my custom API, the signature of which is immaterial for this question). This API must be internal, meaning only my framework should be allowed to invoke it. However, derived types should be able to override the basic implementation. The natural way to implement this pattern as I see it, is this: The Merge API is declared as part of some internal interface, let us say IMergeable. Because the interface is internal, derived types would not be able to implement it directly. Rather they must inherit it from a common base type. So, a common base type is introduced, which would implement the IMergeable interface explicitly, where the interface methods delegate to respective protected virtual methods, providing the default implementation. This way the API is only callable by my framework, but derived types may override the default implementation. The following code snippet demonstrates the concept: internal interface IMergeable { void Merge(object obj); } public class BaseFrameworkObject : IMergeable { protected virtual void Merge(object obj) { // The default implementation. } void IMergeable.Merge(object obj) { Merge(obj); } } public class SomeThirdPartyObject : BaseFrameworkObject { protected override void Merge(object obj) { // A derived type implementation. } } All is fine, provided a single common base type suffices, which is usually true for non collection types. The thing is that collections must be mergeable as well. Collections do not play nicely with the presented concept, because developers do not develop collections from the scratch. There are predefined implementations - observable, filtered, compound, read-only, remove-only, ordered, god-knows-what, ... They may be developed from scratch in-house, but once finished, they serve wide range of products and should never be tailored to some specific product. Which means, that either: they do not implement the IMergeable interface at all, because it is internal to some product the scope of the IMergeable interface is raised to public and the API becomes open and callable by all. Let us refer to these collections as standard collections. Anyway, the first option screws my framework, because now each possible standard collection type has to be paired with the respective framework version, augmenting the standard with the IMergeable interface implementation - this is so bad, I am not even considering it. The second option breaks the framework as well, because the IMergeable interface should be internal for a reason (whatever it is) and now this interface has to open to all. So what to do? My solution is this. make IMergeable public API, but add an extra parameter to the Merge method, I call it a security token. The interface implementation may check that the token references some internal object, which is never exposed to the outside. If this is the case, then the method was called from within the framework, otherwise - some outside API consumer attempted to invoke it and so the implementation can blow up with a SecurityException. Here is the modified code snippet demonstrating this concept: internal static class InternalApi { internal static readonly object Token = new object(); } public interface IMergeable { void Merge(object obj, object token); } public class BaseFrameworkObject : IMergeable { protected virtual void Merge(object obj) { // The default implementation. } public void Merge(object obj, object token) { if (!object.ReferenceEquals(token, InternalApi.Token)) { throw new SecurityException("bla bla bla"); } Merge(obj); } } public class SomeThirdPartyObject : BaseFrameworkObject { protected override void Merge(object obj) { // A derived type implementation. } } Of course, this is less explicit than having an internally scoped interface and the check is moved from the compile time to run time, yet this is the best I could come up with. Now, I have a gut feeling that there is a better way to solve the problem I have presented. I do not know, may be using some standard Code Access Security features? I have only vague understanding of it, but can LinkDemand attribute be somehow related to it? Anyway, I would like to hear other opinions. Thanks.

    Read the article

  • Are there any good materials or examples on creating a custom Designer in the Delphi IDE

    - by Mark Elder
    I am working on creating a custom form designer in the Delphi IDE. I'm trying to use the RegisterCustomModule, TBaseCustomModule, and ICustomModule functions, classes, and interfaces. My first question on this pointed me to the Delphi Developer's Handbook and the idea that I could even create a custom form designer. However, that book seems to be all Delphi 3 information and things have really changed since then. I'm not finding any material in the Delphi Help file, and searches have not returned very much. I did find the Accidental Programmer's page on the Open Tools, but that looks like it was last up dated in 1998? It does at least have the correct unit names and uses the new interfaces. I'm willing to track down and buy an older book if that is the best reference.

    Read the article

  • Django: HTTPS for just login page?

    - by Mark
    I just added this SSL middleware to my site http://www.djangosnippets.org/snippets/85/ which I used to secure only my login page so that passwords aren't sent in clear-text. Of course, when the user navigates away from that page he's suddenly logged out. I understand why this happens, but is there a way to pass the cookie over to HTTP so that users can stay logged in? If not, is there an easy way I can use HTTPS for the login page (and maybe the registration page), and then have it stay on HTTPS if the user is logged in, but switch back to HTTP if the user doesn't log in? There are a lot of pages that are visible to both logged in users and not, so I can't just designate certain pages as HTTP or HTTPS.

    Read the article

  • jquery Checking to see if element has element

    - by Mark
    I'm using jquery 1.3 and is trying to duplicate the 1.4 .has functionality. I need to check if the .page element contains the image, and if it doesn't, append it. Is it something like: var imageid = thirdimage; if ($('#page:has(#'+imageid+')') === undefined) { $('#page').append($('#'+imageid)); } Thanks.

    Read the article

  • Under what conditions will you get unresolved external symbol for __declspec(dllimport)?

    - by Mark
    I am converting an application to use .dlls and I'm riddled with linker errors stating unersolved external symbol"__declspec(dllimport) public: void __thiscall Rail::SetNextrail(class Rail *)" There is more gibberish at the end of this error message. Why should this happen and how do you fix it? __declspec(dllimport) is being placed with a macro defined as: #ifdef LUDOAI_EXPORT #define DECLSPECAI __declspec(dllexport) #else #define DECLSPECAI __declspec(dllimport) #endif

    Read the article

  • Curl download image only if not older than 2 days

    - by mark
    I want to download a image from a remote server only if it is not older than 2 days. I have the constructing as below now. Is this right? I want to now the last_modified data first before downloading. $ch = curl_init($file_source); // the file we are downloading curl_setopt($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_FILE, $wh); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_FILETIME, true); curl_exec($ch); $headers = curl_getinfo($ch); $last_modified = $headers['filetime']; if ($last_modified != -1) { // unknown echo date("Y-m-d", $last_modified); //etc } curl_close($ch); fclose($wh);

    Read the article

  • Strange "cache" effect between client and server

    - by mark
    I use a Socket-based connection between Client and server with ObjectOutputStream. The objects serialized and exchanged have this structure: public class RichiestaSalvataggioArticolo implements Serializable { private ArticoloDati articolo; public RichiestaSalvataggioArticolo(ArticoloDati articolo) { this.articolo = articolo; } @Override public void ricevi(GestoreRichieste gestore) throws Exception { gestore.interpreta(this); } public ArticoloDati getArticolo() { return articolo; } } the issue is that when I try to exchange messages between C/S with incapsulated content very similar (ArticoloDati whom differ only in 2 fields out of 10), the Client sends an ArticoloDati, but the Server receives the previous one. Does the ObjectOutputStream implement some kind of cache or memory between the calls, that fails to recognize that my 2 objects are different because they are very similar?

    Read the article

  • Rails passenger production cache definition

    - by mark
    Hi I'm having a bit of a problem with storing data in rails cache under production. What I currently have is this, though I have been trying to work this out for hours already: #production.rb config.cache_store = :mem_cache_store if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| if forked Rails.cache.instance_variable_get(:@data).reset end end end I am using a cron job to (try to) save remote data to the cache for display. It is logged as being written to the cache but reportedly null. If anyone could point me toward a decent current tutorial on the subject or offer guidance I'd be extremely grateful. This is really, really frustrating me. :(

    Read the article

  • How to create a web framework in C# without ASP?

    - by Mark
    I've managed to get a C# asp page running under ubuntu/apache/mono, but I don't want to write my framework in these ASP pages, I want to use straight C# and then I'll use a templating language for my views. But I don't know where to begin? C# is a compiled language, so... how would I do this? Would I compile everything and then have apache hook into the (single) executable and pass in the the request URL? Could I request specific .cs pages and then have apache tell it to compile and then "display" it only if it's been updated? Can the "view" files be compiled individually to avoid having to recompile everything every time there's a change? Is there some "base" I can work from, or am I going to have to reinvent accessing GET and POST variables (by reading header info) and all sorts of other stuff we take for granted in languages like PHP?

    Read the article

  • Can you use the same Enum in multiple entities in Linq-to-SQL?

    - by Mark
    In my persistence layer, I've declared a load of Enums to represent tables containing reference data (i.e. data never changes). In Linq2SQL, I am able to set the type of an entity property to an enum type and all is well, but as soon as I set a second entity's property to use the same enum type, the Code Generator (MSLinqToSQLGenerator) start generating an empty code file. I assume that MSLinqToSQLGenerator is quietly crashing. The question is why, and are there any work-arounds? Anyone else experienced this problem?

    Read the article

  • Jump-To-Code-Line Eclipse Shortcuts

    - by scrr
    Hello, is it possible, in Eclipse, to mark certain lines with Shortcuts and be able to quickly jump to those lines? Example: Let's say I have maintenanceHeavyMethod() at line 120 in my class, gameLoop() at line 800 and some listener at line 1460. I'd like to f.ex. press CTRL-SHIFT-1, 2, 3 etc. to mark those positions, and then use f.ex. CTRL-1, 2, 3 to immediately jump to them. I don't like split-screens etc, but I need to jump around when writing. Is there such a feature? I'm using latest Eclipse to write Java-programs.

    Read the article

  • Passing XML data and user from coldfusion page to .NET page

    - by Mark Rullo
    I'd appreciate some input on this situation, I can't figure out the best way to do this. I have some data that's being prepared for me in a ColdFusion app and in an IFrame within the CF app we want to display some graphs (not strictly an image, it's an entire page) being generated on the .NET side of things. I'd like to pass XML data from the CF side to .NET as well as the user. On the .NET side I'm putting the data in a session so the user can sift through it without the need to have it re-queried and re-passed from CF. What I've tried: Generating XML with CF, putting it in a hidden form field, auto-submitting (with JS) a the form to the .NET side. The issue I'm having with this approach is the encoding being done on the form post. The data has entries like <entry data="hello &amp; goodbye">. It's an issue because it's being URL encdeded, Posted, and when I get it on the .NET side I get <entry data="hello & goodbye"> which isn't properly formed XML. What I'd like to avoid: An intermediary DB approach (dropping the data in a DB on CF, picking it up with .NET) I'd like to only display what is passed to the page. I have security concerns with the data, it's very sensitive. Passing the data to a webservice, returning a GUID, forwarding the user with a URL Parameter to access the passed in data. I think that'd be risky if someone happened on a link to that data. I can't take that risk. I was thinking of passing the data with JSON, but I'm very unfamiliar with it. Thoughts? Thanks for your time folks.

    Read the article

  • jQuery Photo Search Results Pagination using AJAX and JSON

    - by Mark Richman
    I have a "photo search" page that needs to present search results in a 5x5 grid of photo thumbnails. I'd like to populate this grid using the JSON results of a jQuery $.ajax() call to my ASP.NET web service. Where I'm struggling is with pagination, where clicking [First][Prev][1][2][3]...[20][21][Next][Last] will call back again via ajax and repopulate the results with the appropriate images. So I need to find a solution to both the pagination control itself and the search results. Is there a jQuery plugin for this, or something I can easily adapt for my purposes?

    Read the article

  • ASP.NET MVC: How to create a basic Pseudo Viewstate? Or better solution?

    - by Mark Redman
    I am newish to MVC and understand all the great things about it, including the reasons why voewstate isnt available, however there are some circumstances where I think having some kind of view state will be quite handy, In my case I am thinking about list pages with various search filters that can be applied to the list. Would it be worthwhile implementing some kind of pseudo viewstate to hold this info in some cases? or is there a better solution? Any examples out there? Your comments appreciated.

    Read the article

  • SVN: Recurisvely add files?

    - by Mark
    I'm trying svn add *.py --force As the documentation suggests, but I know for a fact it's missing files nested in deeper folders. Why? Is there a standard way to do this with other unix commands too? */*.py will nab a few more files, but it's kind of a pain in the butt to do this for every possible depth.

    Read the article

  • Eclipse: The icons in "Display View" are all greyed out

    - by Mark Silberbauer
    The discussion here describes the "display view" in eclipse which allows one to to quickly evaluate java expressions. The thing is, when I open the display view the icons remain greyed out and I can't execute anything. The only icon that isn't is "clear console". The odd thing is, alot of the screenshots on the web show the same behaviour but the people posting about the feature don't mentioned it. There aren't any options in the context sensitive menu either. I'm trying it on a java project. I've tried it in the debug view and I get the same issue. I'll provide a screenshot once my hosting is sorted. I'm using eclipse 3.4.

    Read the article

  • Centering Divisions Around Zero

    - by Mark
    I'm trying to create something that sort of resembles a histogram. I'm trying to create buckets from an array. Suppose I have a random array doubles between -10 and 10; this is very simplified. I then want to specify a center point, in this case 0 and the number of buckets. If I want 4 buckets the division would be -10 to -5, -5 to 0, 0 to 5 and 5 to 10. Not that complicated right. Now if I change the min and max to -12 and -9 and as for 4 divisions its more complicated. I either want a division at -3 and 3; it is centered around 0 ; or one at -6 to 0 and 0 to 6. Its not that hard to find the division size = Math.Ceiling((Abs(Max) + Abs(Min)) / Divisions) Then you would basically have an if statement to determine whether you want it centered on 0 or on an edge. You then iterate out from either 0 or DivisionSize/2 depending on the situation. You may not ALWAYS end up with the specified number of divisions but it will be close. Then you iterate through the array and increment the bin count. Does this seem like a good way to go about this? This method would surely work but it does not seem to be the most elegant. I'm curious as to whether the creation of the bins and the counting from the list could be done in a clever class with linq in a more elegant way? Something like creating the bins and then having each bin be a property {get;} that returns list.Count(x=> x >= Lower && x < Upper).

    Read the article

  • Automator / AppleScript to process incoming emails in Mac Mail

    - by mark
    Hello all, I'm designing an app that allows users to email me crash reports if my app ever crashes. I'd like to leave Mac Mail running on a computer and when an email comes through, an automator script / AppleScript runs to process the contents of the body of the email. I've got the entire parsing/processing done in a python script, except I have to manually copy the contents of the email into a file and then run my parser on that file. What's the best way to set this up so I can the contents of the email be pushed into my parsing script? Many thanks!

    Read the article

  • insert multiple rows into database from arrays

    - by Mark
    Hi, i need some help with inserting multiple rows from different arrays into my database. I am making the database for a seating plan, for each seating block there is 5 rows (A-E) with each row having 15 seats. my DB rows are seat_id, seat_block, seat_row, seat_number, therefore i need to add 15 seat_numbers for each seat_row and 5 seat_rows for each seat_block. I mocked it up with some foreach loops but need some help turning it into an (hopefully single) SQL statement. $blocks = array("A","B","C","D"); $seat_rows = array("A","B","C","D","E"); $seat_nums = array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"); foreach($blocks as $block){ echo "<br><br>"; echo "Block: " . $block . " - "; foreach($seat_rows as $rows){ echo "Row: " . $rows . ", "; foreach($seat_nums as $seats){ echo "seat:" . $seats . " "; } } } Maybe there's a better way of doing it instead of using arrays? i just want to avoid writing an SQL statement that is over 100 lines long ;) (im using codeigniter too if anyone knows of a CI specific way of doing it but im not too bothered about that)

    Read the article

  • Unable to connect to any of the specified MySQL hosts.

    - by Mark
    Can anyone help me on how this error arises? My previous version of MySql.dll is 1.0.7.30072 then I have upgrade my MySql.dll version into 1.0.10.1 to prevent opening new MySql transaction when the previous transaction is not yet committed.. Is it the error arises because of the new dll?

    Read the article

  • hash fragments and collisions cont.

    - by Mark
    For this application I've mine I feel like I can get away with a 40 bit hash key, which seems awfully low, but see if you can confirm my reasoning (I want a small key because I want a small filename and the key will be converted to a filename): (Note: only accidental collisions a concern - no security issues.) A key point here is that the population in question is divided into groups, and a collision is only relevant if it occurs within the same group. A "group" is a directory on a user's system (the contents of files are hashed and a collision is only relevant if it occurs for files within the same directory). So with speculating roughly 100,000 potential users, say 2^17, that corresponds to 2^18 "groups" assuming 2 directories per user on average. So with a 40 bit key I can expect 2^(20+9) files created (among all users) before a collision occurs for some user somewhere. (Or IOW 2^((40+18)/2), due to the "birthday effect".) That's an average 4096 unique files created per user, for 2^17 users, before a single collision occurs for some user somewhere. And then that long again before another collision occurs somewhere (right?)

    Read the article

  • autosave pattern

    - by Mark
    I'm using localstorage to do gmail-style autosave on a webpage. So I basically save every 30 seconds to local, OK. The problem is recovery. I can't detect whether or not a user has crashed or incorrectly exited. So let's say the user crashed and loads up the form again, I can't just continue saving and overwriting the previous autosaves. I need to restore the previous save. But let's say the user didn't crash. He did everything correctly, but then used a different browser to edit the same file, so no new data to the previous browser's localstorage. He then loads up the file in the previous browser. The localstorage should not be restored in that case. Assuming there's no way to compare timestamps, how can I solve this problem? Thanks.

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >