Search Results

Search found 3195 results on 128 pages for 'tip and tricks'.

Page 104/128 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Execute encrypted files but don't let anybody read them.

    - by Stebi
    I want to provide a virtual machine image with an installed web application. The user should be able to boot the vm (don't login, just boot) and a webserver should start automatically. The point is I want to hide the (ruby) source code of the web application from everyone as there is no obfuscator for ruby. I thought I could use file system encryption to encrypt the directory with the sourcecode (or even a whole partition). But the webserver user must be able to read it automatically after booting. Nobody is allowed to login as the webserver user (or any other user) so no other can read the contents. My questions are now: Is this possible? Because I give away the whole vm everybody could mount its virtual discs and read them (except the encrypted one). Is it now possible to find the key the webserver user needs to decrypt the files and decrypt them manually? Or is it safe to give such a vm away? The problem is that everything needed to decrypt must be included somewhere in the vm else the webserver cannot start automatically. Maybe I'm completely wrong and you have another tip for me securing the source code.

    Read the article

  • C/C++ enum and char * array

    - by Eric M
    Ran accross the following code in an article and didn't think it was standard C/C++ syntax for the char* array. As a test, both Visual C++ (visual studio 2005) and C++ Builder Rad XE both reject the 2nd line. Without using #defines, anyone have any tricks/tips for keeping enums and a string array sort of in sync without resorting to STL ? More of a curiosity question. enum TCOLOR { RED, GREEN, BLUE }; char *TNCOLOR[] = { [RED]="Red", [GREEN]="Green", [BLUE]="Blue" }; as an aside, the article this came from is quite old and I believe this might work under GCC but have not tested.

    Read the article

  • secure user-authentication in squid: The Story

    - by Isaac
    once upon a time, there was a beautiful warm virtual-jungle in south america, and a squid server lived there. here is an perceptual image of the network: <the Internet> | | A | B Users <---------> [squid-Server] <---> [LDAP-Server] When the Users request access to the Internet, squid ask their name and passport, authenticate them by LDAP and if ldap approved them, then he granted them. Everyone was happy until some sniffers stole passport in path between users and squid [path A]. This disaster happened because squid used Basic-Authentication method. The people of jungle gathered to solve the problem. Some bunnies offered using NTLM of method. Snakes prefered Digest-Authentication while Kerberos recommended by trees. After all, many solution offered by people of jungle and all was confused! The Lion decided to end the situation. He shouted the rules for solutions: Shall the solution be secure! Shall the solution work for most of browsers and softwares (e.g. download softwares) Shall the solution be simple and do not need other huge subsystem (like Samba server) Shall not the method depend on special domain. (e.g. Active Directory) Then, a very resonable-comprehensive-clever solution offered by a monkey, making him the new king of the jungle! can you guess what was the solution? Tip: The path between squid and LDAP is protected by the lion, so the solution have not to secure it. Note: sorry for this boring and messy story! /~\/~\/~\ /\~/~\/~\/~\/~\ ((/~\/~\/~\/~\/~\)) (/~\/~\/~\/~\/~\/~\/~\) (//// ~ ~ \\\\) (\\\\( (0) (0) )////) (\\\\( __\-/__ )////) (\\\( /-\ )///) (\\\( (""""") )///) (\\\( \^^^/ )///) (\\\( )///) (\/~\/~\/~\/) ** (\/~\/~\/) *####* | | **** /| | | |\ \\ _/ | | | | \_ _________// Thanks! (,,)(,,)_(,,)(,,)--------'

    Read the article

  • Most efficient way for a lookup/search in a huge list (python)

    - by user229269
    Hey guys, -- I just parsed a big file and I created a list containing 42.000 strings/words. I want to query [against this list] to check if a given word/string belongs to it. So my question is: What is the most efficient way for such a lookup? A first approach is to sort the list [list.sort()] and then just use the if word in list: print 'word' -- which is really trivial and I am sure there is a better way to do it. My goal is to apply a fast lookup that finds whether a given string is in this list or not. If you have any ideas of another data structure, they are welcome. Yet, I want to avoid for now more sophisticated data-structures like Tries etc. I am interested in hearing ideas (or tricks) about fast lookups or any other python library methods that might do the search faster than the simple 'in'. Thanks in advance!

    Read the article

  • Php file outputting javascript for include as a JS file - need to restrict so its not opened in a browser window

    - by Ali
    Hi guys, I'm storing configuration details in a database which I need to use in javascript. I'm accessing all this using php and instead of outputting all the details into inline javascript code on the main page I've instead created a php file that outputs content type javascript and refernce it in my main page as an external javascript file. I want to set it up so that it can't be viewed in a browser window i.e : <script type="text/javascript" src="phpFileThatDoesJS.php" ></script> should work but typing www.mysite.com/phpFileThatDoesJS.php in the browser shouldn't EDIT ========== The thing is that I have to edit a script that for some oddball reason stores the username and password of a user in a javascript Object and outputs it within script tags. I have to set it up so that this is not viewable by a simple view source action. Thats why I thought of referencing it as an external javascript. Isnt there any htaccess tricks that I could use?

    Read the article

  • Correct (pretty) window redraw during the creation

    - by Coder
    Does anyone know what is a correct way to redraw window during lengthy initialization operations? Say I have HWND with NULL brush, and it does some not so quick child window initialization (Window initialization is not so quick on Vista and 7, especially on netbooks, even with threaded app). With this config window stays black for half a second on slower laptops. But if I supply window color brush, it seems that there are some sort of child controls or something that draws black squares on top of it, which also seems ugly. Even though the controls are created without WS_VISIBLE initially. Oh, the window has the WS_EX_COMPOSITED style, which should do the double buffering to avoid flicker. But it still behaves ugly. Are there any other tricks I've forgotten, missed?

    Read the article

  • Manipulating individual rows of a datagrid

    - by pfranchise
    Hey, recently I started working on a webpage that has a datagrid. I understand how to add datasources and that sort of thing, or at least I am starting to get it. But my question is about manipulating individual rows or cells. Is that only possible during the databind event handler, that is the only place I have been able to do it so far. I am sure there is a more abstract way of doing the things I want to do, but there are times where I just want to say Datagrid.add(row). I mean, if the datagrid is made up of a certain object type, can I make a new object of that type and just chuck it on the end? I am still new to this stuff, so perhaps what I want to do would defeat the purpose of this added abstraction, but figured I would ask around. Thanks for any advice, tips, or tricks people feel like sharing. Edit: for clarification I am using c#, entity framework, asp.net, and an SQL database.

    Read the article

  • How to automaticly add a page number to all internal links on the HTML page?

    - by Tomasz
    In print mode, I would like to render such a links: <a href="#targetPage">link</a> like this: <a href="#targetPage">link (page 11)</a> (suppose the target page is on 11. page in print preview). It is possible to add page number using counters to the page footer with plain CSS, but could I use this in more "the way I want it" way? The solution doesn't need to be cross-browser (FF/Chrome is enough), any CSS/Javascript tricks are allowed...

    Read the article

  • How to set a __str__ method for all ctype Structure classes?

    - by Reuben Thomas
    [Since asking this question, I've found: http://www.cs.unc.edu/~gb/blog/2007/02/11/ctypes-tricks/ which gives a good answer.] I just wrote a __str__ method for a ctype-generated Structure class 'foo' thus: def foo_to_str(self): s = [] for i in foo._fields_: s.append('{}: {}'.format(i[0], foo.\_\_getattribute__(self, i[0]))) return '\n'.join(s) foo.\_\_str__ = foo_to_str But this is a fairly natural way to produce a __str__ method for any Structure class. How can I add this method directly to the Structure class, so that all Structure classes generated by ctypes get it? (I am using the h2xml and xml2py scripts to auto-generate ctypes code, and this offers no obvious way to change the names of the classes output, so simply subclassing Structure, Union &c. and adding my __str__ method there would involve post-processing the output of xml2py.)

    Read the article

  • How to test my programming experience

    - by Oden
    Hey guys, I'm very excited about how experienced I am in programming. The first, working program that I have written, was in 2004 with C. Since this I have tried many programming languages, now got stuck with php. Currently I'm working as a web-developer, and everyones pleased with the work I do. Except me :) Thats the reason why i want to know, how high my experience and my knowledge is. Could you tell me, some tips, tricks, test, or anything, on what I can see how much I need to learn and practice to get a mastermind in programming? (at first place in php)

    Read the article

  • How to tell which thread(s) are producing all the garbage?

    - by Brad Hein
    I have an app with about 15 threads. Most do mundane tasks and sleep most of their lives. Others collect information and cache it in hashmaps. The hashmaps grow to a moderate size and level out. The number of keys and size of value remains constant, but the contents of the values changes (at 33 keys per second average). When I start my app, I notice the garbage collection interval goes from minutes to once per second, and the amount of garbage is 700k+ each time. In fact as I was writing this, it caused my phone to reboot with an error "Referencetable Overflow". Here's my question: Are there any tricks to identifying which threads are producing the garbage, or even finding out more about what garbage they are producing?

    Read the article

  • installing Delphi5 pro in windows 64b

    - by Larry
    Please dont laugh . Over the past 15 years or so I've written all the software that runs my medical practice in D5. Last week when I went to DelphiArea to update a component I got attacked and my disk became unbootable/unrecoverable. I have my original D5p disk and all the components backed up but I want to migrate to W7. I don't care if my delphi apps look like vista/7, I just want to be able to install it and code on the machine again for maintenance purposes. 1) are there any tricks to install D5 so it works in W7? 2) is using a vm program really the only/best way? if so, which is suggested. Thanks in advance. My new Gateway zx6800-03 arrives tomorrow! Larry [email protected]

    Read the article

  • XP - ping changes routing table?

    - by Corelgott
    Hey Folks, I have got a real strange behaviour with one of my XP-Sp3 machines. Setup: A Server in the lan (192.168.5.0) proviedes access to all roadwarriors in 10.8.0.0 The DCHP has a static route for all clients pronouncing 192.168.5.235 as gateway for 10.8.0.0 All Clients can ping & access the vpn-machines; everything works like a charm But one Xp-Sp3 is not willing to connect to them. It gets all the same routes as any other sytem in the lan and I trippel-checked - there are no static routes on this machine When I ping any 10.8.0.0 device from this machine, the first two packaged work like a charm; but the next two (and any package after them) fail and get lost. When I look back into the routing table: There is a new route; a special one just for the device I pinged, which points to the right gateway - but which wasn't there earlier... As Long as this route exists the machine can't ping anything on 10.8.0.0. But if I remove the route by hand: The next to ping packages work fine... Has anybody got an idea about that? Anybody every seen such a behaviour? Any hint / help / tip is greatly appreachiated! thx in advance Corelgott Ps: I attach an image of the cmd to clarify things - its in german, but reading a routing table shouldn't be that hard...

    Read the article

  • How can I totally flatten a PDF in Mac OS on the command line?

    - by Matthew Leingang
    I use Mac OS X Snow Leopard. I have a PDF with form fields, annotations, and stamps on it. I would like to freeze (or "flatten") that PDF so that the form fields can't be changed and the annotations/stamps are no longer editable. Since I actually have many of these PDFs, I want to do this automatically on the command line. Some things I've tried/considered, with their degree of success: Open in Preview and Print to File. This creates a totally flat PDF without changing the file size. The only way to automate seems to be to write a kludgy UI-based AppleScript, though, which I've been trying to avoid. Open in Acrobat Pro and use a JavaScript function to flatten. Again, not sure how to automate this on the command line. Use pdftk with the flatten option. But this only flattens form fields, not stamps and other annotations. Use cupsfilter which can create PDF from many file formats. Like pdftk this flattened only the form fields. Use cups-pdf to hook into the Mac's printserver and save a PDF file instead of print. I used the macports version. The resulting file is flat but huge. I tried this on an 8MB file; the flattened PDF was 358MB! Perhaps this can be combined with a ghostscript call as in Ubuntu Tip:Howto reduce PDF file size from command line. Any other suggestions would be appreciated.

    Read the article

  • Logging fatal/parse errors in PHP5

    - by PeterBelm
    I'm writing an error logging service that will be integrated into websites running on my server, that will email me error batches, etc. So I've been trying to find out if there's a way to handle fatal and parse errors, however not using the tricks to handle it in PHP code (output buffer, shutdown function). I'm quite happy to write some C code or something to handle it outside of my PHP code. I would also like to issue a redirect if possible (my sites use output buffering so there shouldn't be any headers sent). I'm pretty sure this could be done with a PHP module, but I've never written one and have no idea where to start.

    Read the article

  • Any strategies for assessing the trade-off between CPU loss and memory gain from compression of data

    - by indiehacker
    Are very large TextProperties a burden? Should they be compressed? Say I have a information stored in 2 attributes of type TextProperty in my datastore entities. The strings are always the same length of 65,000 characters and have lots of repeating integers, a sample appearing as follows: entity.pixel_idx = 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5....etc. entity.pixel_color = 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,...etc. So these above could also be represented using much less storage memory by compressing say using only each integer and the length of its series ( '0,8' for '0,0,0,0,0,0,0,0') but then its takes time and CPU to compress and decompress? Any general ideas? Are there some tricks for testing different attempts to the problem?

    Read the article

  • Caveats to be aware of when using threading in Python?

    - by knorv
    I'm quite new to threading in Python and have a couple of beginner questions. When starting more than say fifty threads using the Python threading module I start getting MemoryError. The threads themselves are very slim and not very memory hungry, so it seems like it is the overhead of the threading that causes the memory issues. Is there something I can do to increase the memory capacity or otherwise make Python allow for a larger number of threads? What is the maximum number of threads you've been able to run in your Python code using the threading module? Did you do any tricks to achieve that number? Are there any other caveats to be aware of when using the threading module?

    Read the article

  • JRI Fatal Error on Ubuntu

    - by Peter Jackson
    I have successfully installed JRI and rJava on Windows 7. I am now trying to get it to work on Ubuntu with 64bit OS. I can make rJava calls from within R but getting JRI to work is more difficult. I am running NetBeans 7.1.2 and I have followed various tricks in setting R_HOME and java.library.path to enable all the classes to be loaded. That is, I am past the error messages such as "jri library not found" and "R_HOME not set". From my java code,I can see that R_HOME = /usr/lib64/R. The error message I get now is Fatal error: you must specify '--save', '--no-save' or '--vanilla' This happens when Rengine is first called: Rengine r = new Rengine(args,false,null); This appears to be an error message from R; it seems to be expecting a command line argument. I haven't seen any posting with this error message. Any ideas? Thanks, Peter

    Read the article

  • Can someone rid me of these turbulent T4 template editors?

    - by Will
    I'm using Tangible's editor and (no offense guys) it sucks. Its one painful step above notepad. But its (afaik) the only game in town. Does anybody have any tips/tricks on creating T4 templates in a non-painful way? For instance, I'm thinking about creating a T4 Template that essentially turns a class defined in a solution into a template generator. DTE, look for code that is marked with this or that attribute, run this or that method, and drop the results into a file. At least I'd get legit intellisense out of the deal...

    Read the article

  • C++: Can a macro expand "abc" into 'a', 'b', 'c'?

    - by Peter Alexander
    I've written a variadic template that accepts a variable number of char parameters, i.e. template <char... Chars> struct Foo; I was just wondering if there were any macro tricks that would allow me to instantiate this with syntax similar to the following: Foo<"abc"> or Foo<SOME_MACRO("abc")> or Foo<SOME_MACRO(abc)> etc. Basically, anything that stops you from having to write the characters individually, like so Foo<'a', 'b', 'c'> This isn't a big issue for me as it's just for a toy program, but I thought I'd ask anyway.

    Read the article

  • javascript button click casuing Internet Explorer secuirty exception...

    - by hp
    Hello, I have a application that allows a user to choose some parameters for a powerpoint report, run the report, then allow the user to "save" or "open" the powerpoint file. I got all of that working OK. When you click on "run" report, it pops open a window which generates the report, stores it in session, then closes the window. I have a button on the main page that will export the report. So, now, when the pop up window that generates the report is finished, i use "window.opener" to call a javascript method on the main page, that will do a javascript click of the button. when this button is pressed, Internet Explorer gives me the following message : "To help protect your security, Internet Explorer blocked this site from downloading files to your computer.." Do you guys know of any tricks around this?

    Read the article

  • check whether fgets would block

    - by lv
    Hi, I was just wondering whether in C is it possible to peek in the input buffer or perform similar trickery to know whether a call to fgets would block at a later time. Java allows to do something like that by calling BufferedReader.ready(), this way I can implement console input something like this: while (on && in.ready()) { line = in.readLine(); /* do something with line */ if (!in.ready()) Thread.sleep(100); } this allows an external thread to gracefully shutdown the input loop by setting on to false; I'd like to perform a similar implementation in C without resorting to non portable tricks, I already know I can make a "timed out fgets" under unix by resorting to signals or (better, even though requering to take care of buffering) reimplement it on top of recv/select, but I'd prefer something that would work on windows too. TIA

    Read the article

  • Codeigniter - Is it ok to add functionality to the constructor in controllers?

    - by Irro
    I'm making a project where I want the user to search for shops in different cities and would like the url to be like this: domain/shop/city/name. So I created a controller in codeigniter called Shop. But I cant create a city function since the city part of the url changes dependent on city name. One easy way to do it would be to add a function called "search" and add the functionality there but then I get url's like: domain/shop/search/city/name which I really would like to avoid. So my question is if it's ok to add my functionality directly into the constructor to avoid that extra "search" part in the url? I'm afraid that there might be some performance tricks involved that potentially keeps the class in memory so the constructor will not be called every time.

    Read the article

  • iPhone application build fails with "dyld: Library not loaded: /System/[...]" error? Why?

    - by Andrew J. Brehm
    For my own reasons and not for the app store I am referencing the Apple private framework Apple80211 in an iPhone app. I got the framework from an earlier version of the iPhone SDK. I added the "existing framework", verified that that absolute path to the framework is /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/PrivateFrameworks/Apple80211.framework and tried to build the app. But the build (to device) fails with the error dyld: Library not loaded: /System/Library/PrivateFrameworks/Apple80211.framework/Apple80211 Referenced from: /var/mobile/Applications/3691587D-87AF-44EA-A505-F73D17F39B3B/iWire2.app/iWire2 Reason: image not found I cannot figure out why Xcode would look for the library in a /System path (instead of using the path given in the frameworks list) or how to change that behaviour. I tried the tricks I found here and elsewhere for similar (and identical) sitiations: Delete the myusername.* files in the xcodeproj bundle Delete the build directory Clean all targets Start new project Result is always the same. How can I add this (or a) framework to an iPhone project AND get Xcode to at least look at the library located where I point to rather than a location in /System?

    Read the article

  • The Wheel Invention - Beneficial For Learning?

    - by Sarfraz
    Hello, Chris Coyier of css-tricks.com has written a good article titled Regarding Wheel Invention. In a paragraph he says: On the “reinventing” side, you benefit from complete control and learning from the process. And on the very next line he says: On the other side, you benefit from speed, reliability, and familiarity. Also often at odds are time spent and cost. He is right in both statements I think. I really like his first statement. I do actually sometimes re-invent the wheel to learn more and gain complete control over what I am inventing. I wonder why people are so much against that or rather biased. Isn't there the benefit of learning and getting complete control or probably some other benefits too. I would love to see what you have to say about this.

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >