Daily Archives

Articles indexed Friday November 23 2012

Page 11/16 | < Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Google Analytics - bad experiences? (esp. adult content)

    - by Litso
    I work for a rather large adult website, and we're currently not using Google Analytics. There is an internal debate going on about whether we should start using Analytics, but there is hestitation from certain parties. The main argument is that they fear that Google will get too much insight into our website, and might even block us from the index as a result based on our adult content. Has anyone here ever had such an experience, or know stories about bad experiences with Google Analytics in such a manner? I personally think it will only improve our website if we were able to use Analytics, but the dev team was asked to look into possible negative effects. Any help would be appreciated.

    Read the article

  • Confusion on HLSL Samplers. Can I Set Samplers Inside Functions?

    - by Kyle Connors
    I'm trying to create a system where I can instance a quad to the screen, however I've run into a problem. Like I said, I'm trying to instance the quad, so I'm trying to use the same geometry several times, and I'm trying to do it in one draw call. The issue is, I want some quads to use different textures, but I can't figure out how to get the data into a sampler so I can use it in the pixel shader. I figured that since we can simply pass in the 4 bytes of our IDirect3DTexture9* to set the global texture, I can do so when passing in my dynamic buffer. (Which also stores each objects world matrix and UV data) Now that I'm sending the data, I can't figure how to get it into the sampler, and I really want to assume that it's simply not possible. Is there any way I could achieve this?

    Read the article

  • game inventory/bag system javascript html5 game

    - by Tom Burman
    im building an RPG game using html5's canvas and javascript. Its tile based and im using an array to created my game map. I would like the player to have a bag/inventory so when they select or land on a tile that has an item on it, they can click on it and store it in their bag/inventory. I was thinking of using a 2d array to store the value of the item tile, a bit like my map is doing, so when the player lands on, lets say a rope tile which is tileID 4, the value 4 is pushed into the next array position available, then reloop through the array and reprint it to the screen. For an example of what im trying to achieve visually, would be like runescapes inventory, but dumbed down a bit. I appreciate any views and answers. Im not great at javascript coding so please be patient Thanks Tom

    Read the article

  • Development costs of an indie multiplayer arcade shooter

    - by VorteX
    Me and a friend of mine have been wanting to remake one of our favorite games of all time (007: Nightfire) for a long time now. However, remaking a game likes this is really complicated because of the rights to the Bond-franchise. That site was created months ago, and by doing so we have found some great people (modelers, level designers, etc.) that want to help, but our plans have changed a little bit. Our current plan is to create a multiplayer-only remake of the original game, removing all the Bond-references so that the rights shouldn't be a problem anymore. We still want to create the game using the UDK and SteamWorks for both PC and Mac. Currently there's 3 things I need to find out: The costs of creating an arcade shooter like this. We want to use crowdfunding to fund the project. The best way to manage a project like this over the internet. Our current team consists of people all over the world, and we need a central place to discuss, collaborate and store our files. The best place to find suitable people for this project. We already have some modelers and level designers but we also need animators, artists, programmers, etc. I believe creating an arcade game like this with a small team is feasible. The game in a nutshell: ±10 maps, ±20 weapons, ±12 game modes, weapon/armor pickups, grapple hook gadget, no ADS, uses SteamWorks, online matchmaking, custom games, AI bots, appearance selection, level progression using XP (no unlocks), achievements. Does anyone know where to start? Any help is appreciated.

    Read the article

  • Texturize a shape of multiple triangles in 2D

    - by Deukalion
    This is an example of a shape consisting of multiple points, triangles and eventually a shape: Red Dots = Vector3 (X, Y, Z) or Vector2 (X, Y) If I have a Texture of a certain size, how do I texturize this area in the best way so that the texture inside the shape matches the shape and does not overlap anywhere? Perhaps also with a chance to scale the texture in case it's too small or to big for the shape, but still so that it gets rendered correctly. Do I treat the shape as a rectangle? Figure out it's 4 corners? Or do I calculate the distance between Center - (Texture Width / 2) and Point (to see how "many" times the texture can fit between on that axis to estimate at what Coordinates the Texture should be at that certain point? I've looked at Texture Mapping but haven't found any concrete examples that it explains it well, it's also confusing with 0.0-1.0 values for Texture Coordinates.

    Read the article

  • Grpahic hardwares

    - by Vanangamudi
    Which vendor provides better GPGPU. my requirements are confined to rendering utilising the GPU for BSDF building for e.g. Intel started providing Ivy Bridge chipset GPU, which are comparably fast to HD5960 cards. I'm not that against nvidia or amd. but I'm a fan of Intel. how it compares to nvidia in price and performance. if possible may I know, how all of them perform with OpenCL?? I'm not sure if it is right to ask it here. but I don't know where to ask.

    Read the article

  • Typical collision detection

    - by marcg11
    I would like to know how is the typical collision detection of most games. For example, you control a character which can move in 2 dimensional directions (except up and down). Now lets asume he walks into a wall, most of the games depending on character angle and the BB normal face will only stop the player in one axis, but will continue moving in the other along the wall axis. How is that done? I've only managed to stop the character from going through the wall by seting the position to the last one in the past frame if the new position colllisions the bounding box. But this just makes the player stop sharply and unrealisticly.

    Read the article

  • Where are some good resources to learn Game Development with OpenGL ES 2.X

    - by Mahbubur R Aaman
    Background: From http://www.khronos.org/opengles/2_X/ OpenGL ES 2.0 combines a version of the OpenGL Shading Language for programming vertex and fragment shaders that has been adapted for embedded platforms, together with a streamlined API from OpenGL ES 1.1 that has removed any fixed functionality that can be easily replaced by shader programs, to minimize the cost and power consumption of advanced programmable graphics subsystems. Related Resources The OpenGL ES 2.0 specification, header files, and optional extension specifications The OpenGL ES 2.0 Online Manual Pages The OpenGL ES 3.0 Shading LanguageOnline Reference Pages The OpenGL ES 2.0 Quick Reference Card OpenGL ES 1.X OpenGL ES 2.0 From http://www.cocos2d-iphone.org/archives/2003 Cocos2d Version 2 released and one of primary key point noted as OpenGL ES 2.0 support From http://www.h-online.com/open/news/item/Compiz-now-supports-OpenGL-ES-2-0-1674605.html Compiz now supports OpenGL ES 2.0 My Question : Being as a Game Developer ( I have to work with several game engine Cocos2d, Unity). I need several resources to cope up with OpenGL ES 2.X for better outcome while developing games?

    Read the article

  • Separate update and render

    - by NSAddict
    I'm programming a simple Snake in Java. I'm a complete newbie when it comes to Java and Game Developing, so please bear with me ;) Until now, I have been using a UI thread, as well as a update-thread. The update thread just set the position, set the GameObjects, and so on. I didn't think much of concurrency, but now I've come to a problem. I wanted to modify the ArrayList<GameObject>, but it throws a java.util.ConcurrentModificationException. With a little research I found out that this happens because the two threads are trying to access the variables at the same time. But I didn't really find a way to prevent this. I thought about copying the array and swapping them out when the rendering is finished, but I would have to deep-copy them, which isn't really the best solution in my opinion. It probably eats up more CPU resources than a single-threaded game. Are there any other ways to prevent this? Thanks a lot for your help!

    Read the article

  • Adding new events to be handled by script part without recompilation of c++ source code

    - by paul424
    As in title I want to write an Event system with handling methods written in external script language, that is Angelscript. The AS methods would have acess to game's world modifing API ( which has to be regsitered for Angelscript Machine as the game starts) . I have come to this problem : if we use the Angelsript for rapid prototyping of the game's world behavior , we would like to be able to define new Event Types, without recompiling the main binary. Is that ever possible , don't stick to Angelscript, I think about any possible scripting language. The main thought is this : If there's some really new Event possible to be constructed , we must monitor some information coming from the binary, for example some variable value changing and the Events are just triggered on some conditions on those changes , wer might be monitoring the Creatures HP, by having a function call on each change, there we could define new Events such as Creature hurt, creature killed, creature healed , creature killed and tormented to pieces ( like geting HP very much below 0 ) . Are there any other ideas of constructing new Events at the scripting side ?

    Read the article

  • What causes the iOS OpenGLES driver to allocate extra memory?

    - by Martin Linklater
    I'm trying to optimize the memory usage of our iOS game and I'm puzzled about when/why the iOS GLES driver allocates extra memory at runtime... When I run our game through Instruments with the OpenGL ES Driver instrument the gartUsedBytes value can fluctuate quite wildly. We preload all our textures and build the buffer objects up front, so it's not the game engine requesting extra memory from GL. Currently we are manually requesting around 50MB of GL memory, yet the gartUsedBytes value sits at around 90MB most of the time, peaking at 125MB from time to time. It seems to be linked to what you are rendering that frame - our PVS only submits VBO's for visible meshes. Can anyone shed some light on what the driver is doing in the background ? Like I said earlier, all our game engine allocations are done on level load, so in theory there shouldn't be any fluctuation on GL memory usage while the level is running. Thanks.

    Read the article

  • How can I generate a view or projection matrix for OpenGL 3.+

    - by Ken
    I'm transitioning from OpenGL 2 to OpenGL 3.+ and to GLSL 1.5. I'm trying to avoid using the deprecated features. My question how do we now generate the view or projection matrix. I was using the matrix stack to calculate the projection matrix for me; GLfloat ptr[16]; gluPerspective(...); glGetFloatv(GL_MODELVIEW_MATRIX, ptr); //then pass ptr via a uniform to the shader But obviously the matrix stack is deprecated. So this approach is not the best an option going forward. I have the 'Red Book', 7th ed, which covers 3.0 & 3.1 and it still uses the deprecated matrix functions in it's examples. I could write some utility-code myself to generate the matrices. But I don't want to re-invent this particular wheel, especially when this functionality is required for every 3D graphics program. What is the accepted way to generate world,view & projection matrices for OpenGL? Is there an emerging 'standard' library for this? Or is there some other hidden (to me) functionality in OpenGL/GLSL which I have overlooked?

    Read the article

  • Opening an XML in Unity3D when the game is built

    - by N0xus
    At the moment, my game can open up an XML file inside the editor when I run it. In my XMLReader.cs I'm loading in my file like so: _xmlDocument.Load(Application.dataPath + "\\HV_Settings\\Settings.xml"); This class also deals with what the XML should do once it has been read in. However, when I build the game and run the exe, this file isn't called. I know that I can store this file in the C drive, but I want to keep everything in one place so when I start to release what I'm working on, the user doesn't need to do anything. Am I doing something silly which is causing the XML not to be read?

    Read the article

  • Is OpenTK Dead?

    - by ashes999
    Looking at OpenTK, I notice some disturbing signs: The last news item was posted on December 31st, 2010 The main forum gets about one post a day On SourceForge, the last nightly build was in March, and the last release was 2010. Does OpenTK exist anymore, or is it abandonware now? Edit: Some people have expressed concern at my use of "ambiguous" and "loaded terms" like "dead," "abandonware," and others. What I'm asking is this: software projects comprise of many pieces: The actual software project (such as OpenTK) A group of people who maintain the software (project leads, core developers) Some vehicle by which users can find and consume the latest versions (such as releasing daily builds) A community (can I ask questions about it? Get answers?) Updates (are there new features? New releases? Active development? A roadmap?) Some projects have all of these things. Most have a few. Some have nothing, other than maybe the actual software project itself. Is OpenTK one of these? Because it seems like: The actual software project is stable The maintainers don't contribute to it anymore There are no more latest versions (daily builds), not since 2010 (2+ years) The community is very low-traffic (nobody is asking/answering questions, who is actually using this anyway?) There are no updates since 2010

    Read the article

  • What technology(s)would be suitable for the front end part of a Java web game?

    - by James.Elsey
    As asked in a previous question, I'm looking to create a small MMO that will be deployed onto GAE. I'm confused about what technologies I could use for the user interface, I've considered the following JSP Pages - I've got experience with JSP/JSTL and I would find this easy to work with, it would require the user having to "submit" the page each time they perform an action so may become a little clumsey for players. Applet - I could create an applet that sits on the front end and communicates to the back end game engine, however I'm not sure how good this method would be and have not used applets since university.. What other options do I have? I don't have any experience in Flash/Flex so there would be a big learning curve there. Are there any other Java based options I may be able to use? My game will be text based, I may use some images, but I'm not intending to have any animations/graphics etc Thanks

    Read the article

  • Android NDK Gaussian Blur radius stuck at 60

    - by rennoDeniro
    I implemented this NDK imeplementation of a Gaussian Blur, But I am having problems. I cannot increase the radius above 60, otherwise the activity just closes returning to a previous activity. No error message, nothing? Does anyone know why this could be? Note: This blur is based on the quasimondo implementation, here #include <jni.h> #include <string.h> #include <math.h> #include <stdio.h> #include <android/log.h> #include <android/bitmap.h> #define LOG_TAG "libbitmaputils" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) typedef struct { uint8_t red; uint8_t green; uint8_t blue; uint8_t alpha; } rgba; JNIEXPORT void JNICALL Java_com_insert_your_package_ClassName_functionToBlur(JNIEnv* env, jobject obj, jobject bitmapIn, jobject bitmapOut, jint radius) { LOGI("Blurring bitmap..."); // Properties AndroidBitmapInfo infoIn; void* pixelsIn; AndroidBitmapInfo infoOut; void* pixelsOut; int ret; // Get image info if ((ret = AndroidBitmap_getInfo(env, bitmapIn, &infoIn)) < 0 || (ret = AndroidBitmap_getInfo(env, bitmapOut, &infoOut)) < 0) { LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret); return; } // Check image if (infoIn.format != ANDROID_BITMAP_FORMAT_RGBA_8888 || infoOut.format != ANDROID_BITMAP_FORMAT_RGBA_8888) { LOGE("Bitmap format is not RGBA_8888!"); LOGE("==> %d %d", infoIn.format, infoOut.format); return; } // Lock all images if ((ret = AndroidBitmap_lockPixels(env, bitmapIn, &pixelsIn)) < 0 || (ret = AndroidBitmap_lockPixels(env, bitmapOut, &pixelsOut)) < 0) { LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret); } int h = infoIn.height; int w = infoIn.width; LOGI("Image size is: %i %i", w, h); rgba* input = (rgba*) pixelsIn; rgba* output = (rgba*) pixelsOut; int wm = w - 1; int hm = h - 1; int wh = w * h; int whMax = max(w, h); int div = radius + radius + 1; int r[wh]; int g[wh]; int b[wh]; int rsum, gsum, bsum, x, y, i, yp, yi, yw; rgba p; int vmin[whMax]; int divsum = (div + 1) >> 1; divsum *= divsum; int dv[256 * divsum]; for (i = 0; i < 256 * divsum; i++) { dv[i] = (i / divsum); } yw = yi = 0; int stack[div][3]; int stackpointer; int stackstart; int rbs; int ir; int ip; int r1 = radius + 1; int routsum, goutsum, boutsum; int rinsum, ginsum, binsum; for (y = 0; y < h; y++) { rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0; for (i = -radius; i <= radius; i++) { p = input[yi + min(wm, max(i, 0))]; ir = i + radius; // same as sir stack[ir][0] = p.red; stack[ir][1] = p.green; stack[ir][2] = p.blue; rbs = r1 - abs(i); rsum += stack[ir][0] * rbs; gsum += stack[ir][1] * rbs; bsum += stack[ir][2] * rbs; if (i > 0) { rinsum += stack[ir][0]; ginsum += stack[ir][1]; binsum += stack[ir][2]; } else { routsum += stack[ir][0]; goutsum += stack[ir][1]; boutsum += stack[ir][2]; } } stackpointer = radius; for (x = 0; x < w; x++) { r[yi] = dv[rsum]; g[yi] = dv[gsum]; b[yi] = dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; stackstart = stackpointer - radius + div; ir = stackstart % div; // same as sir routsum -= stack[ir][0]; goutsum -= stack[ir][1]; boutsum -= stack[ir][2]; if (y == 0) { vmin[x] = min(x + radius + 1, wm); } p = input[yw + vmin[x]]; stack[ir][0] = p.red; stack[ir][1] = p.green; stack[ir][2] = p.blue; rinsum += stack[ir][0]; ginsum += stack[ir][1]; binsum += stack[ir][2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; ir = (stackpointer) % div; // same as sir routsum += stack[ir][0]; goutsum += stack[ir][1]; boutsum += stack[ir][2]; rinsum -= stack[ir][0]; ginsum -= stack[ir][1]; binsum -= stack[ir][2]; yi++; } yw += w; } for (x = 0; x < w; x++) { rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0; yp = -radius * w; for (i = -radius; i <= radius; i++) { yi = max(0, yp) + x; ir = i + radius; // same as sir stack[ir][0] = r[yi]; stack[ir][1] = g[yi]; stack[ir][2] = b[yi]; rbs = r1 - abs(i); rsum += r[yi] * rbs; gsum += g[yi] * rbs; bsum += b[yi] * rbs; if (i > 0) { rinsum += stack[ir][0]; ginsum += stack[ir][1]; binsum += stack[ir][2]; } else { routsum += stack[ir][0]; goutsum += stack[ir][1]; boutsum += stack[ir][2]; } if (i < hm) { yp += w; } } yi = x; stackpointer = radius; for (y = 0; y < h; y++) { output[yi].red = dv[rsum]; output[yi].green = dv[gsum]; output[yi].blue = dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; stackstart = stackpointer - radius + div; ir = stackstart % div; // same as sir routsum -= stack[ir][0]; goutsum -= stack[ir][1]; boutsum -= stack[ir][2]; if (x == 0) vmin[y] = min(y + r1, hm) * w; ip = x + vmin[y]; stack[ir][0] = r[ip]; stack[ir][1] = g[ip]; stack[ir][2] = b[ip]; rinsum += stack[ir][0]; ginsum += stack[ir][1]; binsum += stack[ir][2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; ir = stackpointer; // same as sir routsum += stack[ir][0]; goutsum += stack[ir][1]; boutsum += stack[ir][2]; rinsum -= stack[ir][0]; ginsum -= stack[ir][1]; binsum -= stack[ir][2]; yi += w; } } // Unlocks everything AndroidBitmap_unlockPixels(env, bitmapIn); AndroidBitmap_unlockPixels(env, bitmapOut); LOGI ("Bitmap blurred."); } int min(int a, int b) { return a > b ? b : a; } int max(int a, int b) { return a > b ? a : b; }

    Read the article

  • exim redirect mail to a script

    - by DevilWAH
    I am looking to set up a mail relay so that any mail sent to for example @example.com gets parsed be a PHP script. I know to do this for indervidual address I could do some thing like (from the following web site http://evolt.org/incoming_mail_and_php) Con figure an Aliases such as script: |/our/script.php then any emails sent to [email protected] will be passed to the script given.. but how can I make it that every email to @example.com is passed to the script? thank you

    Read the article

  • Using IAM for user authentication

    - by mdavis6890
    I've read lots and lots of posts that touch on what I think should be a very common use case - but without finding exactly what I want, or a simple reason why it can't be done. I have some files on S3. I want to be able to grant certain users access to certain files, via a front end that I build. So far, I've made it work this way: I built the front end in Django, using it's built-in Users and Groups I have a model for Buckets, in which I mirror my S3 buckets. I have a m2m relationship from groups to buckets representing the S3 permissions. The user logs in and authenticates against Django's users. I grab from Django the list of buckets that the user is allowed to see I use boto to grab a list of links to files from those buckets and display to user. This works, but isn't ideal, and also just doesn't feel right. I've got to keep a mirror of the buckets, and I also have to maintain my own list of user/passwords and permissions, when AWS already has all that built in. What I really want is to simply create the users in IAM and use group permissions in IAM to control access to the S3 buckets. No duplication of data or function. My app would request a UN/PW from the user and use that to connect to IAM/S3 to pull the list of buckets and files, then display links to the user. Simple. How can I, or why can't I? Am I looking at this the wrong way? What's the "right" way to address this (I assume) very common use case?

    Read the article

  • NoSuchMethodError in Java using XStream

    - by Brad Germain
    I'm trying to save a database into a file using XStream and then open it again later using XStream and deserialize it back into the objects it was in previously. The database consists of an arraylist of tables, which consists of an arraylist of a data class where the data class contains an arraylist of objects. I'm basically trying to create an sql compiler. I'm currently getting a java.lang.NoSuchMethodError because of the last line in the load method. Here's what I have: Save Method public void save(Database DB){ File file = new File(DB.getName().toUpperCase() + ".xml"); //Test sample DB.createTable("TBL1(character(a));"); DB.tables.getTable("TBL1").rows.add(new DataList()); DB.tables.getTable("TBL1").rows.getRow(0).add(10); XStream xstream = new XStream(); //Database xstream.alias("Database", Database.class); //Tables xstream.alias("Table", Table.class); //Rows xstream.alias("Row", DataList.class); //Data //xstream.alias("Data", Object.class); //String xml = xstream.toXML(DB); Writer writer = null; try { writer = new FileWriter(file); writer.write(xstream.toXML(DB)); writer.close(); } catch (IOException e) { e.printStackTrace(); } } Load Method public void Load(String dbName){ XStream xstream = new XStream(); BufferedReader br; StringBuffer buff = null; try { br = new BufferedReader(new FileReader(dbName + ".xml")); buff = new StringBuffer(); String line; while((line = br.readLine()) != null){ buff.append(line); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } database = (Database)xstream.fromXML(buff.toString()); }

    Read the article

  • Skeleton framework - css list spacing

    - by user1745014
    I'm trying to float my navigation at the top much more to left around 200px atleast more towards the end of the line that can been seen below. Everytime I apply a margin or padding it pushes the navigation to go under each other even though there is loads of room, could anyone take a look at my code. means alot thanks, I always find things easier with firebug so I uploaded it here http://xronn.co.uk/hosting/ Thanks again!

    Read the article

  • Completing install of ruby 1.9.3 with Ruby for for Mac OS X 10.7.5 Leopard, Xcode 4.5.2 -- problems with rvm pkg install openssl

    - by user1848361
    First, many thanks in advance for any help. I'm a complete novice with programming and I'm trying to get started with this Ruby on Rails tutorial (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2) I have been trying figure this out for about 7 hours now and since I don't have any hair left to pull out I'm turning to these hallowed pages. I have searched for solutions here again and again. System: Mac OS X 10.7.5 Leopard, Xcode 4.5.2 I installed homebrew and have updated it multiple times I used homebrew to install rvm and have updated it multiple times I installed git The standard ruby on the system (checking with $ ruby -v) is 1.8.7 My problem is that every time I try to use rvm to install a new version of Ruby ($ rvm install 1.9.3) I get the following error: Ruby (and needed base gems) for your selection will be installed shortly. Before it happens, please read and execute the instructions below. Please use a separate terminal to execute any additional commands. Notes for Mac OS X 10.7.5, Xcode 4.5.2. For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" For IronRuby: Install Mono >= 2.6 For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' For Opal: Install Nodejs with NPM. See http://nodejs.org/download/ To use an RVM installed Ruby as default, instead of the system ruby: rvm install 1.8.7 # installs patch 357: closest supported version rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems rvm alias create default 1.8.7 And reopen your terminal windows. Xcode and gcc: : I have performed $ brew install libksba and when I try to do it again it tells me that libksba is installed already. When I type "$ rvm requirements" I get: Notes for Mac OS X 10.7.5, Xcode 4.5.2. For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26" For IronRuby: Install Mono >= 2.6 For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba' For Opal: Install Nodejs with NPM. See http://nodejs.org/download/ To use an RVM installed Ruby as default, instead of the system ruby: rvm install 1.8.7 # installs patch 357: closest supported version rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems rvm alias create default 1.8.7 And reopen your terminal windows. Xcode and gcc: Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2. Xcode 4.1 and earlier: - Ruby will build fine. Xcode 4.2 and later (including Command Line Tools for Xcode): - If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine. - If you don't have gcc-4.2, you have two options to get it: * Install apple-gcc42 from Homebrew * Install osx-gcc-installer Homebrew: If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes: brew update brew tap homebrew/dupes brew install autoconf automake apple-gcc42 rvm pkg install openssl Xcode 4.2+ install or/and Command Line Tools for Xcode is required to provide make and other tools. osx-gcc-installer: If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer. Warning: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire. ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer. So I assume I have to do something with brew update brew tap homebrew/dupes brew install autoconf automake apple-gcc42 rvm pkg install openssl Everything seemed to work fine until "$ rvm pkg install openssl", which returns: Fetching openssl-1.0.1c.tar.gz to /Users/thierinvestmentservices/.rvm/archives Extracting openssl to /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c Configuring openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. Compiling openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. Error running 'make', please read /Users/thierinvestmentservices/.rvm/log/openssl/make.log Please note that it's required to reinstall all rubies: rvm reinstall all --force Updating openssl certificates Error running 'update_openssl_certs', please read /Users/thierinvestmentservices/.rvm/log/openssl.certs.log Johns-MacBook-Pro:~ thierinvestmentservices$ rvm pkg install openssl Fetching openssl-1.0.1c.tar.gz to /Users/thierinvestmentservices/.rvm/archives Extracting openssl to /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c Configuring openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. Compiling openssl in /Users/thierinvestmentservices/.rvm/src/openssl-1.0.1c. Error running 'make', please read /Users/thierinvestmentservices/.rvm/log/openssl/make.log Please note that it's required to reinstall all rubies: rvm reinstall all --force Updating openssl certificates Error running 'update_openssl_certs', please read /Users/thierinvestmentservices/.rvm/log/openssl.certs.log make.log reads "[2012-11-23 13:15:28] make /Users/thierinvestmentservices/.rvm/scripts/functions/utility: line 116: make: command not found" and openssl.certs.log reads "[2012-11-23 14:04:04] update_openssl_certs update_openssl_certs () { ( chpwd_functions="" builtin cd $rvm_usr_path/ssl && command curl -O http://curl.haxx.se/ca/cacert.pem && mv cacert.pem cert.pem ) } current path: /Users/thierinvestmentservices command(1): update_openssl_certs /Users/thierinvestmentservices/.rvm/scripts/functions/pkg: line 205: cd: /Users/thierinvestmentservices/.rvm/usr/ssl: No such file or directory" At this point the letters might as well be wingdings I have no idea what is going on. I have tried to install rvm make with something I saw on one forum post but I got a bunch of warnings. If anyone has any suggestions I would be deeply grateful, I am completely in over my head,

    Read the article

  • Ambiguous Evaluation of Lambda Expression on Array

    - by Joe
    I would like to use a lambda that adds one to x if x is equal to zero. I have tried the following expressions: t = map(lambda x: x+1 if x==0 else x, numpy.array) t = map(lambda x: x==0 and x+1 or x, numpy.array) t = numpy.apply_along_axis(lambda x: x+1 if x==0 else x, 0, numpy.array) Each of these expressions returns the following error: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() My understanding of map() and numpy.apply_along_axis() was that it would take some function and apply it to each value of an array. From the error it seems that the the lambda is being evaluated as x=array, not some value in array. What am I doing wrong? I know that I could write a function to accomplish this but I want to become more familiar with the functional programming aspects of python.

    Read the article

  • bandwidth throttling C linux

    - by bob moch
    hi im currently creating a function to create a sleep time i can pause between packets for my port scanner im creating for personal/educational use for my home network. what im currently doing is opening /proc/net/dev and reading the 9th set of digits for the eth0 interface to find out the current packets being set and then reading it again and doing some math to figure out a delay to sleep between sending a packet to a port to identify it and fingerprint it. my problem is that no matter what throttle % i use it always seems to send the same rate of packets. i think its mainly my way of mathematically creating my sleep delay. edit:: dont mind the function declaration and the struct stuff all im doing is spawning this function in a thread and passing a pointer to a struct to the function, recreating the struct locally and then freeing the passed structs memory. void *bandwidthmonitor_cmd(void *param) { char cmdline[1024], *bytedata[19]; int i = 0, ii = 0; long long prevbytes = 0, currentbytes = 0, elapsedbytes = 0, byteusage = 0, maxthrottle = 0; command_struct bandwidth = *((command_struct *)param); free(param); //printf("speed: %d\n throttle: %d\n\n", UPLOAD_SPEED, bandwidth.throttle); maxthrottle = UPLOAD_SPEED * bandwidth.throttle / 100; //printf("max throttle:%lld\n", maxthrottle); FILE *f = fopen("/proc/net/dev", "r"); if(f != NULL) { while(1) { while(fgets(cmdline, sizeof(cmdline), f) != NULL) { cmdline[strlen(cmdline)] = '\0'; if(strncmp(cmdline, " eth0", 6) == 0) { bytedata[0] = strtok(cmdline, " "); while(bytedata[i] != NULL) { i++; bytedata[i] = strtok(NULL, " "); } bytedata[i + 1] = '\0'; currentbytes = atoi(bytedata[9]); } } i = 0; rewind(f); elapsedbytes = currentbytes - prevbytes; prevbytes = currentbytes; byteusage = 8 * (elapsedbytes / 1024); //printf("usage:%lld\n",byteusage); if(ii & 0x40) { SLEEP += (maxthrottle - byteusage) * -1.1;//-2.5; if(SLEEP < 0){ SLEEP = 0; } //printf("sleep:%d\n", SLEEP); } usleep(25000); ii++; } } return NULL; } SLEEP and UPLOAD_SPEED are global variables and UPLOAD_SPEED is in kb/s and generated via a speedtest function that gets the upload speed of my computer. this function is running inside a POSIX thread updating SLEEP which my threads doing the socket work grab to sleep by after every packet. as testing instead of only doing the ports i want to check i make it do all the ports over and over again so i can run dstat on a machine to check bandwidth and no matter what bandwidth.throttle is set to it always seems to generate the same amount of bandwidth to the dstat machine. the way i calculate how much i "should" throttle by is by finding the maximum throttle speed which is defined as maxthrottle = upload_speed * throttle / 100; for example if my upload speed was 1000kb/s and my throttle was 90 (90%) my max throttle would be 900kb/s from there it would find the current bytes sent from /proc/net/dev and then find my sleep time via incrementing or decrementing it via sleep += (maxthrottle - bytesysed) * -1.1; this should in theory increase or decrease the sleep time based on how many bytes used there are. the if(ii & 0x40) statement is just for some moderation control. it makes it so it only sets sleep to a new time every 30-40 iterations. final notes: the main problem is that the sleep timer does not seem to modify the speed of packets being set. or maybe its just my implementation because on a freshly restarted machine where /proc/net/dev has low numbers of bytes sent it seems to raise the sleep timer accordingly on my 60kb/s upload machine (ex if i set the throttle to 2 it will incline the sleep timer until network bandwidth out reaches the max bandwidth threshold, but when i try running it on a server which as been online forever it doesnt seem to work as nicely if at all. if anyone can suggest a new method of monitoring the network to adjust a sleep delay then let me know or if anyone sees a flaw in my code. thank you.

    Read the article

  • Which other event handler than click could i use?

    - by Gaelle
    I have a jQuery question, and I really think it is a silly one : i'm a beginner in JS and jQuery... I'm using $("#myLink").click(function(){ $(".myClassToShow").show(); $(".myClassToHide").hide(); }); to hide elements with class myClassToHide as a class attribute and show elements with class myClassToShow as a class attribute. I think this is really easy to understand :) I didn't think it would hide every elements with the good class, but, well, it works. My worry here is that my elements show and hide only for few seconds : the time my mouse click on the link. I would like to make myClassToShow elements remaining on the screen, when i already clicked my link, and myClassToHide elements really hide. For example, on the johann Hammarstrom's website, when you click on "Print", all his works which are not print gone hide, and only the printing one remain. That's kinda what i want. I searched using Firebug, but couldn't find which kind of event he used. I know a onchange is not the correct answer, so what? Could you help me please?

    Read the article

  • Element not found blocks execution in Selenium

    - by Mariano
    In my test, I try to verify if certain text exists (after an action) using find_element_by_xpath. If I use the right expression and my test pass, the routine ends correctly in no time. However if I try a wrong text (meaning that the test will fail) it hangs forever and I have to kill the script otherwise it does not end. Here is my test (the expression Thx user, client or password you entered is incorrect does not exist in the system, no matter what the user does): # -*- coding: utf-8 -*- import gettext import unittest from selenium import webdriver class TestWrongLogin(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://10.23.1.104:8888/") # let's check the language try: self.lang = self.driver.execute_script("return navigator.language;") self.lang = self.lang("-")[0] except: self.lang = "en" language = gettext.translation('app', '/app/locale', [self.lang], fallback=True) language.install() self._ = gettext.gettext def tearDown(self): self.driver.quit() def test_wrong_client(self): # test wrong client inputElement = self.driver.find_element_by_name("login") inputElement.send_keys("root") inputElement = self.driver.find_element_by_name("client") inputElement.send_keys("Unleash") inputElement = self.driver.find_element_by_name("password") inputElement.send_keys("qwerty") self.driver.find_element_by_name("form.submitted").click() # wait for the db answer self.driver.implicitly_wait(10) ret = self.driver.find_element_by_xpath( "//*[contains(.,'{0}')]".\ format(self._(u"Thx user, client or password you entered is incorrect"))) self.assertTrue(isinstance(ret, webdriver.remote.webelement.WebElement)) if __name__ == '__main__': unittest.main() Why does it do that and how can I prevent it?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >