Search Results

Search found 19441 results on 778 pages for 'static libraries'.

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

  • Static source code analysis with LLVM

    - by Phong
    I recently discover the LLVM (low level virtual machine) project, and from what I have heard It can be used to performed static analysis on a source code. I would like to know if it is possible to extract the different function call through function pointer (find the caller function and the callee function) in a program. I could find the kind of information in the website so it would be really helpful if you could tell me if such an library already exist in LLVM or can you point me to the good direction on how to build it myself (existing source code, reference, tutorial, example...). EDIT: With my analysis I actually want to extract caller/callee function call. In the case of a function pointer, I would like to return a set of possible callee. both caller and callee must be define in the source code (this does not include third party function in a library).

    Read the article

  • Separation of static and dynamic content in Java EE applications

    - by Dan
    We work with IBM products and we typically use IBM Http Servers (read Apache) as a reverse proxy for our application servers. For performance reasons we serve static content (.gif, .jpg, .css, .html etc.) from our http servers, to ease the burden a bit from the application server. So far, we have to distribute files to http server and configure it manually (writing custom scripts at best.) The problem is the effort needed to keep everything in synch, especially when you need to update the app. Does any Java EE product support this “out of the box”? Is there a way to have application server do this automatically, like in cluster configuration for example, where master node is in charge of distributing the application to other nodes and for keeping everything in synch.

    Read the article

  • Was delegates static by default?

    - by Sri Kumar
    Hello All, I was just trying to understand delegates using the following code. public class delegatesEx { public delegate int Mydelegate(int first, int second); public int add(int first, int second) { return first + second; } public int sub(int first, int second) { return first - second; } } Here is my main method Console.WriteLine("******** Delegates ************"); delegatesEx.Mydelegate myAddDelegates = new delegatesEx.Mydelegate(new delegatesEx().add); int addRes = myAddDelegates(3, 2); Console.WriteLine("Add :" + addRes); delegatesEx.Mydelegate mySubDelegates = new delegatesEx.Mydelegate(new delegatesEx().sub); int subRes = mySubDelegates(3, 2); Console.WriteLine("Sub :" + subRes); I didn't declare delegate to be static but i was able to access it using the Class name. How is it possible?

    Read the article

  • Public static variables and Android activity life cycle management

    - by jsstp24n5
    According to the documentation the Android OS can kill the activity at the rear of the backstack. So, say for example I have an app and open the Main Activity (let's call it Activity A). In this public activity class I declare and initialize a public static variable (let's call it "foo"). In Activity A's onCreate() method I then change the value of "foo." From Activity A the user starts another activity within my app called Activity B. Variable "foo" is used in Activity B. Activity B is then paused after the user navigates to some other activities in other apps. Eventually, after a memory shortage occurs, Activity A then Activity B can be killed. After the user navigates back to my app it restarts (actually "recreates") activity B. What happens: 1) Will variable "foo" at this point have the value that was set to it when Activity A's onCreate() method ran? 2) Variable "foo" does not exist? 3) Variable "foo" exists and but is now the initialized value and not the value set in Activity A's onCreate() method?

    Read the article

  • Serve static symbolic links with nginx

    - by mirceapasoi
    I'm using nginx to serve some static files that are actually symbolic links. When I do this the Last-Modified headers sent by nginx use the timestamp of the target file, not of the link itself. So, if I now have link C pointing to A, and I change it to point it to B (A and B have the same timestamp) I still see the content of A in the browser. I don't know if it's from the browser cache (because it has the same Last-Modified header) or from nginx. Any idea on how to fix this?

    Read the article

  • C++, create an instance from a static method

    - by Manux
    Hello, let's say I want my users to use only one class, say SpecialData. Now, this data class would have many methods, and depending on the type of data, the methods do different things, internally, but return externally similar results. Therefore my wanting to have one "public" class and other "private", child classes that would change the behavior of methods, etc... It would be amazingly more simple for some types of data that need to be built to do something like this: SpecialData& sm = SpecialData::new_supermatrix(); and new_supermatrix() would return a SuperMatrix instance, which inherits from most behaviors of SpecialData. my header: static SpecialData& new_supermatrix(); my cpp: SpecialData& SpecialData::new_supermatrix()(){ return SuperMatrix(MATRIX_DEFAULT_MAGNITUDE,1000,1239,FLOAT32,etc...); } The problem is, I get this error, which is probably logical due to the circumstances: invalid initialization of non-const reference of type ‘SpecialData&’ from a temporary of type ‘SpecialData’ So, any ideas?

    Read the article

  • static images aren't caching with php-generated page

    - by scootklein
    Our website was just converted to being generated by mod_rewrite and php scripts. Images aren't caching in browsers when they seemingly should be. All images follow format: <img src="/images/header.png" /> I must avoid the script completely caching because the PHP parser needs to handle each page dynamically on each request; however, the download overhead of the large images is cumbersome on every single page load. I would ideally provide headers for "Cache-Control: no-cache, must-revalidate" and "Expires: some_date_in_the_past" to force revalidation of the PHP script. Why isn't the browser caching static images with consistent href values across all pages?

    Read the article

  • Static constructor can run after the non-static constructor. Is this a compiler bug?

    - by Joe H
    The output from the following program is: Non-Static Static Non-Static Is this a compiler bug? I expected: Static Non-Static Non-Static because I thought the static constructor was ALWAYS called before the non-static constructor. I tested this with Visual Studio 2010 using both .net 3.5 and .net 4.0. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace StaticConstructorBug { class Program { static void Main(string[] args) { var mc = new MyClass(); Console.ReadKey(); } } public class MyClass { public MyClass() { Console.WriteLine("Non-static"); } static MyClass() { Console.WriteLine("Static"); } public static MyClass aVar = new MyClass(); } }

    Read the article

  • Static methods requiring var

    - by Charlie Pigarelli
    Ok, i'm stuck on this, why don't i get what i need? class config { private $config; # Load configurations public function __construct() { loadConfig('site'); // load a file with $cf in it loadConfig('database'); // load another file with $cf in it $this->config = $cf; // $cf is an array unset($cf); } # Get a configuration public static function get($tag, $name) { return $this->config[$tag][$name]; } } I'm getting this: Fatal error: Using $this when not in object context in [this file] on line 22 [return $this->config[$tag][$name];] And i need to call the method in this way: config::get()...

    Read the article

  • Does a simple delphi form app needs any libraries or dependencies to deploy?

    - by peterg
    I need to code a simple form application and I want to make it easy to deploy (without installing libraries or dependencies), I don't want to use visual studio cpp or csharp because clr apps compile with .net frameworks and I have no much experience with mfc and dialogs. So I was wondering which libraries does a simple delphi vcl forms app (those using TForm) use, because I've never had to install anything to run simple delphi apps.

    Read the article

  • Simulating aspects of static-typing in a duck-typed language

    - by Mike
    In my current job I'm building a suite of Perl scripts that depend heavily on objects. (using Perl's bless() on a Hash to get as close to OO as possible) Now, for lack of a better way of putting this, most programmers at my company aren't very smart. Worse, they don't like reading documentation and seem to have a problem understanding other people's code. Cowboy coding is the game here. Whenever they encounter a problem and try to fix it, they come up with a horrendous solution that actually solves nothing and usually makes it worse. This results in me, frankly, not trusting them with code written in duck typed language. As an example, I see too many problems with them not getting an explicit error for misusing objects. For instance, if type A has member foo, and they do something like, instance->goo, they aren't going to see the problem immediately. It will return a null/undefined value, and they will probably waste an hour finding the cause. Then end up changing something else because they didn't properly identify the original problem. So I'm brainstorming for a way to keep my scripting language (its rapid development is an advantage) but give an explicit error message when an an object isn't used properly. I realize that since there isn't a compile stage or static typing, the error will have to be at run time. I'm fine with this, so long as the user gets a very explicit notice saying "this object doesn't have X" As part of my solution, I don't want it to be required that they check if a method/variable exists before trying to use it. Even though my work is in Perl, I think this can be language agnostic.

    Read the article

  • Assigning static final int in a JUnit (4.8.1) test suite

    - by Dr. Monkey
    I have a JUnit test class in which I have several static final ints that can be redefined at the top of the tester code to allow some variation in the test values. I have logic in my @BeforeClass method to ensure that the developer has entered values that won't break my tests. I would like to improve variation further by allowing these ints to be set to (sensible) random values in the @BeforeClass method if the developer sets a boolean useRandomValues = true;. I could simply remove the final keyword to allow the random values to overwrite the initialisation values, but I have final there to ensure that these values are not inadvertently changed, as some tests rely on the consistency of these values. Can I use a constructor in a JUnit test class? Eclipse starts putting red underlines everywhere if I try to make my @BeforeClass into a constructor for the test class, and making a separate constructor doesn't seem to allow assignment to these variables (even if I leave them unassigned at their declaration); Is there another way to ensure that any attempt to change these variables after the @BeforeClass method will result in a compile-time error? Can I make something final after it has been initialised?

    Read the article

  • Getting the name of a child class in the parent class (static context)

    - by Benoit Myard
    Hi everybody, I'm building an ORM library with reuse and simplicity in mind; everything goes fine except that I got stuck by a stupid inheritance limitation. Please consider the code below: class BaseModel { /* * Return an instance of a Model from the database. */ static public function get (/* varargs */) { // 1. Notice we want an instance of User $class = get_class(parent); // value: bool(false) $class = get_class(self); // value: bool(false) $class = get_class(); // value: string(9) "BaseModel" $class = __CLASS__; // value: string(9) "BaseModel" // 2. Query the database with id $row = get_row_from_db_as_array(func_get_args()); // 3. Return the filled instance $obj = new $class(); $obj->data = $row; return $obj; } } class User extends BaseModel { protected $table = 'users'; protected $fields = array('id', 'name'); protected $primary_keys = array('id'); } class Section extends BaseModel { // [...] } $my_user = User::get(3); $my_user->name = 'Jean'; $other_user = User::get(24); $other_user->name = 'Paul'; $my_user->save(); $other_user->save(); $my_section = Section::get('apropos'); $my_section->delete(); Obviously, this is not the behavior I was expecting (although the actual behavior also makes sense).. So my question is if you guys know of a mean to get, in the parent class, the name of child class.

    Read the article

  • NPE annotation scenarios and static-analysis tools for Java

    - by alex2k8
    Here is a number of code snippets that can throw NullPointerException. 01: public void m1(@Nullable String text) { System.out.print(text.toLowerCase()); // <-- expect to be reported. } 02: private boolean _closed = false; public void m1(@Nullable String text) { if(_closed) return; System.out.print(text.toLowerCase()); // <-- expect to be reported. } 03: public void m1(@NotNull String text) { System.out.print(text.toLowerCase()); } public @Nullable String getText() { return "Some text"; } public void m2() { m1(getText()); // <-- expect to be reported. } Different people have access to different static-analysis tools. It would be nice to collect information, what tools are able to detect and report the issues, and what are failing. Also, if you have your own scenarious, please, publish them. Here my results FindBugs (1.3.9): 01: Parameter must be nonnull but is marked as nullable 02: NOT reported 03: NOT reported IntelliJ IDE 9.0.2 (Community edition): 01: Method invocation text.toLowerCase() may produce java.lang.NullPointerException 02: Method invocation text.toLowerCase() may produce java.lang.NullPointerException 03: Argument getText() might be null

    Read the article

  • How can I get a static URL to a map image using the Google Static Maps API?

    - by Argote
    === BACKGROUND === Hello, so I've published a Web-App (still in "Beta") which uses the Flickr API to get information for the photos of a particular Flickr user and generates IPB code to post any of his/her images. While Flickr now gives you the IPB code to show the image and link back to the photo site directly on its site, my App also has the option of embeding the title, description, select EXIF data, location information, etc. into the post for the IPB forum. === PROBLEM === I've most recently added the option to integrate a Google Maps image of the photo's geolocation data into the post by using the Google Static Maps API. The problem is that the image URL I have is in the following form (including IPB [IMG] tags): [IMG]http://maps.google.com/maps/api/staticmap?zoom=16&size=600x600&maptype=hybrid&markers=19.387687,-99.251732&sensor=false[/IMG] Which shows this example image (In practice the image size is user selectable): However, some IPB forums seem to not support dyamic image URLs which gives me a broken image, I'd like to replace the [IMG]http://maps.google.com/maps/api/staticmap?zoom=16&size=600x600&maptype=hybrid&markers=19.387687,-99.251732&sensor=false[/IMG] with something like [IMG]http://maps.google.com/maps/api/staticmap/map0000001.png[/IMG] which should be supported by all IPB forums. Thanks in advance for your help. In case you're interested, the most recent "released" version of my Web-App can be found here: http://flickr.argote.mx/ (The changes I mention here are still on local development server).

    Read the article

  • Django choking oddly on some static media

    - by Edan Maor
    My situation: I'm serving static media via Django on my dev machine. On some files that I try and load, I get back this error: Traceback: File "c:\Program Files\Python26\Lib\site-packages\django\core\handlers\base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\views.py" in userpage 71. so_user = site.user(userid) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\stackexchange.py" in user 476. u, = self.users((nid,), **kw) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\stackexchange.py" in users 481. return self._get(User, ids, 'users', kw) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\stackexchange.py" in _get 471. return self.build(root, typ, coll, kw) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\stackexchange.py" in build 448. json = self._request(url, kw) File "E:\Stack2Blog\src.hg\stack2blog\..\stack2blog\stack2blogapp\stackexchange.py" in _request 422. dump = json.load(data) File "c:\Program Files\Python26\lib\json\__init__.py" in load 264. return loads(fp.read(), Exception Type: AttributeError at /userpage/362498 Exception Value: 'str' object has no attribute 'read' I've traced it to specific files which don't work (by going to their specific urls). Here's the odd part: changing the filename of the files makes them suddenly work. For example, I had a file called 'post.jpg', which gave this error. I renamed it to 'pos.jpg' and it worked. Back to 'post.jpg' and it gives the same error.

    Read the article

  • Care to be taken when serving static content (JS, CSS, Media) from different domain?

    - by Aahan Krish
    Let me try to explain by example. Say website is hosted at example.com (NOT www.example.com). In order to serve static content cookie-free, I've chosen to use a different domain example-static.com. Now, lets consider that my static content is currently served like this: http://example.com/js/script.js http://example.com/css/style.css http://example.com/media/image.jpg ** Now I create a CNAME record aliasing example-static.com to my main domain i.e. example.com so that the static content is served as such: http://example-static.com/js/script.js http://example-static.com/css/style.css http://example-static.com/media/image.jpg ** Is that all I have to do? Will all browsers execute JavaScript files and load web fonts without any security concerns? OR should I be using some .htaccess rules to modify header information and the like? PS: It would be great if you can provide what rules should be added, if need be.

    Read the article

  • Lightweight HTTP application/server for static content

    - by PartlyCloudy
    Hi, I am in need of a scalable and performant HTTP application/server that will be used for static file serving/uploading. So I only need support for GET and PUT operations. However, there are a few extra features that I need: Custom authentication: I need to check credentials against a database for each request. Thus I must be able to integrate propietary database interaction. Support for signed access keys: The access to resources via PUT should be signed using a key like http://uri/?key=foo The key then contains information about the request like md5(user + path + secret) which allows me to block unwanted requests. The application/server should allow me to check for this. Performance: I'd like to avoid piping content as much as possible. Otherwise the whole application could be implemented in Perl/etc. in a few lines as CGI. Perlbal (in webserver mode) looks nice, however the single-threaded model does not fit with my database lookup and it does also not support query strings. Lighttp/Nginx/… have some modules for these tasks, however it is not feasible putting everything together without ending up writing own extensions/modules. So how would you solve this? Are there other leightweight webservers available for this? Should I implement an application inside of a webserver (i.e. CGI). How can I avoid/speed up piping content between the webserver and my application. Thanks in advance!

    Read the article

  • C++ private inheritance and static members/types

    - by WearyMonkey
    I am trying to stop a class from being able to convert its 'this' pointer into a pointer of one of its interfaces. I do this by using private inheritance via a middle proxy class. The problem is that I find private inheritance makes all public static members and types of the base class inaccessible to all classes under the inheriting class in the hierarchy. class Base { public: enum Enum { value }; }; class Middle : private Base { }; class Child : public Middle { public: void Method() { Base::Enum e = Base::value; // doesn't compile BAD! Base* base = this; // doesn't compile GOOD! } }; I've tried this in both VS2008 (the required version) and VS2010, neither work. Can anyone think of a workaround? Or a different approach to stopping the conversion? Also I am curios of the behavior, is it just a side effect of the compiler implementation, or is it by design? If by design, then why? I always thought of private inheritance to mean that nobody knows Middle inherits from Base. However, the exhibited behavior implies private inheritance means a lot more than that, in-fact Child has less access to Base than any namespace not in the class hierarchy!

    Read the article

  • How to use external static files with Django (serving external files once again)?

    - by Tomas Novotny
    Hi, even after Googling and reading all relevant posts at StackOverflow, I still can't get static files working in my Django application. Here is how my files look: settings.py MEDIA_ROOT = os.path.join(SITE_ROOT, 'static') MEDIA_URL = '/static/' urs.py from DjangoBandCreatorSite.settings import DEBUG if DEBUG: urlpatterns += patterns('', ( r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'static'} )) template: <script type="text/javascript" src="/static/jquery.js"></script> <script type="text/javascript"> I am trying to use jquery.js stored in directory "static". I am using: Windows XP Python 2.6.4 Django 1.2.3 Thank you very much for any help

    Read the article

  • Delphi static method of a class returning property value

    - by mitko.berbatov
    I'm making a Delphi VCL application. There is a class TStudent where I have two static functions: one which returns last name from an array of TStudent and another one which returns the first name of the student. Their code is something like: class function TStudent.FirstNameOf(aLastName: string): string; var i : integer; begin for i := 0 to Length(studentsArray) - 1 do begin if studentsArray[i].LastName = aLastName then begin result := studentsArray[i].FirstName; Exit; end; end; result := 'no match was found'; end; class function TStudent.LastNameOf(aFirstName: string): string; var i : integer; begin for i := 0 to Length(studentsArray) - 1 do begin if studentsArray[i].FirstName = aFirstName then begin result := studentsArray[i].LastName; Exit; end; end; result := 'no match was found'; end; My question is how can I avoid writing almost same code twice. Is there any way to pass the property as parameter of the functions.

    Read the article

  • Making LISPs manageable

    - by Andrea
    I am trying to learn Clojure, which seems a good candidate for a successful LISP. I have no problem with the concepts, but now I would like to start actually doing something. Here it comes my problem. As I mainly do web stuff, I have been looking into existing frameworks, database libraries, templating libraries and so on. Often these libraries are heavily based on macros. Now, I like very much the possibility of writing macros to get a simpler syntax than it would be possible otherwise. But it definitely adds another layer of complexity. Let me take an example of a migration in Lobos from a blog post: (defmigration add-posts-table (up [] (create clogdb (table :posts (integer :id :primary-key ) (varchar :title 250) (text :content ) (boolean :status (default false)) (timestamp :created (default (now))) (timestamp :published ) (integer :author [:refer :authors :id] :not-null)))) (down [] (drop (table :posts )))) It is very readable indeed. But it is hard to recognize what the structure is. What does the function timestamp return? Or is it a macro? Having all this freedom of writing my own syntax means that I have to learn other people's syntax for every library I want to use. How can I learn to use these components effectively? Am I supposed to learn each small DSL as a black box?

    Read the article

  • Which format does static library (*.lib) files use? Where can I find "Official" specifications of *.

    - by claws
    Just now I found that static libraries in *nix systems, in other words *.a libraries are nothing but archives of relocatables(*.o files) in ar fromat. What about static libraries(*.lib files) in windows? Which format are they in? I found an article: http://www.microsoft.com/msj/0498/hood0498.aspx which explains *.lib file structure. But Where can I find "Official" specifications of *.lib file structure/format? Other than ar.exe of mingw is there any tool from Microsoft which extracts relocatable objects of *.lib & *.a files? EDIT: I wonder why I'm unable to get to this question. If there are no official specifications. Then how does the compiler ('linker' to be more correct) writers work with *.LIB files?

    Read the article

  • How can I create an Assembly program WITHOUT using libraries?

    - by Newbie
    Hello. I've literally only just started looking to learn Assembly language. I'm using the NASM assembler on Windows Vista. Usually, when I begin to learn a new language, I'll copy someone else's Hello World code and try to understand it line-by-line. However, I'm finding it suprisingy difficult to find a Hello World program that doesn't reference other libraries! You see, there's no point trying to understand each line of the code if it is closely linked with a whole library of additional code! One of the reasons I want to learn Assembly is so that I can have near complete control over the programs I write. I don't want to be depending on any libraries. And so my question is this: Can anyone give me NASM-compatible Assembly code to a completely stand-alone Hello World program that can output to the Windows Vista console? Alternatively, I appreciate that a library may be required to tell the pogram WHERE to print the output (ie. the Windows console). Other than that, I can't see why any libraries should be required. Am I overlooking anything?

    Read the article

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