Search Results

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

Page 50/224 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • COM-Objects containing maps / content error(0)

    - by Florian Berzsenyi
    I'm writing a small wrapper to get familiar with some important topics in C++ (WinAPI, COM, STL,OOP). For now, my class shall be able to create a (child) window. Mainly, this window is connected to a global message loop that distribute messages to a local loop of the right instance (global is static, local is virtual). Obviously, there are surely better ways to do that but I'm using std::maps to store HWND and their instance pointer in pairs (the Global loop looks for the pointer with the HWND-parameter, gets itself the pointer from the map and calls then the local loop). Now, it appears that the map does not accept any values because of a unknown reason. It seems to allocate enough space but something went wrong anyway [ (error) 0 is displayed instead of the entries in visual C++). I've looked that up in google as well and found out that maps cause some trouble when used in classes AND DLLs. May this be the reason and is there any solution?? Protected scope of class: static std::map<HWND,MAP_BASE_OBJECT*> m_LoopBuf Implementation in .cpp-file: std::map<HWND,MAP_BASE_OBJECT*> HWindow::m_LoopBuf;

    Read the article

  • The best way to implement drawing features like Keynote

    - by Shamseddine
    Hi all, I'm trying to make a little iPad tool's for drawing simple geometrical objects (rect, rounded rect, ellipse, star, ...). My goal is to make something very close to Keynote (drawing feature), i.e. let the user add a rect (for instance), resizing it and moving it. I want too the user can select many objects and move them together. I've thought about at least 3 differents ways to do that : Extends UIView for each object type, a class for Rect, another for Ellipse, ... With custom drawing method. Then add this view as subview of the global view. Extends CALayer for each object type, a class for Rect, another for Ellipse, ... With custom drawing method. Then add this layer as sublayer of the global view layer's. Extends NSObject for each object type, a class for Rect, another for Ellipse, ... With just a drawing method which will get as argument a CGContext and a Rect and draw directly the form in it. Those methods will be called by the drawing method of the global view. I'm aware that the two first ways come with functions to detect touch on each object, to add easily shadows,... but I'm afraid that they are a little too heavy ? That's why I thought about the last way, which it seems to be straight forward. Which way will be the more efficient ??? Or maybe I didn't thought another way ? Any help will be appreciated ;-) Thanks.

    Read the article

  • How to set up single array or dictionary for use in multiple datasources?

    - by Roman
    I have multiple TableViewDatasources that need to display list of objects form same pool depending of certain property. E.g. object.flag1 is set- it will show up in TableView1 object.flag2 is set- it will show up in TableView2 The obvious way would be to have separate arrays for each TableView, But same object may appear in different arrays. Also I need to update objects very often or access all objects through same array. How do I setup a single dictionary or array to have all objects in one structure? To put it in another way: When table view or selection changes, application need to redraw TableViews with the new data. Application have to access the pool of objects and search through them using iterator and accessing each object and its properties. I think that this is an expensive operation and want to avoid that. Perhaps maybe by making a global pool of objects a dictionary and exposing objects properties as dictionary fields. So instead of iterating global pool of objects I could access global pool Dicitonary in a manner of database by selecting objects that has fields that match particular criteria. Anyone know any example of doing that?

    Read the article

  • How to provide js-ctypes in a spidermonkey embedding?

    - by Triston J. Taylor
    Summary I have looked over the code the SpiderMonkey 'shell' application uses to create the ctypes JavaScript object, but I'm a less-than novice C programmer. Due to the varying levels of insanity emitted by modern build systems, I can't seem to track down the code or command that actually links a program with the desired functionality. method.madness This js-ctypes implementation by The Mozilla Devs is an awesome addition. Since its conception, scripting has been primarily used to exert control over more rigorous and robust applications. The advent of js-ctypes to the SpiderMonkey project, enables JavaScript to stand up and be counted as a full fledged object oriented rapid application development language flying high above 'the bar' set by various venerable application development languages such as Microsoft's VB6. Shall we begin? I built SpiderMonkey with this config: ./configure --enable-ctypes --with-system-nspr followed by successful execution of: make && make install The js shell works fine and a global ctypes javascript object was verified operational in that shell. Working with code taken from the first source listing at How to embed the JavaScript Engine -MDN, I made an attempt to instantiate the JavaScript ctypes object by inserting the following code at line 66: /* Populate the global object with the ctypes object. */ if (!JS_InitCTypesClass(cx, global)) return NULL; /* I compiled with: g++ $(./js-config --cflags --libs) hello.cpp -o hello It compiles with a few warnings: hello.cpp: In function ‘int main(int, const char**)’: hello.cpp:69:16: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null] hello.cpp:80:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] hello.cpp:89:17: warning: NULL used in arithmetic [-Wpointer-arith] But when you run the application: ./hello: symbol lookup error: ./hello: undefined symbol: JS_InitCTypesClass Moreover JS_InitCTypesClass is declared extern in 'dist/include/jsapi.h', but the function resides in 'ctypes/CTypes.cpp' which includes its own header 'CTypes.h' and is compiled at some point by some command during 'make' to yeild './CTypes.o'. As I stated earlier, I am less than a novice with the C code, and I really have no idea what to do here. Please give or give direction to a generic example of making the js-ctypes object functional in an embedding.

    Read the article

  • ASP.NET auto-generate aspx.designer.cs turn off?

    - by Joris
    Hey all, As I'm working on a asp.net/c# project, I'm confronted with the foobar.aspx.designer.cs that auto generates it's content. eg, when I'm changing the code/designer, the designer.cs automatically updates it's content. As I'm bit of a control-dude, I'd like to maintain the code myself. I'm not happy with the overkill of comments I don't need. Like: /// <summary> /// Form1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlForm Form1; While I'd like to see the following: protected global::System.Web.UI.HtmlControls.HtmlForm Form1; protected global::System.Web.UI.WebControls.Button Button3; etc, etc (don't mind the naming, ofcourse I'd give it some distinguishing nameing) How to fix this? I checked google on this one, but couldn't find an answer so quickly...

    Read the article

  • Gacutil.exe successfully adds assembly, but assembly missing from GAC. Why?

    - by Ben McCormack
    I'm running GacUtil.exe from within Visual Studio Command Prompt 2010 to register a dll (CatalogPromotion.dll) to the GAC. After running the utility, it says Assembly Successfully added to the cache, and running gacutil /l CatalogPromotionDll shows that the GAC contains the assembly, but I can't see the assembly when I navigate to C:\WINDOWS\assembly from Windows Explorer. Why can't I see the assembly in WINDOWS\assembly from Windows Explorer but I can see it using gacutil.exe? Background: Here's what I typed into the command prompt for VS Tools: C:\_Dev Projects\VS Projects\bmccormack\CatalogPromotion\CatalogPromotionDll\bin \Debuggacutil /i CatalogPromotionDll.dll Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. Assembly successfully added to the cache C:\_Dev Projects\VS Projects\bmccormack\CatalogPromotion\CatalogPromotionDll\bin \Debuggacutil /l CatalogPromotionDll Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. The Global Assembly Cache contains the following assemblies: CatalogPromotionDll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9188a175 f199de4a, processorArchitecture=MSIL Number of items = 1 However, the assembly doesn't show up in C:\WINDOWS\assembly.

    Read the article

  • Basic Question on storing variables c# for use in other classes

    - by Calibre2010
    Ok guys I basically have a class which takes in 3 strings through the parameter of one of its method signatures. I've then tried to map these 3 strings to global variables as a way to store them. However, when I try to call these global variables from another class after instantiating this class they display as null values. this is the class which gets the 3 strings through the method setDate, and the mapping.. public class DateLogic { public string year1; public string month1; public string day1; public DateLogic() { } public void setDate(string year, string month, string day) { year1 = year; month1 = month; day1 = day; // getDate(); } public string getDate() { return year1 + " " + month1 + " " + day1; } } After this I try call this class from here public static string TimeLine2(this HtmlHelper helper, string myString2) { DateLogic g = new DateLogic(); string sday = g.day1; string smonth = g.month1; string syr = g.year1; } I've been debugging and the values make it all the way to the global variables but when called from this class here it doesnt show them, just shows null. Is this cause I'm creating a brand new instance, how do i resolve this?

    Read the article

  • Paste or Drop, copy data and release source?

    - by Harvey
    I have an MFC DocView SDI App that receives data from either the clipboard or drag and drop. The data is in either CF_HDROP or CF_TEXT format. I have a COleDropTarget derived CMyDropTarget member m_dropTarget of my CMainFrame class. I have two member functions of CMyDropTarget; OnDrop(...) and OnPaste() which each call another member function PostData(pDataObject). I want to get a copy of the pDataObject from either CF_... format and PostMessage to my CmainFrame which will call a member of my Doc class. What is a simple way of getting a copy of the global data to pass with the PostMessage() so that I can get the drop source released before I get around to processing the global data? NOTE that they are always treated as a copy of the source data, so there is no need for the source to delete anything when the operation is done. Or perhaps a better way of asking the question is: How can I release the Drop source before processing the global data? Can I pass the HGLOBAL via PostMessage and still release the source without making a copy of it?

    Read the article

  • Use different configurations with Simple Injection

    - by Ruben.Canton
    I'm using the library "Simple Injector" (http://simpleinjector.codeplex.com) and it looks cool and nice. But after building a configuration and use it, now I want to know how to change from one configuration to another. Scenario: Let's imagine I've set up a configuration in the Global Asax and I have the public and global Container there. Now I want to make some tests and I want them to use mock classes so I want to change the configuration. I can, of course, build another configuration and assign it to the global Container created by default, so that every time I run a test the alternative configuration will be set. But on doing that and though I'm in development context the Container is changed for everyone, even for normal requests. I know I'm testing in this context and that shouldn't matter, but I have the feeling that this is not the way for doing this... and I wonder how to change from one configuration to another in the correct way. Note: At Simple Injector documentation says that you can ask questions in stackoverflow so that's why I'm here. =P PD: I'm new in this IoC and DI world so try to be easy with me when explaining it :)

    Read the article

  • Opa app does not load in Internet Explorer when compiled with Opa 1.1.1

    - by Marcin Skórzewski
    I did a minor update to the already working application and then had problems using new version of Opa compiler. First problem - runtime exception Since the original deployment Opa 1.1.1 has been released and it resulted in error: events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:901:11) at Server._listen2 (net.js:1039:14) at listen (net.js:1061:10) at Server.listen (net.js:1127:5) at global.BslNet_Http_server_init_server (/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:223:1405) at global.BslNet_Http_server_init_server_cps (/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:226:15) at __v1_bslnet_http_server_init_server_cps_b970f080 (/opt/mlstate/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/main.js:1:175) at /opt/mlstate/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/main.js:440:106 at global.execute_ (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:19:49) at /opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:17:78 I decided to build Opa from sources and it helped, but another problem occurred :( Second problem - stops to support the IE Application stopped to work in Internet Explorer. I tried two different machines (Windows XP and 7) with IE 8 and 10. Web page does not load at all (looks like the network problem, but the same URL works fine in Firefox). I confirmed the same problem with "Hello world" from the Opa tutorial compiled with both Opa stable 1.1.1 and build from sources. I suspected that the problem is due to Node.js update (Opa = 1.1.1 requires Node 0.10.* - now I am using 0.10.12, but I also tried other 0.10-s), but "Hello world" from the Node's from page works fine. I am running the app on OSX developer box and Linux Debian 7.0 server. Any suggestions what am I doing wrong? PS. I was off the business for a while. Anyone knows what happened to the Opa forum? Signing is seams not to work.

    Read the article

  • How to return ArrayList results from an IntentService

    - by gcl1
    I have an IntentService that loads up an ArrayList with data from a network source (AWS SDB tables). The ArrayList is in a global space -- accessible to both the calling Activity and the IntentService (like this: appState = ((App)getApplicationContext())). When the IntentService is done, it notifies the Activity through a ResultReceiver, and the Activity calls adapter.notifyDataChanged() to update the ListView. This solution works most of the time, ... but it violates the rule that only the UI thread should make changes to data underlying a ListView. So as it is, I sometimes get an error: "The content of the adapter has changed but ListView did not receive a notification." I think this must be a common situation. Please let me know if you have any suggestions or best practices for this problem. Here are three options I'm aware of: Keep the IntentService, and have it store the results in another "working" ArrayList, also in the global space. When the result is ready, the IntentService calls the ResultReceiver (on the UI thread), which can then: a) copy the result to the ArrayList associated with the ListView, and b) call adapter.notifyDataChanged(). CONS: I don't like the idea of putting temp/working data in a global space, and copying the result list seems inefficient. Keep the IntentService, and have it pass the results back through a bundle loaded with a ParcelableArrayList. CONS: I'm not sure if this approach would scale for very large result sets. It also requires copying the result list. Switch to a Service which builds a local copy of the result list. Have the Activity directly access the address space of the Service in order to read the result list. CON: Still requires copying results to the ArrayList associated with the ListView. Thank you.

    Read the article

  • Find numbers that equals a sum in an array

    - by valli-R
    I want to find the first set of integers in an array X that the sum equals a given number N. For example: X = {5, 13, 24, 9, 3, 3} N = 28 Solution = {13, 9, 3, 3} Here what I have so far : WARNING, I know it uses global and it is bad,that's not the point of the question. <?php function s($index = 0, $total = 0, $solution = '') { global $numbers; global $sum; echo $index; if($total == 28) { echo '<br/>'.$solution.' = '.$sum.'<br/>'; } elseif($index < count($numbers) && $total != 28) { s($index + 1, $total, $solution); s($index + 1, $total + $numbers[$index], $solution.' '.$numbers[$index]); } } $numbers = array(5, 13, 24, 9, 3, 3); $sum = 28; s(); ?> I don't get how I can stop the process when it finds the solution.. I know I am not far from good solution.. Thanks in advance

    Read the article

  • Drools - Doing Complex Stuff inside a Rule Condition or Consequence

    - by mfcabrera
    Hello, In my company we are planning to use Drools a BRE for couple of projects. Now we trying to define some best-practices. My question is what should be and shouldn't be done inside a Rule Condition/Consequence. Given that we can write Java directly or call methods (for example From a Global object in the Working Memory). Example. Given a Rule that evaluates a generic Object (e.g. Person) have property set to true. Now, that specific propertie can only be defined for that Object going to the database and fetching that info. So we have two ways of implementing that: Alternative A: Go to the database and fetch the object property (true/false, a code) Insert the Object in the working memory Evaluate the rule Alternative B: Insert a Global Object that has a method that connects to the database and check for the property for the given object. Insert the Object to eval in Working Memory In the rule, call the Global Object and perform the access to the database Which of those is considered better? I really like A, but sometimes B is more straightforward, however what would happen if something like a Exception from the Database is raised? I have seen the alternative B implemented in the Drools 5.0 Book from Packt Publishing,however they are doing a mocking and they don't talk about the actual implications of going to the database at all. Thank you,

    Read the article

  • Thread mutex behaviour

    - by Alberteddu
    Hi there, I'm learning C. I'm writing an application with multiple threads; I know that when a variable is shared between two or more threads, it is better to lock/unlock using a mutex to avoid deadlock and inconsistency of variables. This is very clear when I want to change or view one variable. int i = 0; /** Global */ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /** Thread 1. */ pthread_mutex_lock(&mutex); i++; pthread_mutex_unlock(&mutex); /** Thread 2. */ pthread_mutex_lock(&mutex); i++; pthread_mutex_unlock(&mutex); This is correct, I think. The variable i, at the end of the executions, contains the integer 2. Anyway, there are some situations in which I don't know exactly where to put the two function calls. For example, suppose you have a function obtain(), which returns a global variable. I need to call that function from within the two threads. I have also two other threads that call the function set(), defined with a few arguments; this function will set the same global variable. The two functions are necessary when you need to do something before getting/setting the var. /** (0) */ /** Thread 1, or 2, or 3... */ if(obtain() == something) { if(obtain() == somethingElse) { // Do this, sometimes obtain() and sometimes set(random number) (1) } else { // Do that, just obtain(). (2) } } else { // Do this and do that (3) // If # of thread * 3 > 10, then set(3*10) For example. (4) } /** (5) */ Where I have to lock, and where I have to unlock? The situation can be, I think, even more complex. I will appreciate an exhaustive answer. Thank you in advance. —Alberto

    Read the article

  • Require reasonably random results from an SQL SELECT query within a Joomla article (Cache enabled)

    - by Shrinivas
    Setup: Joomla website on LAMP stack I have a MySQL table containing some records, these are queried by a simple SELECT on the Joomla article, as pasted below. This specific Joomla website has Caching turned on in Joomla's Global Configuration. I need to randomize the order in which I display the resultset, each time the page is loaded. Regular php/mysql would offer me two approaches for this: 1. use 'order by RAND()' or any of a number of methods to allow a SELECT query to return reasonably random results. 2. once php gets the result from the SELECT into an array, shuffle the array to get a reasonably random order of array items. However, as this Joomla instance has Caching turned ON in its Global Configuration, either of the above approaches fails. The first time I load the page the order is randomized, however any further reloads do not cause the order to change, as the page is delivered from cache. The instant the Cache is disabled, both approaches (shuffle/order by rand) work perfectly. What am I missing? How do I override the Global Cache for this specific article? A very simple requirement, that is met by both php and mysql reasonably well, is blocked by the Joomla Cache that I cannot turn off. The php that returns results from the database. <pre> $db = JFactory::getDBO(); $select = "SELECT id FROM jos_mytable;"; //order by RAND() $db->setQuery($select); echo $db->getQuery(); //Show me the Query! $rows = $db->loadObjectList(); //shuffle($rows); foreach($rows as $row) { echo "$row->id"; }

    Read the article

  • Is it true that in most Object Oriented Programming Languages, an "i" in an instance method always r

    - by Jian Lin
    In the following code: <script type="text/javascript"> var i = 10; function Circle(radius) { this.r = radius; this.i = radius; } Circle.i = 123; Circle.prototype.area = function() { alert(i); } var c = new Circle(1); var a = c.area(); </script> What is being alerted? The answer is at the end of this question. I found that the i in the alert call either refers to any local (if any), or the global variable. There is no way that it can be the instance variable or the class variable even when there is no local and no global defined. To refer to the instance variable i, we need this.i, and to the class variable i, we need Circle.i. Is this actually true for almost all Object oriented programming languages? Any exception? Are there cases that when there is no local and no global, it will look up the instance variable and then the class variable scope? (or in this case, are those called scope?) the answer is: 10 is being alerted.

    Read the article

  • Undefined Variable? But I defined it...

    - by Rob
    Well before anyone claims that theres a duplicate question... (I've noticed that people who can't answer the question tend to run and look for a duplicate, and then report it.) Here is the duplicate you are looking for: http://stackoverflow.com/questions/2481382/php-claims-my-defined-variable-is-undefined However, this isn't quite a duplicate. It gives me a solution, but I'm not really looking for this particular solution. Here is my problem: Notice: Undefined variable: custom Now here is my code: $headers = apache_request_headers(); // Request the visitor's headers. $customheader = "Header: 7ddb6ffab28bb675215a7d6e31cfc759"; //This is what the header should be. foreach ($headers as $header => $value) { $custom .= "$header: $value"; } Clearly, $custom is defined. According to the other question, it's a global and should be marked as one. But how is it a global? And how can I make it a (non-global)? The script works fine, it still displays what its supposed to and acts correctly, but when I turn on error messages, it simply outputs that notice as well. I suppose its not currently necessary to fix it, but I'd like to anyway, as well as know why its doing this.

    Read the article

  • Javascript Namespace Help

    - by Jason
    Hi, I have a pretty big Javascript script with loads of global variables & functions in it. Then a piece of code that calls one function from this js file: myfunc(); Ok, now I have cloned this script and modified some functionality, all function prototypes and variables are named the same in both scripts. So now I have two scripts loaded and one call to myfunc(), now we have a clash because there are loads of global variables with the same names and two myfunc()s. What I want to do is wrap this cloned script in a namespace, so that I can modify the original call to: clone.myfunc() which will call the new function, but I also want myfunc() to just refer to the original script. In other words I can't touch the original script (no permissions) and I want to be able to use both the clone and the original at runtime. This is the script im cloning: http://pastebin.com/6KR5T3Ah Javascript namespaces seem quite tricky this seems a nice namespace method: var namespace = { foo: function() { } bar: function() { } } ... namespace.foo(); } However that requires using an object, and the script (as posted above) is humongous at nearly 4000 lines, too much to objectize I think? Anyone know a better solution to avoid namespace pollution, with one script I cant touch and one being a clone of that script. Just so I can call myfunc() and clone.myfunc() and all global variables will behave in their respected scope. It's either that, or I go through and modify everything to have unique names, which may take a lifetime This is a Mozilla addon if it helps context wise. Thanks.

    Read the article

  • SQL Binary Microsoft Access - Combining two tables if specific field values are equal

    - by Jordan
    I am new to Microsoft Access and SQL but have a decent programming background and I believe this problem should be relatively simple. I have two tables that I have imported into Access. I will give you a little context. One table is huge and contains generic, global data. The other table is still big but contains specific, regional data. There is only one common field (or column) between the two tables. Let’s call this common field CF. The other fields in both tables are different. I’ll take you through one iteration of what I need to do. I need to take each CF value in the regional, smaller table and find the common CF value in the larger, global table. After finding the match, I need to take the whole “record” or “row” from the global data and copy it over to the corresponding record in the smaller regional table (This should involve creating the new fields). I need to do this for all CF values in the regional, smaller table. I was recommended to use SQL and a binary search, but I am unfamiliar. Let me know if you have any questions. I appreciate the help!

    Read the article

  • How can one make a 'passthru' function in C++ using macros or metaprogramming?

    - by Ryan
    So I have a series of global functions, say: foo_f1(int a, int b, char *c); foo_f2(int a); foo_f3(char *a); I want to make a C++ wrapper around these, something like: MyFoo::f1(int a, int b, char* c); MyFoo::f2(int a); MyFoo::f3(char* a); There's about 40 functions like this, 35 of them I just want to pass through to the global function, the other 5 I want to do something different with. Ideally the implementation of MyFoo.cpp would be something like: PASSTHRU( f1, (int a, int b, char *c) ); PASSTHRU( f2, (int a) ); MyFoo::f3(char *a) { //do my own thing here } But I'm having trouble figuring out an elegant way to make the above PASSTHRU macro. What I really need is something like the mythical X getArgs() below: MyFoo::f1(int a, int b, char *c) { X args = getArgs(); args++; //skip past implicit this.. ::f1(args); //pass args to global function } But short of dropping into assembly I can't find a good implementation of getArgs().

    Read the article

  • Fatal error: Allowed memory size exhausted...

    - by Nano HE
    HI, I upload my php testing script to online vps server just now. The script used to parse a big size XML file(about 4M, 7000Lines). But my IE explorer show the online error message below. Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 77 bytes) in /var/www/test/result/index.php on line 26 I am sure I already tested the php script on localhost successfully. Is there any configuration need be enable/modify on my VPS? Such as php.ini or some setting for apache server? I just verified there are about 200M memory usage are avaliable for my VPS. How can I fix this? ...... function startElementHandler ($parser,$name,$attrib){ global $usercount; global $userdata; global $state; // Line #26; //Debug //print "name is: ".$name."\n"; switch ($name) { case $name=="_ID" : { $userdata[$usercount]["first"] = $attrib["FIRST"]; $userdata[$usercount]["last"] = $attrib["LAST"]; $userdata[$usercount]["nick"] = $attrib["NICK"]; $userdata[$usercount]["title"] = $attrib["TITLE"]; break; } ...... default : {$state=$name;break;} } }

    Read the article

  • gems, bundle command, and ruby not found in new terminal window

    - by user3579987
    So I installed ruby with rvm, ran a bundle install and installed a bunch of gems, etc. It all works just fine in the original terminal window I did all of this in but I opened up a new terminal window and now I'm getting errors like bundle: command not found and gem command not found. I tried doing a symbolic link for the gem command but then when I do gem list it displays a much shorter list of my local gems and not at all the ones I need for bundle install. Is there something I need to do to configure bash or rvm so that it recognizes that I did indeed install all the gems I have installed? name@crunchbang:~/ug_research_portal$ which gem /home/name/.rvm/rubies/ruby-2.1.1/bin/gem name@crunchbang:~/ug_research_portal$ which ruby /home/name/.rvm/rubies/ruby-2.1.1/bin/ruby And in ~/.bashrc: GEM_HOME="/home/name/.rvm/gems/ruby-2.1.1" GEMGLOBAL_HOME="/home/ name/.rvm/gems/ruby-2.1.1@global" export PATH=$PATH:$GEM_HOME/bin:$GEMGLOBAL_HOME/bin:$HOME/.rvm/bin Edit: Looks like my $PATH is somehow wrong? bash: /home/name/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/name/.rvm/gems/ruby-2.1.1/bin:/home/name/.rvm/gems/ruby-2.1.1@global/bin:/home/name/.rvm/bin/: No such file or directory which is odd since ls for /home/name/.rvm/bin and /home/name/.rvm/gems/ruby-2.1.1@global/bin and /home/name/.rvm/gems/ruby-2.1.1/bin work just fine Psych, I was just doing $PATH instead of echo "$PATH" which was giving me the No such file or directory error. The original problem still stands though.

    Read the article

  • Sparc Assembly Call currupts data

    - by Sigge
    I am at the moment working with some assembler code for the Sparc processor family, and i am having some truble with a piece of code.. I think the code and output explains more, but in the short.. When i do a call to the function println my varaibels that i have written to the %fp - 8 memory location is destoryed.. here is my assembler code that i am trying to run !PROCEDURE main .section ".text" .global main .align 4 main: save %sp, -96, %sp L1: set 96, %l0 mov %l0, %o0 call initObject ; nop mov %o0, %l0 mov %l0, %o0 call Test$go ; nop mov %o0, %l0 mov %l0, %o0 call println ; nop L0: ret restore !END main !PROCEDURE Test$go .section ".text" .global Test$go .align 4 Test$go: save %sp, -96, %sp L3: mov %i0, %l0 set 0, %l0 set -8, %l1 add %fp,%l1, %l1 st %l0, [%l1] set 1, %l0 mov %l0, %o0 call println ; nop set -8, %l0 add %fp,%l0, %l0 ld [%l0], %l0 mov %l0, %o0 call println ; nop set 1, %l0 mov %l0, %i0 L2: ret restore !END Test$go Here is the assembler code for the println code .global println .type println,#function println: save %sp,-96,%sp ! block 1 .L193: ! File runtime.c: ! 42 } ! 43 ! 45 /** ! 46 Prints an integer to the standard output stream. ! 47 ! 48 @param i The integer to be printed. ! 49 */ ! 50 void println(int i) { ! 51 printf("%d\n", i); sethi %hi(.L195),%o0 or %o0,%lo(.L195),%o0 call printf mov %i0,%o1 jmp %i7+8 restore This is the out put i get when i run this piece of assembler code 1 67584 1 As u can see, the data that is located at %fp - 8 has been destroyed.. please all feedback is apritiated

    Read the article

  • cuda 5.0 namespaces for contant memory variable usage

    - by Psypher
    In my program I want to use a structure containing constant variables and keep it on device all long as the program executes to completion. I have several header files containing the declaration of 'global' functions and their respective '.cu' files for their definitions. I kept this scheme because it helps me contain similar code in one place. e.g. all the 'device' functions required to complete 'KERNEL_1' are separated from those 'device' functions required to complete 'KERNEL_2' along with kernels definitions. I had no problems with this scheme during compilation and linking. Until I encountered constant variables. I want to use the same constant variable through all kernels and device functions but it doesn't seem to work. ########################################################################## CODE EXAMPLE ########################################################################### filename: 'common.h' -------------------------------------------------------------------------- typedef struct { double height; double weight; int age; } __CONSTANTS; __constant__ __CONSTANTS d_const; --------------------------------------------------------------------------- filename: main.cu --------------------------------------------------------------------------- #include "common.h" #include "gpukernels.h" int main(int argc, char **argv) { __CONSTANTS T; T.height = 1.79; T.weight = 73.2; T.age = 26; cudaMemcpyToSymbol(d_consts, &T, sizeof(__CONSTANTS)); test_kernel <<< 1, 16 >>>(); cudaDeviceSynchronize(); } --------------------------------------------------------------------------- filename: gpukernels.h --------------------------------------------------------------------------- __global__ void test_kernel(); --------------------------------------------------------------------------- filename: gpukernels.cu --------------------------------------------------------------------------- #include <stdio.h> #include "gpukernels.h" #include "common.h" __global__ void test_kernel() { printf("Id: %d, height: %f, weight: %f\n", threadIdx.x, d_const.height, d_const.weight); } When I execute this code, the kernel executes, displays the thread ids, but the constant values are displayed as zeros. How can I fix this?

    Read the article

  • Sparc Assembly Call corrupts data

    - by Sigge
    I am at the moment working with some assembler code for the Sparc processor family, and i am having some truble with a piece of code.. I think the code and output explains more, but in the short.. When i do a call to the function println my varaibels that i have written to the %fp - 8 memory location is destoryed.. here is my assembler code that i am trying to run !PROCEDURE main .section ".text" .global main .align 4 main: save %sp, -96, %sp L1: set 96, %l0 mov %l0, %o0 call initObject ; nop mov %o0, %l0 mov %l0, %o0 call Test$go ; nop mov %o0, %l0 mov %l0, %o0 call println ; nop L0: ret restore !END main !PROCEDURE Test$go .section ".text" .global Test$go .align 4 Test$go: save %sp, -96, %sp L3: mov %i0, %l0 set 0, %l0 set -8, %l1 add %fp,%l1, %l1 st %l0, [%l1] set 1, %l0 mov %l0, %o0 call println ; nop set -8, %l0 add %fp,%l0, %l0 ld [%l0], %l0 mov %l0, %o0 call println ; nop set 1, %l0 mov %l0, %i0 L2: ret restore !END Test$go Here is the assembler code for the println code .global println .type println,#function println: save %sp,-96,%sp ! block 1 .L193: ! File runtime.c: ! 42 } ! 43 ! 45 /** ! 46 Prints an integer to the standard output stream. ! 47 ! 48 @param i The integer to be printed. ! 49 */ ! 50 void println(int i) { ! 51 printf("%d\n", i); sethi %hi(.L195),%o0 or %o0,%lo(.L195),%o0 call printf mov %i0,%o1 jmp %i7+8 restore This is the out put i get when i run this piece of assembler code 1 67584 1 As u can see, the data that is located at %fp - 8 has been destroyed.. please all feedback is apritiated

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >