Search Results

Search found 6488 results on 260 pages for 'global thermonuclear war'.

Page 75/260 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • .htaccess stupid issue

    - by justnoone
    I have a server where I can only configure httpd using .htaccess, a cannot access global configuration. I want to rewrite almost every non-existing path to index.php, so I did something like: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?path=$1 [L,QSA] And that is ok. But another thing I want to do is to prevent access to path where I keep PHP files (I cannot store them somewhere else) which is for example /php. I would like that anything starting with /php rewrites to index.php?path=php... so I did something like: RewriteCond %{REQUEST_URI} ^/php.* RewriteRule ^(.*)$ /index.php?path=$1 [L,QSA] And that also would work ok if I had access to global configuration. In case of per-directory configuration, when I access /php it rewrites it to index.php?path=php and than puts directory name before that: /php/index.php?path=php. I read documentation and I realize that it uses internal redirects when per-directory confoguration is used. How can I avoid this behavior?

    Read the article

  • Single-Page Web Apps: Client-side datastores & server persistence

    - by fig-gnuton
    How should client-side datastores & persistence be handled in a single-page web application? Global vars vs. DI/IoC: Should datastores be assigned to global variables so any part of the application can access them? Or should they be dependency injected where required? Server persistence: Assuming a datastore's data needn't always be persisted to the server immediately, should the datastore itself handle persistence? If not, then what class should handle persistence and how should the persistence class fit into the client-side architecture overall? Is the datastore considered the model in MVC, or is it something else since it just stores raw data?

    Read the article

  • How do make dependency generation work for C? (Also..decode this sed/make statement!)

    - by Derek
    Hi all. I have a make build system that I am trying to decipher that someone else wrote. I am getting an error when I run it on a redhat system, but not when I run it on my solaris system. The versions of gmake are the same major revision (one off on minor revision). This is for building a C project, and the make system has a global Makefile.global that is inherited by each directory's local Makefile The Makefile.global has all the targets in it, starting with all: $(LIB) $(BIN) where LIB builds libs and BIN builds binaries. jumping down the targets I have $(LIB) : $(GEN_LIB) $(GEN_LIB) : $(GEN_DEPS) $(GEN_OBJS) $(AR) $(ARFLAGS) $(GEN_LIB) $(GEN_OBJS) $(GEN_DEPS) : @set -e; rm -f $@; \ $(CC) $(CDEP_FLAG) $(CFLAGS) $(INCDIRS) `basename $@ | sed 's/\.d/\.c/' | sed 's,^,$(HOME_SRC)/,'` | sed 's,\(.*\)\.o: ,$(GEN_OBJDIR)/\1.o $@ :,g' > [email protected] ; \ cat [email protected] > $@ ; \ cat [email protected] | cut -d: -f2 | grep '\.h' | sed 's,\.h,.h :,g' >> $@ ; \ rm [email protected] $(GEN_OBJS) : $(CC) $(CFLAGS) $(INCDIRS) -c $(*F).c -lmpi -o $@ I think these are all the relevant targets I need to include to answer my question. Definitions of those variables: CC = icc CDEP_FLAG = -M CFLAGS = various compiler flags ifdef type flags INCDIRS = include directory where all .h files are GEN_OBJDIR = /lib/objs HOME_SRC = . GEN_LIB = lib/$(LIB) GEN_DEPDIR=/lib/deps GEN_DEPS = $(addprefix $(GEN_DEPDIR)/,$(addsuffix .d,$(basename $(OBJS)))) I think this has everything covered you need. Basically self explanatory from the names. Now as best I can tell, this is generating in /lib/deps a .d file that has the object and source dependencies in it. In other words, for the utilities.a library, I will get a utils.o and utils.c dependency stack, all in the file utils.d There is some syntax error that is being generated in that file I think, because I get the following error: ../lib/deps/util.d:25: *** target pattern contains no '%'. Stop. gmake[2]: *** [all] Error 2 gmake[1]: *** [all] Error 2 gmake: *** [all] Error 2 I am not sure if my error is in the dependency generation, or some further down part, like the object generation target? If you need further info, let me know, I will add to post

    Read the article

  • In Node.js, how can I load my modules once and then use them throughout the app?

    - by TIMEX
    I want to create one global module file, and then have all my files require that global module file. Inside that file, I would load all the modules once and export a dictionary of loaded modules. How can I do that? I actually tried creating this file...and every time I require('global_modules'), all the modules kept reloading. It's O(n). I want the file to be something like this (but it doesn't work): //global_modules.js - only load these one time var modules = { account_controller: '/account/controller.js', account_middleware: '/account/middleware.js', products_controller: '/products/controller.js', ... } exports.modules = modules;

    Read the article

  • Calling some functions before main in C

    - by minjang
    I'd like to do some stuffs before main function. I have multiple source files. In each file, there is some work that needs to be done before main. It was no problem in C++, but problematic with C. In C++, this can be done by two ways: Exploiting a constructor of a global class/struct. Calling a function to a global variable For example, static const int __register_dummy_ = __AddRegisterMetaInfo(...); However, in C, either ways is impossible. Obviously, there is no constructor. So, the first option is inherently impossible. I thought that the second option would be possible, but not compiled in C (I tested only with Visual C++. It gives C2099.). C only allows a constant to a non-automatic variable. Is there any way to call some functions before main?

    Read the article

  • Call an anonymous function defined in a setInterval

    - by Tominator
    Hi, I've made this code: window.setInterval(function(){ var a = doStuff(); var b = a + 5; }, 60000) The actual contents of the anonymous function is of course just for this small example as it doesn't matter. What really happens is a bunch of variables get created in the scope of the function itself, because I don't need/want to pollute the global space. But as you all know, the doStuff() function won't be called until 60 seconds in the page. I would also like to call the function right now, as soon as the page is loaded, and from then on every 60 seconds too. Is it somehow possible to call the function without copy/pasting the inside code to right after the setInterval() line? As I said, I don't want to pollute the global space with useless variables that aren't needed outside the function.

    Read the article

  • How to use the variable declared in one class in another class in Obj C.

    - by srikanth rongali
    I have a NSDate *date1 in class1 implementation file(I initialized it as Global variable). I have NSDate *date2 in class 2 implementation file (initialized it as Global variable). I need to calculate the NSTimeInterval between the two dates in class 2. But I could not do it. I could not access date1 in this class. It is giving error as (date2 undeclared). Please give me help in how to call other class variables in this class. Thank you.

    Read the article

  • How to install mod_dav_svn on Centos 5.5

    - by Min2liz
    I'm trying to install mod_dav_svn on my server (Centos 5.5, Apache Apache 2.2.11, DirectAdmin 1.35.1 ), but no luck. I'm using this tutorial: http://wiki.centos.org/HowTos/Subversion#head-ae2d6fa671ad7ebd5d7835c6edbcd15dd2d73c4d So, I'm trying in console: # yum install mod_dav_svn subversion Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.bst.lt * base: centos.bst.lt * extras: centos.bst.lt * updates: centos.bst.lt Excluding Packages in global exclude list Finished Setting up Install Process No package mod_dav_svn available. Package subversion-1.4.2-4.el5_3.1.i386 already installed and latest version Nothing to do Why can't it find mod_dav_svn? Also I tried: #yum search mod_dav_svn Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.bst.lt * base: centos.bst.lt * extras: centos.bst.lt * updates: centos.bst.lt Excluding Packages in global exclude list Finished Warning: No matches found for: mod_dav_svn No Matches found Nothing...

    Read the article

  • Rails Variable across all controller actions

    - by bob
    Hello, This should be a very simple rails question. I have a variable like the following. @administration = Administration.first I want this variable to be accessible through every controller action across all my controllers so for example if I have a Product controller and inside of it I have the usual CRUD actions, I want the @administration variable as defined above to be put into all the CRUD actions. (It would not be needed in destroy or create or update). I have many controllers throughout my project and I was wondering if there is an easier way than adding it manually through all of the actions that I want it in. I tried a global variable $administration = Administration.first but I run into an issue where it is not updated when I update the actual content of the Administration.first table. Also, I would like to avoid global variables. Any help would be much appreciated. Thanks! :)

    Read the article

  • Accessing HttpApplication.Application variables from a class

    - by Young Ninja
    I set up various global parameters in Global.asax, as such: Application["PagePolicies"] = "~/Lab/Policies.aspx"; Application["PageShare"] = "/Share.aspx"; Application["FileSearchQueries"] = Server.MapPath("~/Resources/SearchQueries.xml"); ... I have no problem accessing these variables form .ascx.cs or .aspx.cs file -- ie. files that are part of the Web content. However, I can't seem to access 'Application' from basic class objects (ie. standalone .cs files). I read somewhere to use a slight variations in .cs files, as follows, but it always comes throws an exception when in use: String file = (String)System.Web.HttpContext.Current.Application["FileSearchQueries"];

    Read the article

  • Can't find .js file in my mainBundle?!

    - by Nic Hubbard
    This is driving me crazy as I cannot figure out what in the world is going on. I load up files form you main bundle all the time, xml files, html files, etc. But, now I am trying to get the contents of a javascript file but it can never find it. I am using: NSData *jsData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"global" ofType:@"js"]]; if (jsData) { NSLog(@"%@", jsData); } else { NSLog(@"Can't find file"); return; } Even checking the [[NSBundle mainBundle] pathForResource:@"global" ofType:@"js"] string returns null. My globaly.js file is in my Resources folder, the exact location where my other files are location that work totally fine using the above method. Why can't it find my js file?

    Read the article

  • Action method expected parameter named Id and nothing otherwise

    - by codingbiz
    The Error The parameters dictionary contains a null entry for parameter 'UserId' of non-nullable type 'System.Int64' for method 'System.Web.Mvc.ActionResult Predict(Int64)' in 'sportingbiz.Controllers.PredictionController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters This does not work. Throws the error mentioned above http://mysite/User/Profile/15 This works http://mysite/User/Profile/?UserID=15 The Controller Action public ActionResult Profile(long UserID) { } When I changed the parameter name to Id it works. I think it's because Id was specified in the route collection (Global.asax). Is it possible to tell MVC that UserId should map to Id without changing it in the Global.asax

    Read the article

  • Objective C: Can't find .js file in my mainBundle?!

    - by Nic Hubbard
    This is driving me crazy as I cannot figure out what in the world is going on. I load up files form you main bundle all the time, xml files, html files, etc. But, now I am trying to get the contents of a javascript file but it can never find it. I am using: NSData *jsData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"global" ofType:@"js"]]; if (jsData) { NSLog(@"%@", jsData); } else { NSLog(@"Can't find file"); return; } Even checking the [[NSBundle mainBundle] pathForResource:@"global" ofType:@"js"] string returns null. My activity.js file is in my Resources folder, the exact location where my other files are location that work totally fine using the above method. Why can't it find my js file?

    Read the article

  • How do game trainers change a address in memory thats dynamic?

    - by GameTrainersWTF
    Lets assume i am a game and i have a global int* that contains my health. A game trainers job is to modify this value to whatever in order to achieve god mode. I've looked up tutorials on game trainers to understand how they work, and the general idea is to use a memory scanner to try and find the address of a certain value. Then modify this address by injecting a dll or whatever. But i made a simple program with a global int* and its address changes every time i run the app, so i don't get how game trainers can hard code these addresses? Or is my example wrong? What am i missing?

    Read the article

  • How do game trainers change an address in memory that's dynamic?

    - by GameTrainersWTF
    Lets assume I am a game and I have a global int* that contains my health. A game trainer's job is to modify this value to whatever in order to achieve god mode. I've looked up tutorials on game trainers to understand how they work, and the general idea is to use a memory scanner to try and find the address of a certain value. Then modify this address by injecting a dll or whatever. But I made a simple program with a global int* and its address changes every time I run the app, so I don't get how game trainers can hard code these addresses? Or is my example wrong? What am I missing?

    Read the article

  • Deselecting an element in jQuery

    - by Michael Itzoe
    I have a collection of span elements. In the code I have a global variable that represents the "selected" object. Using the click event when a span is clicked I reset the object's class, reset the global variable, then set the object to the variable and change its class (to make it "highlighted"). This effectively toggles selection when clicking an object. var currentItem = null; $( ".item" ).click( function() { if( $( this ).hasClass( "selected" ) ) { $( this ).removeClass( "selected" ) currentItem = null; } else { if( $( ".item" ).hasClass( "selected" ) ){ $( ".item" ).removeClass( "selected" ) } $( this ).addClass( "selected" ); currentItem = $( this ); } } ); What I'd like to be able to do is unselect when clicking on an empty area of the page. I tried creating a click event on the body object, but that overrode the span click event so nothing was selected. I'm a complete jQuery noob and not sure where to go with this.

    Read the article

  • Formal name of Magento’s Class Override Design Pattern?

    - by Alan Storm
    Magento is a newish (past 5 years) PHP based Ecommerce system with an architecture that's similar to the Java Spring framework (or so I've been told) One of the features of the Framework is certain classes are not directly instantiated. Rather than do something like $model = new Mage_Foo_Model_Name(); you pass an identifier into a static method on a global application object $model = Mage::getModel('foo/name'); and this instantiates the class for you. One of the wins with this approach is getModel checks a global configuration system for the foo/name identifier, and instantiates the class name it finds in the configuration system. This allows you to change the behavior of a Model system wide with a single configuration change. Is there a formal, Gang of Four or otherwise, name that describes this system/design pattern? The instantiation itself looks like a classic Factory pattern, but I'm specifically interested in the whole "override a class in the system via configuration" aspect. Is there a name/concept that covers this, or is it contained within the worldview of a Factory?

    Read the article

  • Lua operations, that works in mutitheaded environment

    - by SBKarr
    My application uses Lua in multithreaded environment with global mutex. It implemented like this: Thread locks mutex, Call lua_newthread Perform some initialization on coroutine Run lua_resume on coroutine Unlocks mutex lua_lock/unlock is not implemented, GC is stopped, when lua works with coroutine. My question is, can I perform steps 2 and 3 without locking, if initialisation process does not requires any global Lua structs? Can i perform all this process without locking at all, if coroutine does not requires globals too? In what case I generally can use Lua functions without locking?

    Read the article

  • Function in xcode

    - by Joy
    I have a function which have two global variable 1.temp-a nsmutable array 2.j-a int type variable. But i cant access any global variable inside this function. I'm giving the code sample. void print( NSArray *array) { NSEnumerator *enumerator = [array objectEnumerator]; id obj; while ( nil!=(obj = [enumerator nextObject]) ) { NSString *tem=[[obj description] cString]; [temp insertObject:tem atIndex:j]; j=j+1; printf( "%s\n", [[obj description] cString]); } } Looking forward to your response. Thanks in advance..

    Read the article

  • static effect on python

    - by fatai
    how we can construct static effect on python instead of using class and global ? not like that one : global a a = [] #simple ex ; fonk ( a , b , d) x = 1 a.append ( x) EDIT: I want to create temporary memory , if I exit the function namely fonk , I want to save change as list on temporary memory . We can do that demand only put static keyword in front of data type but in python , we dont have static, so I want that effect in python . Therefore , how can I do ? As above code say "a" represents temporary memory

    Read the article

  • Is it OK to put a standard, pure C header #include directive inside a namespace?

    - by mic_e
    I've got a project with a class log in the global namespace (::log). So, naturally, after #include <cmath>, the compiler gives an error message each time I try to instantiate an object of my log class, because <cmath> pollutes the global namespace with lots of three-letter methods, one of them being the logarithm function log(). So there are three possible solutions, each having their unique ugly side-effects. Move the log class to it's own namespace and always access it with it's fully qualified name. I really want to avoid this because the logger should be as convenient as possible to use. Write a mathwrapper.cpp file which is the only file in the project that includes <cmath>, and makes all the required <cmath> functions available through wrappers in a namespace math. I don't want to use this approach because I have to write a wrapper for every single required math function, and it would add additional call penalty (cancelled out partially by the -flto compiler flag) The solution I'm currently considering: Replace #include <cmath> by namespace math { #include "math.h" } and then calculating the logarithm function via math::log(). I have tried it out and it does, indeed, compile, link and run as expected. It does, however, have multiple downsides: It's (obviously) impossible to use <cmath>, because the <cmath> code accesses the functions by their fully qualified names, and it's deprecated to use in C++. I've got a really, really bad feeling about it, like I'm gonna get attacked and eaten alive by raptors. So my question is: Is there any recommendation/convention/etc that forbid putting include directives in namespaces? Could anything go wrong with diferent C standard library implementations (I use glibc), different compilers (I use g++ 4.7, -std=c++11), linking? Have you ever tried doing this? Are there any alternate ways to banish the math functions from the global namespace? I've found several similar questions on stackoverflow, but most were about including other C++ headers, which obviously is a bad idea, and those that weren't made contradictory statements about linking behaviour for C libraries. Also, would it be beneficial to additionally put the #include <math.h> inside extern "C" {}?

    Read the article

  • passing a float as a pointer to a matrix

    - by numerical25
    Honestly, I couldnt think of a better title for this issue because I am having 2 problems and I don't know the cause. The first problem I have is this //global declaration float g_posX = 0.0f; ............. //if keydown happens g_posX += 0.03f; &m_mtxView._41 = g_posX; I get this error cannot convert from 'float' to 'float *' So I assume that the matrix only accepts pointers. So i change the varible to this.... //global declaration float *g_posX = 0.0f; ............. //if keydown happens g_posX += 0.03f; &m_mtxView._41 = &g_posX; and I get this error cannot convert from 'float' to 'float *' which is pretty much saying that I can not declare g_posX as a pointer. honestly, I don't know what to do.

    Read the article

  • Initializing a array after declaration

    - by robUK
    Hello, gcc 4.4.3 c89 I have the following code as a sample of what I am trying to do. I don't know the actual size of the array, until I enter the function. However, I don't think I can set the array size after I have declared it. I need it global as some other functions will need to access the device names. Many thanks for any suggestions, /* global */ char *devices_names[]; void fill_devices(size_t num_devices) { devices_names[num_devices]; /* start filling */ }

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >