Search Results

Search found 5586 results on 224 pages for 'global illumination'.

Page 139/224 | < Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >

  • javascript "this" points to Window object again

    - by terrani
    Hello, I asked a question on http://stackoverflow.com/questions/2719643/javascript-this-points-to-window-object regarding "this" points to Window object. here is source code var archive = function(){} archive.prototype.action = { test: function(callback){ callback(); }, test2: function(){ console.log(this); } } var oArchive = new archive(); oArchive.action.test(oArchive.action.test2); Tim Down wrote "but that function is then called using callback(), which means it is not called as a method and hence this is the global object". What are differences between calling a function by its actual name and callback() as shown on the source code? How does console.log(this) in test2 points to Window when it is inside archive.action???

    Read the article

  • how to config grails1.2 with oscache?

    - by wavelet
    I do this : DataSource.groovy: hibernate { cache.use_second_level_cache=true cache.use_query_cache=true cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider' } and in BuildConfig.groovy: inherits( "global" ) { // uncomment to disable ehcache excludes 'ehcache' } runtime ("opensymphony:oscache:2.4.1") { excludes 'jms', 'commons-logging', 'servlet-api' } but i only get this error : commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeAdapter] was not found when attempting to load Grails application. Skipping. commons.DefaultGrailsApplication The class [com.ai.scenter.service.reschange.ResourceChangeService] was not found when attempting to load Grails application. Skipping. hibernate.ConfigurableLocalSessionFactoryBean There was an error configuring the Hibernate second level cache: could not instantiate CacheProvider [com.opensymphony.oscache.hibernate.OSCacheProvide] hibernate.ConfigurableLocalSessionFactoryBean This is normally due to one of two reasons. Either you have incorrectly specified the cache provider class name in [DataSource.groovy] or you do not have the cache provider on your classpath (eg. runtime ("net.sf.ehcache:ehcache:1.6.1")) how can i do it?

    Read the article

  • Moving Git Projects between computers

    - by 01
    I have a project that i use at two places(i dont use git server). When i copy the project at second place i have to check-in all the files(but they have not changed), git shows me for example @@ -1,8 +1,8 @@ -#Sat Mar 06 19:39:27 CET 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 +#Sat Mar 06 19:39:27 CET 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 i did at both places the command git config --global core.autocrlf false but it doesnt help with this problem

    Read the article

  • Specifying different page base classes for different directories in your web.config file

    - by gbinflames
    I have a website (coded in vb.net) with an "admin" section (the admin section being a folder in the actual site)... So in every page of the site I'm using my own custom class as the page base (which has been set in the web.config file) but I want to inherit from different class for the files in the "admin" folder... Is there any way to inherit different classes for pages in different folders using the web.config or some other equally as global method? (meaning some other way than inheriting on a per page basis.)

    Read the article

  • Is it possible to have an out-of-process COM server where a separate O/S process is used for each ob

    - by Tom Williams
    I have a legacy C++ "solution engine" that I have already wrapped as an in-process COM object for use by client applications that only require a single "solution engine". However I now have a client application that requires multiple "solution engines". Unfortunately the underlying legacy code has enough global data, singletons and threading horrors that given available resources it isn't possible to have multiple instances of it in-process simultaneously. What I am hoping is that some kind soul can tell me of some COM magic where with the flip of a couple of registry settings it is possible to have a separate out-of-process COM server (separate operating system process) for each instance of the COM object requested. Am I in luck?

    Read the article

  • Display Computer Info on C# Web Application

    - by Gene
    I want to build a page for end users to visit (in our MPLS Network) and it show the following information in regards to them: Computer Name OS Disk Space Memory IP Address Active Directory User Name Password Expiration Time (As defined by Global Policy) Maybe a few other things such as Trend Micro Office current version vs. their version, # of MS Updates needed (we utilize WSUS), and a few other things in the future. My question is how would I pull this information from the user when they visit the page? What is the proper function for this? Anyone have examples they wish to share for me to learn by if possible? Thanks so much in advance, Gene

    Read the article

  • Using static variable in function vs passing variable from caller

    - by Patrick
    I have a function which spawns various types of threads, one of the thread types needs to be spawned every x seconds. I currently have it like this: bool isTime( Time t ) { return t >= now(); } void spawner() { while( 1 ) { Time t = now(); if( isTime( t ) )//is time is called in more than one place in the real function { launchthread() t = now() + offset; } } } but I'm thinking of changing it to: bool isTime() { static Time t = now(); if( t >= now() ) { t = now() + offset; return true; } return false; } void spawner() { if( isTime() ) launchthread(); } I think the second way is neater but I generally avoid statics in much the same way I avoid global data; anyone have any thoughts on the different styles?

    Read the article

  • Code understanding, reverse engineering, best concepts and tools. Java.

    - by core07
    One of most demanding tasks for any programmer, architect is understanding other's code. E.g. I am contractor, hired to rescue some project very quickly. Fix bugs, plan global refactoring and therefore I need most efficient way to understand the code. What is the list of concepts, their priority and best tools for this? Of what I know: reverse code engineering to create object models (creating of diagram per package is not so convenient), create sequence diagrams (the tool connects in debug mode to the system and generates diagrams from runtime). Some visualizing techniques, using some tools to work not just with .java but also with e.g. JPA implementors like Hibernate. Generate diagram for not all the codebase, but add some class and then classes used by it. Is Sparx Enterprise Architect state of the art in reverse engineering or far from that. Any other better tools? Ideally would be that tool makes me understand the code as if I wrote it myself :)

    Read the article

  • mod_rewrite in conjunction with "options indexes"

    - by Travis
    I have a directory ("files") where sub-directories and files are going to be created and stored over time. The directories also need to deliver a directory listing, using "options indexes", but only if a user is authenticated, and authorized. I have that part built, and working, by doing the following: <Directory /var/www/html/files> Options Indexes IndexOptions FancyIndexing SuppressHTMLPreamble HeaderName /includes/autoindex/auth.php </Directory> Now I need to take care of file delivery. To force authentication for files, I have built the following: RewriteCond %{REQUEST_URI} -f RewriteRule /files/(.*) /auth.php I also tried: RewriteCond %{REQUEST_URI} !-d RewriteRule /files/(.*) /auth.php Both directives are redirecting to auth.php when I request: foo.com/files/bar/ foo.com/files/bar/baz I am outputting the SERVER global on auth.php during testing and it is showing the requests as I made them (I thought Apache may have been doing something behind the scenes by adding something like "index.html" to the end with "Options Indexes" being on). Ideas?

    Read the article

  • Wordpress Trackbacks Not Being Applied

    - by Dustin Digmann
    I am using Wordpress 2.9.1. I recently noticed the trackbacks are not being sent - internal or external. I see two issues I would like to solve. 1) My site has a default, global ping hub which it should notify. This value is not being set into the 'to_ping' value in the *_post table. 2) When I manually enter a trackback in the post, I notice the 'to_ping' value is properly set. It never sends the ping though. The 'pinged' value is always empty. With older versions of WP, this seemed to work automatically.

    Read the article

  • Unix: millionth number in the serie 2 3 4 6 9 13 19 28 42 63 ... ?

    - by HH
    It takes about minute to achieve 3000 in my comp but I need to know the millionth number in the serie. The definition is recursive so I cannot see any shortcuts except to calculate everything before the millionth number. How can you fast calculate millionth number in the serie? Serie Def n_{i+1} = \floor{ 3/2 * n_{i} } and n_{0}=2. Interestingly, only one site list the serie according to Goolge: this one. Too slow Bash code #!/bin/bash function serie { n=$( echo "3/2*$n" | bc -l | tr '\n' ' ' | sed -e 's@\\@@g' -e 's@ @@g' ); # bc gives \ at very large numbers, sed-tr for it n=$( echo $n/1 | bc ) #DUMMY FLOOR func } n=2 nth=1 while [ true ]; #$nth -lt 500 ]; do serie $n # n gets new value in the function throught global value echo $nth $n nth=$( echo $nth + 1 | bc ) #n++ done

    Read the article

  • jQuery internals: Organization of the jQuery Object

    - by sonofdelphi
    I was going through the source code of jQuery. I'm having trouble understanding the wrapping strategy for the jQuery object. (function( window, undefined ) { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); }, .... .... .... // Expose jQuery to the global object window.jQuery = window.$ = jQuery; })(window); Specifically, what I'm not able to understand stems from the first line. What is the outermost unnamed container function? Why is it required? Why is the container function anonymous? What is the need for the outermost '(' parantheses ?

    Read the article

  • How do I create a random method name

    - by Russ Bradberry
    I plan on using JSONP to call an external webservice to get around the fact that I dont want to create a global function that could potentially conflict with the calling page. I thought that creating a random function name and passing it up would work. Something like this: <script src="www.foo.com/b?cb=d357534"> where cb is the callback function name, the server would return d357534({my json data}); what i want to know is how to create the random function name, im sure i could use eval but is this the best way to go about it? essentially, what i am trying to do is this: var d + Math.floor(Math.random()*1000001) = function(){...

    Read the article

  • where should I put the EF entity and data annotations in asp.net mvc + entity framework project

    - by giddy
    So I have a DataEntity class generated by EntityFramework4 for my sqlexpress08 database. This data context is exposed via a WCF Data Service/Odata to silverlight and win forms clients. Should the data entities + edmx file (generated by EF4) go in a separate class library? The problem here then is I would specify data annotations for a few entities and then some of them would require specific MVC attributes (like CompareAttribute) so the class library would also reference mvc dlls. There also happen to be entity users which will be encapsulated or wrapped into an IIdentity in the website. So its pretty tied to the mvc website. Or Should it maybe go in a Base folder in the mvc project itself? Mostly the website is data driven around the database, like approve users, change global settings etc. The real business happens in the silverlight and win forms apps. Im using mvc3 rc2 with Razor. Thanks

    Read the article

  • Can I resolve ASP.NET "~" paths without a Control being present?

    - by jdk
    I want to Resolve "~/whatever" from inside non-Page contexts such as Global.asax (HttpApplication), HttpModule, HttpHandler, etc. but can only find the Resolution methods specific to Controls (and Page). I think the app should have enough knowledge to be able to map this outside the Page context. No? Or at least it makes sense to me it should be resolvable in other circumstances, wherever the app root is known. Update: The reason being I'm sticking ~ paths in the web.configuration files.

    Read the article

  • How to auto create a JMS topic/queue on JBoss in a portable and per-application way?

    - by Bozho
    It's simple: I have an MDB and an EJB that sends messages to a topic (or queue). JBoss complains that the topic is not bound to the JNDI context. I want to have the topic/queue to be automatically created at best, or at least to have a standard way to define it, per application (say, in ejb-jar/META-INF) this question and this blogpost show us how to do it in an application server specific way. This surely works, but: I want to use the @MessageDriven annotation I want the setting not to be global for the application server I want the setting to be portable

    Read the article

  • Manage DNS Zone in "slave" Mode with MS Windows 2008 R2

    - by kockiren
    Hello @all following issue, I configure a DNS Zone "location.domain.tld" for my internal Network and it works well, but now I want to manage the domain.tld for my internal Network, but the domain.tld is managed by an external DNS Provider. In location.domain.tld there are all Clients and Servers for internal use only (with local IPs) all these clients resolve the global Mailserver (for example) over his external Address but now i want to catch single Domainnames and resolve it on my own way. But i did not find a way to solve this issue. Any Ideas? Regards Rene

    Read the article

  • What would be the PHP equivalent of this Perl regex?

    - by Jamie
    What would be the PHP equivalent of this Perl regex? if (/^([a-z0-9-]+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/ and $1 ne "global" and $1 ne "") { print " <tr>\n"; print " <td>$1</td>\n"; print " <td>$2</td>\n"; print " <td>$3</td>\n"; print " <td>$4</td>\n"; print " <td>$5</td>\n"; print " <td>$6</td>\n"; print " <td>$7</td>\n"; print " <td>$8</td>\n"; print " </tr>\n"; }

    Read the article

  • Track/Display Array Index As Part Of Cout (C++)

    - by John Smith
    Hi, I have a command line C++ program that lets you enter basic information about a person (ID number, name, age, etc.) and I want to output to a console in the following manner: ------------------------------------------------------------------- Index ID # First Name Last Name Age ------------------------------------------------------------------- 0 1234 John Smith 25 The person objects are stored in an array of Persons and I've overload the ostream (<<) operator to print out all of the fields like you see. The dashed lines and header come from a displayHdg() function. Anyhow, I have not been able to figure out how to get the proper index value for the array. Ideally, I'd like to generate the indices for each line, but all my attempts have failed. The array is looped through and each object printed in the main() function, and the ostream is overloaded in a person class, so I tried to use global variables as well as static variables, and all of those produce incorrect numbering (i.e. show 0, 1 the first time (for 2 objects), then change to 1, 2 on the next display). Any ideas?

    Read the article

  • Using static mutex in a class

    - by Dmitry Yudakov
    I have a class that I can have many instances of. Inside it creates and initializes some members from a 3rd party library (that use some global variables) and is not thread-safe. I thought about using static boost::mutex, that would be locked in my class constructor and destructor. Thus creating and destroying instances among my threads would be safe for the 3rd party members. class MyClass { static boost::mutex mx; // 3rd party library members public: MyClass(); ~MyClass(); }; MyClass::MyClass() { boost::mutex::scoped_lock scoped_lock(mx); // create and init 3rd party library stuff } MyClass::~MyClass() { boost::mutex::scoped_lock scoped_lock(mx); // destroy 3rd party library stuff } I cannot link because I receive error: undefined reference to `MyClass::mx` Do I need some special initialization of such static member? Is the whole conception of static mutex wrong?

    Read the article

  • What is the scope of require_once in PHP?

    - by TMG
    Simple question: Is the scope of require_once global? For example: <?PHP require_once('baz.php'); // do some stuff foo ($bar); function foo($bar) { require_once('baz.php'); // do different stuff } ?> When foo is called, does it re-parse baz.php? Or does it rely on the already required file from the main php file (analagous to calling require_once twice consecutively for the same include file)? I saw this thread before, but it didn't quite answer the question: http://stackoverflow.com/questions/1669707/should-require-once-some-file-php-appear-anywhere-but-the-top-of-the-file Thanks for your help!

    Read the article

  • MySql - Select from - Don't Show Duplicate Words - maybe "on duplicate key"?

    - by ali
    hi, how can I insert "on duplicate key" in this Code to remove duplicate words? or is there a better method that you know? thank you!! this is my code: function sm_list_recent_searches($before = '', $after = '', $count = 20) { // List the most recent successful searches. global $wpdb, $table_prefix; $count = intval($count); $results = $wpdb->get_results( "SELECT `terms`, `datetime` FROM `{$table_prefix}searchmeter_recent` WHERE 3 < `hits` AND CHAR_LENGTH(`terms`) > 4 ORDER BY `datetime` DESC LIMIT $count"); if (count($results)) { foreach ($results as $result) { echo '<a href="'. get_settings('home') . '/search/' . urlencode($result->terms) . '">'. htmlspecialchars($result->terms) .'</a>'.", "; } } }

    Read the article

  • The equivalent of this Perl regex in PHP

    - by Jamie
    Hi all, What would be the equivalent in php of this regex in php: I.e. which function would do the same job. if (/^([a-z0-9-]+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/ and $1 ne "global" and $1 ne "") { print " <tr>\n"; print " <td>$1</td>\n"; print " <td>$2</td>\n"; print " <td>$3</td>\n"; print " <td>$4</td>\n"; print " <td>$5</td>\n"; print " <td>$6</td>\n"; print " <td>$7</td>\n"; print " <td>$8</td>\n"; print " </tr>\n"; } Thanks very much! :-)

    Read the article

  • How to configure AutoMapper if not ASP.net Application?

    - by alex
    I'm using AutoMapper in a number of projects within my solution. These projects may be deployed independantly, across multiple servers. In the documentation for AutoMapper it says: If you're using the static Mapper method, configuration only needs to happen once per AppDomain. That means the best place to put the configuration code is in application startup, such as the Global.asax file for ASP.NET applications. Whilst some of the projects will be ASP.net - most of these are class libraries / windows services. Where should I be configuring my mappings in this case?

    Read the article

  • Ajax Control Toolkit CalendarExtender not closing when form body clicked.

    - by TampaRich
    I am trying to simply have the calendar close when a user clicks anywhere on the page. I have downloaded the most recent version of the toolkit and I can not get this functionality to work. I am not sure if I am missing a property but the functionality works as expected on the asp.net sample toolkit page. Here is the code: <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <asp:TextBox ID="txtTest" runat="server" /><img runat="server" alt="Calendar" id="imgCalFrom" align="absmiddle" border="0" height="16" src="/global/images/glo_btn_cal.gif" width="21"/> <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTest" PopupButtonID="imgCalFrom"> </asp:CalendarExtender>

    Read the article

< Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >