Search Results

Search found 1781 results on 72 pages for 'magic c0d3r'.

Page 22/72 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Referring to the public root in PHP - best practices

    - by Emanuil
    I've been using the $_SERVER["DOCUMENT_ROOT"] environment variable to refer to the public root in my apps. Now I'm realizing that that's not very reliable. I'm thinking about an approach where I define a constant in my index.php based on a magic constant. Something like that: define("PUBILC", __DIR__); I'm not sure about it though. What approach would you recommend?

    Read the article

  • WPF MVVM: Convention over Configuration for ResourceDictionary ?

    - by Jeffrey Knight
    Update In the wiki spirit of StackOverflow, here's an update: I spiked Joe White's IValueConverter suggestion below. It works like a charm. I've written a "quickstart" example of this that automates the mapping of ViewModels-Views using some cheap string replacement. If no View is found to represent the ViewModel, it defaults to an "Under Construction" page. I'm dubbing this approach "WPF MVVM White" since it was Joe White's idea. Here are a couple screenshots. The first image is a case of "[SomeControlName]ViewModel" has a corresponding "[SomeControlName]View", based on pure naming convention. The second is a case where the ModelView doesn't have any views to represent it. No more ResourceDictionaries with long ViewModel to View mappings. It's pure naming convention now. I'm hosting a download of the project here: http://rootsilver.com/files/Mvvm.White.Quickstart.zip I'll follow up with a longer blog post walk through. Original Post I read Josh Smith's fantastic MSDN article on WPF MVVM over the weekend. It's destined to be a cult classic. It took me a while to wrap my head around the magic of asking WPF to render the ViewModel. It's like saying "Here's a class, WPF. Go figure out which UI to use to present it." For those who missed this magic, WPF can do this by looking up the View for ModelView in the ResourceDictionary mapping and pulling out the corresponding View. (Scroll down to Figure 10 Supplying a View ). The first thing that jumps out at me immediately is that there's already a strong naming convention of: classNameView ("View" suffix) classNameViewModel ("ViewModel" suffix) My question is: Since the ResourceDictionary can be manipulated programatically, I"m wondering if anyone has managed to Regex.Replace the whole thing away, so the lookup is automatic, and any new View/ViewModels get resolved by virtue of their naming convention? [Edit] What I'm imagining is a hook/interception into ResourceDictionary. ... Also considering a method at startup that uses interop to pull out *View$ and *ViewModel$ class names to build the DataTemplate dictionary in code: //build list foreach .... String.Format("<DataTemplate DataType=\"{x:Type vm:{0} }\"><v:{1} /></DataTemplate>", ...)

    Read the article

  • Maximum Uri Length in Silverlight

    - by Kris Erickson
    Does anyone know what the Maximum URL length is in Silverlight (version 4 if it matters)? I know it is 2048 and basically infinite for Firefox (the two environments I have tested in), but Image requests fail for long Uri's. Anyone know the magic number (is it 256 the max filepath length?) It is considerably shorter than the 2048 for IE...

    Read the article

  • Technology behind twilio

    - by John Stewart
    I wanted to discuss the technology behind Twilio. I have been playing around with the service for a few days now and it is simply mind-blowing. While I don't have a direct need for it right now, I am curious to find the back-end of the technology. So can anyone shed some thoughts on how does Twilio do its magic?

    Read the article

  • Get Generated Code's File Path in Visual Studio?

    - by bluevoodoo1
    When using code generation templates in visual studio, is it possible to get the current location of the .tt file when the 'custom tool' runs? Suppose my custom template lives in c:\projects\something\template.tt When it does its magic, is there a way to return the path above? <#=PathOfCurrentTTFile #> (so that PathOfCurrentTTFile == c:\projects\something\template.tt)

    Read the article

  • Loading SQL dump before running Django tests

    - by knutin
    I have a fairly complex Django project which makes it hard/impossible to use fixtures for loading data. What I would like to do is to load a database dump from the production database server after all tables has bene created by the testrunner and before the actual tests start running. I've tried various "magic" in MyTestCase.setUp(), but with no luck. Any suggestions would be most welcome. Thanks.

    Read the article

  • Implementing a continuous "revert-buffer" aka Textpad

    - by vedang
    One of my colleagues uses TextPad, and one feature I found really useful is the Auto-Reload. (The feature has been described in this SO quesion: http://stackoverflow.com/questions/1246083/alternative-to-textpads-prompt-to-reload-file). Basically, it keeps reloading the file without any prompt from the user, which is really helpful when monitoring log files that are updated in real-time. Is there something similar available for Emacs? If not, can anyone whip up the required elisp magic?

    Read the article

  • tmpfile and gzip combination problem

    - by Vojtech R.
    I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0) f = gzip.GzipFile(mode='rb', fileobj=file) print f.read() I dont know why it doesn't print out anything. If I uncomment file.seek then error occurs: File "/usr/lib/python2.5/gzip.py", line 263, in _read self._read_gzip_header() File "/usr/lib/python2.5/gzip.py", line 162, in _read_gzip_header magic = self.fileobj.read(2) IOError: [Errno 9] Bad file descriptor Just for information this version works fine: x = open("test.gzip", 'wb') x.write(base64.b64decode(data)) x.close() f = gzip.GzipFile('test.gzip', 'rb') print f.read()

    Read the article

  • Managing Java dependencies in a Grails application?

    - by Stefan Kendall
    I'm trying to adopt my development from Spring/Maven2/Tomcat -> Grails, and I'm wondering if there's an easy way to manage dependencies in grails separate from maven. Maven does a lot of the magic that grails is doing automatically (unit testing/building/etc.), so I wonder if there's a need for maven at all in grails projects. So, then, how do Grails users generally manage java dependencies? I've become accustomed to central repository dependency management, and I can't turn back at this point.

    Read the article

  • Help getting started with MEF

    - by SteveCl
    Hi, I was reading somewhere that with MEF I can simply drop a dll into a directory and my application (with some MEF magic) will be able to read it and execute the code in it? Hopefully only classes that implement an interface that I define?? Can someone help me to get going, with some links maybe for my problem. I've looked through some of the docs, but nothing seems to be what I'm after and its tricky when I don't know exactly what to search on... Thx S

    Read the article

  • Is there a boolean literal in SQLite?

    - by Benjamin Oakes
    I know about the boolean column type, but is there a boolean literal in SQLite? In other languages, this might be true or false. Obviously, I can use 0 and 1, but I tend to avoid so-called "magic numbers" where possible. From this list, it seems like it might exist in other SQL implementations, but not SQLite. (I'm using SQLite 3.6.10, for what it's worth.)

    Read the article

  • Any good source of explanatory documentation on ColorMatrix?

    - by mackenir
    I'd like to try using ColorMatrix, but am only able to find examples that convert an image to grayscale. And even then, they tend to be presented as a chunk of 'magic numbers' code with no explanation. Does anyone know of a 'tutorial' on how to use ColorMatrix? For example I'd be interested in converting a grayscale image to a color image, where white == transparent, and black = a solid color, with gray pixels somewhere in between. Could ColorMatrix do that?

    Read the article

  • How to check if a file is a DLL?

    - by PierreBdR
    Given a file, I want to check if this is a DLL, or a shared object (Linux) or a dylib (Mac OS X), or something different. My main interest is differentiating executable and DLL on Linux and Mac OS X. For windows, the extension should be enough for my problem. I already checked that the magic number technique doesn't work for Linux as executable and shared objects both have the same number.

    Read the article

  • How do I tell which element a jquery click occurred on?

    - by Colen
    Hi, I am handling a click on a list item with jquery: $("#some_list li").click(function(event) { // magic happens here } The list items look like: <li><input type='checkbox'>Some text<span class='info'>(?)</span></li> I want to have different behaviours depending on whether the user clicks within the (?), or anywhere else in the list. How can I detect which element the user clicked on?

    Read the article

  • getting around circular references in Delphi

    - by Tom
    Is there a way of getting around circular unit references in Delphi? Maybe a newer version of delphi or some magic hack or something? My delphi project has 100 000+ lines of code mostly based on singleton classes. I need to refactor this, but that would mean several months of "circular reference" hell :)

    Read the article

  • Where does the tomcat axis file server-config.wsdd come from?

    - by David Sykes
    Part of our system provides a web service through apache tomcat, the service is referenced in the server-config.wsdd file. Unfortunately nobody can remember how it got in there. The apache set up has changed, and I need to update the system for the new configuration. What magic keywords can I google for to help me work out how and why it got into the existing server-config.wsdd, and how it might fit into the new server-config.wsdd

    Read the article

  • Good suggestions for learning OOP PHP

    - by Doug
    I've been trying to learn PHP OOP and have looked at multiple articles, but have yet to find a good resource for learning. I want to learn from the user of setters and getters, $this-, constructors, and so on...! Can anyone please suggest me something? I noticed MOST teachings leave out the explanation of $this-. I want to learn magic methods, decorators, encapsulation, etc... Feel free to suggest something that I haven't explicitly listed.

    Read the article

  • python: send a list/dict over network

    - by facha
    Hi, everyone I'm looking for an easy way of packing/unpacking data structures for sending over the network: on client just before sending: a = ((1,2),(11,22,),(111,222)) message = pack(a) and then on server: a = unpack(message) Is there a library that could do pack/unpack magic? Thanks in advance

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >