Search Results

Search found 86 results on 4 pages for 'fabian gradolph'.

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

  • Branchless memory manager?

    - by Richard Fabian
    Anyone thought about how to write a memory manager (in C++) that is completely branch free? I've written a pool, a stack, a queue, and a linked list (allocating from the pool), but I am wondering how plausible it is to write a branch free general memory manager. This is all to help make a really reusable framework for doing solid concurrent, in-order CPU, and cache friendly development. Edit: by branchless I mean without doing direct or indirect function calls, and without using ifs. I've been thinking that I can probably implement something that first changes the requested size to zero for false calls, but haven't really got much more than that. I feel that it's not impossible, but the other aspect of this exercise is then profiling it on said "unfriendly" processors to see if it's worth trying as hard as this to avoid branching.

    Read the article

  • Post-Render Fbml (Ajax Callback)

    - by fabian
    Hi there, i am doing a simple ajax call with FBJS. The server returns a fbml string which i render in one of my DIVs. The Problem: FB doesnt render the prefix for attributes like style, onclick etc. I have seen a function for some kind of post-rendering somewhere. But i cant remember Thanks for helping.

    Read the article

  • How does AssemblyName.ReferenceMatchesDefinition work?

    - by Fabian Schmied
    Given the following code: var n1 = new AssemblyName ("TestDll, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089"); var n2 = new AssemblyName ("TestDll, Version=2.0.0.2001, Culture=en-US, PublicKeyToken=ab7a5c561934e089"); Console.WriteLine (AssemblyName.ReferenceMatchesDefinition (n1, n2)); Console.WriteLine (AssemblyName.ReferenceMatchesDefinition (n2, n1)); Why do both of these checks print "True"? I would have thought that AssemblyName.ReferenceMatchesDefinition should consider differences in the version, culture, and public key token attributes of an assembly name, shouldn't they? If not, what does ReferenceMatchesDefinition do that a comparison of the simple names doesn't?

    Read the article

  • How to do manual DI with deep object graphs and many dependencies properly

    - by Fabian
    I believe this questions has been asked in some or the other way but i'm not getting it yet. We do a GWT project and my project leader disallowed to use GIN/Guice as an DI framework (new programmers are not going to understand it, he argued) so I try to do the DI manually. Now I have a problem with deep object graphs. The object hierarchy from the UI looks like this: AppPresenter-DashboardPresenter-GadgetPresenter-GadgetConfigPresenter The GadgetConfigPresenter way down the object hierarchy tree has a few dependencies like CustomerRepository, ProjectRepository, MandatorRepository, etc. So the GadgetPresenter which creates the GadgetConfigPresenter also has these dependencies and so on, up to the entry point of the app which creates the AppPresenter. Is this the way manual DI is supposed to work? doesn't this mean that I create all dependencies at boot time even I don't need them? would a DI framework like GIN/Guice help me here?

    Read the article

  • Any ideas for developing a Risc Processor friendly string allocator?

    - by Richard Fabian
    I'm working on some tools to enable high throughput data-oriented development, and one thing that I've not got an immediate answer for is how you go about allocating strings quickly. On risc processors you've got another problem of implementation that the CPU doesn't like branching, which is what I'm trying to minimise or avoid. Also, cache coherence is important on most CPUs, so that's gotta be influential in the design too. So, how would you go about reducing the overhead for a generic string allocator? Sometimes it's easier to solve a more explicit problem, so any ideas for string sizes of 5-30?

    Read the article

  • How to inject a "runtime" dependency like a logged in user which is not available at application boot time?

    - by Fabian
    I'm just not getting this: I use Gin in my java GWT app to do DI. The login screen is integrated into the full application window. After the user has logged in I want to inject the user object into other classes like GUI Presenters which I create, so I have some sort of runtime dependency I believe. How do i do that? One solution I can think of is sth like: class Presenter { @Inject Presenter(LoggedInUserFactory userFactory) { User user = userFactory.getLoggedInUser(); } } class LoggedInUserFactoryImpl { public static User user; User getLoggedInUser() { return user; } } So, when the user is successfully logged in and I have the object i set the static property in LoggedInUserFactory, but this will only work if the Presenter is created after the user has logged in which is not the case. Or should I use a global static registry? I just don't like the idea of having static dependencies in my classes. Any input is greatly appreciated.

    Read the article

  • Is there a concise way to create an InputSupplier for an InputStream in Google Guava?

    - by Fabian Steeg
    There are a few factory methods in Google Guava to create InputSuppliers, e.g. from a byte[]: ByteStreams.newInputStreamSupplier(bytes); Or from a File: Files.newInputStreamSupplier(file); Is there a similar way to to create an InputSupplier for a given InputStream? That is, a way that's more concise than an anonymous class: new InputSupplier<InputStream>() { public InputStream getInput() throws IOException { return inputStream; } }; Background: I'd like to use InputStreams with e.g. Files.copy(...) or ByteStreams.equal(...).

    Read the article

  • Filter Facebook Stream by Post privacy?

    - by fabian
    Hi there, i query some wall data within my facebook tab. I was wondering how to filter the data (query) to show only post which are visible to a certain country. $query = " SELECT post_id, created_time, attachment,action_links, privacy FROM stream WHERE source_id = ".$page_id." AND viewer_id = ".$user_id." AND actor_id = ".$actor_id." LIMIT 50"; The Output already show Australia: But how to filter for Australia-Only. Array ( [posts] => Array ( [0] => Array ( [post_id] => 123 [viewer_id] => 123 [source_id] => 123 [type] => 46 [app_id] => [attribution] => [actor_id] => 123 [target_id] => [message] => Only for Austria [attachment] => Array ( [description] => ) [app_data] => [action_links] => [comments] => Array ( [can_remove] => 1 [can_post] => 1 [count] => 0 [comment_list] => ) [likes] => Array ( [href] => http://www.facebook.com/social_graph.php?node_id=118229678189906&class=LikeManager [count] => 0 [sample] => [friends] => [user_likes] => 0 [can_like] => 1 ) [privacy] => Array ( [description] => Austria [value] => CUSTOM [friends] => [networks] => [allow] => [deny] => ) [updated_time] => 1271520716 [created_time] => 1271520716 [tagged_ids] => [is_hidden] => 0 [filter_key] => [permalink] => http://www.facebook.com/pages/ )

    Read the article

  • Accessing inner value of ASP.NET Web User Control

    - by Fabian
    Surprised that i havent been able to find this myself, but anyway. Let's say i use my web user control like this: <myprefix:mytag userid="4" runat="server">Some fancy text</myprefix:mytag> How would i be able to access the text inside the tags from its codebehind? Was expecting it to be exposed through this.Text, this.Value or something similar.

    Read the article

  • IE8 problems with .animate() of opacity property - descendant remains opaque throughout

    - by Fabian
    Basically I have something like this: <ul> <li> <a> <div class="trigger-layer"></div> <div class="title-layer">Text here</div> <div class="hover-layer"></div> </a> </li> </ul> I use jQuery to animate the <ul> as follow: $ul = xxx (where I assign the selector to var $ul) $ul.animate({opacity: 0}, 1000, function() {$ul.css("display", "none")}); However in IE8, as the <ul> fades off, the <div class="title-layer">Text here</div> remains clear and opaque. Finally the animation ends, the display: none; property is applied onto the <ul> and the text disappears aburptly.

    Read the article

  • Does OOP make sense for small scripts?

    - by Fabian
    I mostly write small scripts in python, about 50 - 250 lines of code. I usually don't use any objects, just straightforward procedural programming. I know OOP basics and I have used object in other programming languages before, but for small scripts I don't see how objects would improve them. But maybe that is just my limited experience with OOP. Am I missing something by not trying harder to use objects, or does OOP just not make a lot of sense for small scripts?

    Read the article

  • ASP.NET: Page HTML head rendering

    - by Fabian
    I've been trying to figure out the best way to custom render the <head> element of a pag to get rid of the extra line breaks which is caused by <head runat="server">, so its properly formatted. So far the only thing i've found which works is the following: protected override void Render(HtmlTextWriter writer) { StringWriter stringWriter = new StringWriter(); HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); base.Render(htmlTextWriter); htmlTextWriter.Close(); string html = stringWriter.ToString(); string newHTML = html.Replace("\r\n\r\n<!DOCTYPE", "<!DOCTYPE") .Replace("\r\n<html", "<html") .Replace("<title>\r\n\t", "<title>") .Replace("\r\n</title>", "</title>") .Replace("</head>", "\n</head>"); writer.Write(newHTML); } I define my had tag like Now i have 2 questions: How does the above code affect the performance (so is this viable in an production environment)? Is there a better way to do this, for example a method which i can override to just custom render the <head>? Oh yeah ASP.NET MVC is not an option.

    Read the article

  • Even lighter than SQLite

    - by Richard Fabian
    I've been looking for a C++ SQL library implementation that is simple to hook in like SQLite, but faster and smaller. My projects are in games development and there's definitely a cutoff point between needing to pass the ACID test and wanting some extreme performance. I'm willing to move away from SQL string style queries, allowing it to be code driven, but I haven't found anything out there that provides SQL like flexibility while also preferring performance over the ACID test. I don't want to go reinventing the wheel, and the idea of implementing an SQL library on my own is quite daunting, even if it's only going to be simple subset of all the calls you could make. I need the basic commands (SELECT, MODIFY, DELETE, INSERT, with JOIN, and WHERE), not data operations (like sorting, min, max, count) and don't need the database to be atomic, or even enforce consistency (I can use a real SQL service while I'm testing and debugging).

    Read the article

  • Javascript global variable not working properly?

    - by Fabian
    My jQuery code: $(document).ready(function() { chrome.extension.sendRequest({get: "height"}, function(response) { height = response.value; }); $("#id").css("height", height+"px"); }); You don't have to be concerned about the chrome.extension.sendRequest(), basically it communicates with a background page to fetch the value for "height" from localStorage and stores the value in global variable height. The problem lies in $("#id") not being assigned the height value. However if I were to modify it such that it is now: $(document).click(function() { $("#id").css("height", height+"px"); }); it works. Any idea why?

    Read the article

  • jQuery live, change in not working in IE6, IE7

    - by fabian
    The code below works as expected in FF but not in IEs... $(document).ready(function() { $('div.facet_dropdown select').live('change', function() { var changed_facet = $(this).attr('id'); var facets = $('select', $(this).closest('form')); var args = window.location.href.split('?')[0] + '?ajax=1'; var clear = false; for(var i = 0; i < facets.length; i++) { var ob = $(facets[i]); var val = ob.val(); if(clear) { val = ''; } args += '&' + ob.attr('id') + '=' + val; if(ob.attr('id') == changed_facet) { clear = true; } } $.getJSON(args, function(json) { for(widget_id in json) { var sel = '#field-' + widget_id + ' div.widget'; $(sel).html(json[widget_id]); } }); }); });

    Read the article

  • Check if NFS share is mounted in python script

    - by Fabian
    I wrote a python script that depends on a certain NFS share to be available. If the NFS share is not mounted it will happily copy the files to the local path where it should be mounted, but fail later when it tries to copy some files back that were created on the NFS server. I'd like to catch this error specifically so I can print a useful error message that will tell the users of this script what they have to do. My first idea would be to execute mount using subprocess and then check the output for this nfs share. But I'm wondering if there isn't a nicer and more robust method of doing it.

    Read the article

  • Usage patterns/use cases for DI or when to start using it

    - by Fabian
    I'm not sure for which use cases one should to use DI in the application. I know that injecting services like PlaceService or CalculationService etc fits very well but should I also create my domain objects with DI like a User? What is if the User has only one constructor which requires a first and lastname. Is this solveable with DI? Should I use DI to create the instances for Set/List interfaces or is this pure overkill? I use guice primarily.

    Read the article

  • Attribute & Reflection libraries for C++?

    - by Fabian
    Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel. Do you know any good open source libraries for C++ which support reflection and attribute containers, specifically: Defining RTTI and attributes via macros Accessing RTTI and attributes via code Automatic serialisation of attributes Listening to attribute modifications (e.g. OnValueChanged)

    Read the article

  • PHP header() redirect not working after shortening URL using bit.ly

    - by Fabian Kreiser
    Hi, I have a problem with php header redirect. I already spent hours trying to fix it. The problem doesn't occur when the bit.ly api is not used in the script, I have no clue why. <?php if (strlen($_GET['url']) > 26) { $shortenedURL = $_GET['url']; if (isset($_GET['login']) && isset($_GET['apikey'])) { $shortenedURL = file_get_contents('http://api.bit.ly/v3/shorten?format=txt&login='.urlencode($_GET['login']).'&apiKey='.$_GET['apikey'].'&uri='.urlencode($_GET['url'])); } else { $shortenedURL = file_get_contents('http://icbrd.net/shorten.php?longurl='.$_GET['url']); } if (strlen($shortenedURL) > 0) { header( 'Location: icebird://compose?status='.$shortenedURL.'%20' ); exit(); } else { header( 'Location: icebird://compose?status='.$_GET['url'].'%20' ); exit(); } } else { header( 'Location: icebird://compose?status='.$_GET['url'].'%20' ); exit(); } ?> I hope you can help me, as this is driving me crazy. Regards

    Read the article

  • Dynamic-linked DLL needs to share a global variable with its caller.

    - by Fabian Wickborn
    I have a static library libStatic that defines a global variable like this Header file libStatic/globals.h: extern int globvar; Code file libStatic/globals.cpp: int globvar = 42; The DLL libDynamic and the executable runner are using this global variable. Furtheron, libDynamic is linked at run-time into runner (via LoadLibrary(), GetProcAddress(), and the works...) I understand this will lead to globvar being created twice, once in the heap of runner and once in the heap of libDynamic, which is of course very undesirable. Is there a good away around this? How can I ensure that libDynamic and runner are using the same globvar?

    Read the article

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