Daily Archives

Articles indexed Wednesday November 6 2013

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

  • Is there a way to setup Clicktale tag in Google Tag Manager?

    - by Cubius
    Since GTM doesn't support document.write() method the standard clicktale code doesn't work. Is there a workaround for this? ClickTale employee has sent me these instructions: Replace the document.write JS line above with the following: document.body.appendChild(externalScript); Example: <!-- ClickTale Bottom part --> <script type='text/javascript'> var externalScript = document.createElement('script'); var scrSrc = document.location.protocol=='https:'? 'https://clicktalecdn.sslcs.cdngc.net/': 'http://cdn.clicktale.net/'; scrSrc += 'www11/ptc/xxx-xxx-xxx-xxx.js'; externalScript.src = scrSrc; externalScript.type = 'text/javascript'; document.body.appendChild(externalScript); </script> <!-- ClickTale end of Bottom part --> I am not sure what to do with this. Has someone tried something like this?

    Read the article

  • Wordpress Multisite- How to restrict a non-wordpress page only to one domain

    - by yibe
    I am running three blogs from a wordpress multisite. Currently, I am developing a separate, non wordpress application. I want to link this application with blog1. I put the application in the subfoler of my root directory (The Wordpress multisite is installed in the root). I linked the application in the menu of blog1. So far so good. But, it is possible to access the application from all the three blogs. I want the application to be accessible only from blog1-domain/my-app/ but when I tried blog2-domain/my-app, it just opened normally. Generally, the application is accessible from all the three domains followed by /my-app. I don't think it is proper to go this way. Then, what can I do to restrict my app to be accessible only from a my blog1-domain/my-app ? Or am I not using a good blog structure?. I am open to all kind of suggestions. Thank you for your help.

    Read the article

  • WP E Commerce Safe Mode restriction error [on hold]

    - by Mustafa Kamal
    I have my online shop, created with WP Ecommerce getting broken after I moved it to another server. I could be sure that the problem comes from WP Ecommerce because when I disable that plugin. Everything run as expected. This is the exact error message Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 515 is not allowed to access /tmp owned by uid 0 in /home/mikalu/public_html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 17 Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/mikalu/public_html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 17 I've tried to turn off safe mode on my php configuration. nothing happens. the error's still there. I thought it was some kind of permission issue, so I tried to change /tmp permission to 777. Nothing happens. I googled it some more and suspect it might have something to do with fastCGI configuration and stuff. Which I totally don't understand. My googling result mostly suggest me to consult the web hosting provider or even to move to another host. But in this case, I am the owner of the server (VPS with cPanel/WHM). And I don't have any idea how to solve this kind of problem.

    Read the article

  • chmod 700 and htaccess deny from all enough?

    - by John Jenkins
    I would like to protect a public directory from public view. None of the files will ever be viewed online. I chmoded the directory to 700 and created an htaccess file that has "deny from all" inside it. Is this enough security or can a hacker still gain access to the files? I know some people will say that hackers can get into anything, but I just want to make sure that there isn't anything else I can do to make it harder to hack. Reply: I am asking if chmod 700 and deny from all is enough security alone to prevent hackers from getting my files. Thanks.

    Read the article

  • How do I get information about the level to the player object?

    - by pangaea
    I have a design problem with my Player and Level class in my game. So below is a picture of the game. The problem is I don't want to move on the black space and only the white space. I know how to do this as all I need to do is get the check for the sf::Color::Black and I have methods to do this in the Level class. The problem is this piece of code void Game::input() { player.input(); } void Game::update() { (*level).update(); player.update(); } void Game::render() { (*level).render(); player.render(); } So as you there is a problem in that how do I get the map information from the Level class to the Player class. Now I was thinking if I made the Player position static and pass it into the Level as parameter in update I could do it. The problem is interaction. I don't know what to do. I could maybe make player go into the Level class. However, what if I want multiple levels? So I have big design problems that I'm trying to solve.

    Read the article

  • Aw, Snap! in Google Chrome [on hold]

    - by D. S. Schneider
    Just wondering if anyone else's experiencing the "Aw, Snap!" bug in Google Chrome. I'm developing a brand new engine which occasionaly triggers this bug and as far as I know, there's nothing one can do to find out what actually triggered the issue. I've also tested my engine with Firefox, which runs just fine. Anyway, just wanted to know if someone else is facing this while developing games for Google Chrome and has a clue about what can be done to avoid it. I'm using plain JavaScript and the audio and canvas elements from HTML5. Thanks!

    Read the article

  • Water Simulation in LIBGDX [on hold]

    - by Noah Huppert
    I am doing some R&D for a game and am now tackling the topic of water. The goal Make water that can flow. Aka you can have an origin point that water shoots out from or a downhill slope. Make it so water splashes, so when an object hits the water there is a splash. Aka: Actual physics water sim. The current way I know how to do it I know how to create a shader that makes an object look like its water by making waves. Combined with that you can check to see if an object is colliding and apply an upwards force to simulate buoyancy. What is wrong with that way The water does not flow No splashes Possible solutions Have particles that are fairly large that interact with each other to simulate water Possible drawbacks Performance. Question: Is there a better way to do water or is using particles as described the only way?

    Read the article

  • Behaviour Trees with irregular updates

    - by Robominister
    I'm interested in behaviour trees that aren't iterated every game tick, but every so often. (Edit: the tree could specify how many frames within the main game loop to wait before running its tick function again). Every theoretical implementation I have seen of behaviour trees talks of the tree search being carried out every game update - which seems necessary, because a leaf node (eg a behaviour, like 'return to base') needs to be constantly checked to see if is still running, failed or completed. Can anyone suggest how I might start implementing a tree that isnt run every tick, or point me in the direction of good material specific to this case (I am struggling to find anything)? My thoughts so far: action leaf nodes (when they start) must only push some kind of action object onto a list for an entity, rather than directly calling any code that makes the entity do something. The list of actions for the entity would be run every frame (update any that need to run, pop any that have completed from the list). the return state from a given action must be fed back into the tree, so that when we run the tree iteration again (and reach the same action leaf node - so the tree has so far determined that we ought to still be trying this action) - that the action has completed, or is still running etc. If my actual action code is running from an action list on an entity, then I possibly need to cancel previously running actions in the list - i am thinking that I can just delete the entire stack of queued up actions. I've seen the idea of ActionLists which block lower priority actions when a higher priority one is added, but this seems like very close logic to behaviour trees, and I dont want to be duplicating behaviour. This leaves me with some questions 1) How would I feed the action return state back into the tree? Its obvious I need to store some information relating to 'currently executing actions' on the entity, and check that in the tree tick, but I can't imagine how. 2) Does having a seperate behaviour tree (for deciding behaviour) and action list (for carrying out actual queued up actions) sound like a reasonable approach? 3) Is the approach of updating a behaviour tree irregularly actually used by anyone? It seems like a nice idea for budgeting ai search time when you have a lot of ai entities to process. (Edit) - I am also thinking about storing a single instance of a given behaviour tree in memory, and providing it by reference to any entity that uses it. So any information about what action was last selected for execution on an entity must be stored in a data context relative to the entity (which the tree can check). (I am probably answering my own questions as i go!) I hope I have expressed my questions adequately! Thanks in advance for any help :)

    Read the article

  • Resolving a collision between point and moving line

    - by Conundrumer
    I am designing a 2d physics engine that uses Verlet integration for moving points (velocities mentioned below can be derived), constraints to represent moving line segments, and continuous collision detection to resolve collisions between moving points and static lines, and collisions between moving/static points and moving lines. I already know how to calculate the Time of Impact for both types of collision events, and how to resolve moving point static line collisions. However, I can't figure out how to resolve moving/static point moving line collisions. Here are the initial conditions in a point and moving line collision event. We have a line segment joined by two points, A and B. At this instant, point P is touching/colliding with line AB. These points have unit mass and some might have an initial velocity, unless point P is static. The line is massless and has no explicit rotational component, since points A and B could freely move around, extending or contracting the line as a result (which will be fixed later by the constraint solver). Collision is inelastic. What are the final velocities of the points after collision?

    Read the article

  • Passing data between engine layers

    - by spaceOwl
    I am building a software system (game engine with networking support ) that is made up of (roughly) these layers: Game Layer Messaging Layer Networking Layer Game related data is passed to the messaging layer (this could be anything that is game specific), where they are to be converted to network specific messages (which are then serialized to byte arrays). I'm looking for a way to be able to convert "game" data into "network" data, such that no strong coupling between these layers will exist. As it looks now, the Messaging layer sits between both layers (game and network) and "knows" both of them (it contains Converter objects that know how to translate between data objects of both layers back and forth). I am not sure this is the best solution. Is there a good design for passing objects between layers? I'd like to learn more about the different options.

    Read the article

  • OpenGL profiling with AMD PerfStudio 2

    - by Aurus
    I'm rendering just a really small amount of polygons for my UI but however I still tried to increase the FPS. In the end I removed redundant calls which increased the FPS. I really don't want to lose FPS for nothing so I keep looking for more improvements. The first thing I noticed is the "huge" time where no calls are made before SwapBuffer (the black one). Well I know that OpenGL works asynchronous so SwapBuffer has to wait until everything is done. But shouldn't PerfStudio mark this time also as black ? Correct me If I am wrong. The second thing I noticed is that some glUniform2f calls just take longer (the brown ones). I mean they should all upload 2floats to the GPU how can the time be so different from call to call. The program isn't even changed or something like that. I also tried to look at other programs like gDebugger or CodeXL but they often crashed and they show less statistics (only # of calls or redundant calls etc.) EDIT: I also realized that the draw calls also have different durations, which was obvious for me but sometimes drawing more vertices is faster than drawing less vertices.

    Read the article

  • Best Game Engine/Framework and Language for 2D actor/sprite intensive game

    - by Grungetastic
    I'm new to the game dev world. I have a rather large project in mind (I learn by setting myself challenges :P ) and I'm wondering what the best engine/framework/language is for a 2D game with thousands of sprites/actors on screen at a time. Bare metal type stuff. I need to still be able to zoom in and out with that many actors at once. This game will have no 3D elements. Any thoughts? Suggestions?

    Read the article

  • Prolog check if

    - by NickLee
    I'm creating a text adventure game on SWI-Prolog and I want to include (some kind of) dialogs. What I have so far is: dialog1(1):- nl,write('blah blah'),nl write('a: this is answer a'),nl, write('b: this is answer b'),nl. a:- write('respond to answer a'),nl. b:- write('respond to answer b'),nl. That's pretty much the first dialog. Now I want to create a second dialog similar to the first one. dialog1(2):- nl,write('blah blah'),nl, write('a: this is answer a'),nl, write('b: this is answer b'),nl. a:- write('respond to answer a'),nl. b:- write('respond to answer b'),nl. How can I check if the dialog is the first or the second one? I want to do that because when the user types a., I need the right answer a to be shown. I thought I could use something like a(1):- write('respond to answer a'),nl. b(1):- write('respond to answer b'),nl. /* and on the second dialog*/ a(2):- write('respond to answer a'),nl. b(2):- write('respond to answer b'),nl. But still, if the user is on dialog 2 and he types a(1),the first answer will appear.

    Read the article

  • c++ issues with cin.fail() in my program

    - by Wallace
    I want to use input y to do saving thing,and r to do resuming, but then i write it in the following codes,and then I input y or r,I just to be noticed ""Please enter two positve numbers" this line code "if(x==(int)('y'))"and next line is ignored.how could this happen int main(){ cout<<"It's player_"<<player+1<<"'s turn please input a row and col,to save and exit,input 0,resume game input"<<endl; while(true){ cin>>x; if(x==(int)('y')) {save();has_saved=true;break;} if(x==(int)('r')) {resume();has_resumed=true;break;} cin>>y; if(cin.fail()){ cout<<"Please enter two positve numbers"<<endl; cin.clear(); cin.sync();} else if (x>n||x<1||y<1||y>n) { cout<<"your must input a positive number less or equal than "<<n<<endl; continue;} else if(chessboard[x][y]!=' ') {cout<<"Wrong input please try again!"<<endl; continue;} else { chessboard[x][y]=player_symbol[player+1]; break; } } }

    Read the article

  • sed find pattern on line with another pattern

    - by user2962390
    I am trying to extract text from a file between a '<' and a '', but only on a line starting with another specific pattern. So in a file that looks like: XXX Something here XXX Something more here XXX <\Lines like this are a problem ZZZ something <\This is the text I need XXX Don't need any of this I would like to print only the "<\This is the text I need". If I do sed -n '/^ZZZ/p' FILENAME it pulls the correct lines I need to look at, but obviously prints the whole line. sed -n '/</,//p' FILENAME prints way too much. I have looked into grouping and tried sed -n '/^ZZZ/{/</,//} FILENAME but this doesn't seem to work at all. Any suggestions? They will be much appreciated. (Apologies for formatting, never posted on here before)

    Read the article

  • Is the Angular templateCache shared between apps? Is it persistent?

    - by alexp
    If I have two Angular apps that run on the same domain, will/can they share data in the templateCache? Or is the cache unique to each main application module? In general I'm trying to understand what dictates when a new templateCache is created. Furthermore I'm not clear on whether or in what way the templateCache is persistent? Looking in local storage and cookies, I don't see where anything is getting stored.

    Read the article

  • why eventsMatchingPredicate returns nil?

    - by OneZero
    Here's my code: NSString * calID = [[NSUserDefaults standardUserDefaults] objectForKey:@"calendarIdentifier"]; EKCalendar *cal = [eventStore calendarWithIdentifier:calID]; // If calendar exists if(cal) { // Retrieve all existing events until today NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:[NSDate distantPast] endDate:[NSDate date] calendars:@[cal]]; self.events = [eventStore eventsMatchingPredicate:predicate]; if(self.events==nil) NSLog(@"nil events!"); } The calendarItentifier is the variable that I stored when I created the calendar in my program, so it's not the case I'm adding events on the wrong calendar. However, the code does not work to retrieve past events on the calendar, it simply returns nil to self.events. But I DID add events on the calendar. Can anything tell me if there's anything wrong with the code?

    Read the article

  • Python for statement giving an Invalid Syntax error with list

    - by Cold Diamondz
    I have some code in which is throwing an error (I'm using repl.it) import random students = ['s1:0','s2:0','s3:0'] while True: print'\n'*50 print'Ticket Machine'.center(80) print'-'*80 print'1. Clear Student Ticket Values'.center(80) print'2. Draw Tickets'.center(80) menu = raw_input('-'*80+'\nChoose an Option: ') if menu == '1': print'\n'*50 print'CLEARED!' students = ['s1:0','s2:0','s3:0'] raw_input('Press enter to return to the main menu!') elif menu == '2': tickets = [] print'\n'*50 times = int(raw_input('How many tickets to draw? ') for a in students: for i in range(a.split(':')[1]): tickets.append(a.split(':')[0]) for b in range(1,times+1): print str(b) + '. ' + random.choice(tickets) else: print'\n'*50 print'That was not an option!' raw_input('Press enter to return to the main menu!') But it is throwing this error: File "<stdin>", line 19 for a in students: ^ SyntaxError: invalid syntax I am planning on using this in a class, but I can't use it until the bug is fixed, also, student names have been removed for privacy reasons.

    Read the article

  • Cannot run public class in one .java from another

    - by DIOS
    I have created a basic program that takes whatever is input into two textfields and exports them to a file. I would now like to encrypt that file, and alredy have the encryptor. The problem is that I cannot call it. Here is my code for the encryptor: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.*; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.CipherOutputStream; import javax.crypto.spec.SecretKeySpec; public class FileEncryptor { private String algo; private File file; public FileEncryptor(String algo,String path) { this.algo=algo; //setting algo this.file=new File(path); //settong file } public void encrypt() throws Exception{ //opening streams FileInputStream fis =new FileInputStream(file); file=new File(file.getAbsolutePath()); FileOutputStream fos =new FileOutputStream(file); //generating key byte k[] = "HignDlPs".getBytes(); SecretKeySpec key = new SecretKeySpec(k,algo.split("/")[0]); //creating and initialising cipher and cipher streams Cipher encrypt = Cipher.getInstance(algo); encrypt.init(Cipher.ENCRYPT_MODE, key); CipherOutputStream cout=new CipherOutputStream(fos, encrypt); byte[] buf = new byte[1024]; int read; while((read=fis.read(buf))!=-1) //reading data cout.write(buf,0,read); //writing encrypted data //closing streams fis.close(); cout.flush(); cout.close(); } public static void main (String[] args)throws Exception { new FileEncryptor("DES/ECB/PKCS5Padding","C:\\Users\\*******\\Desktop\\newtext").encrypt();//encrypts the current file. } } Here is the section of my file creator that is failing to call this: FileWriter fWriter = null; BufferedWriter writer = null; try{ fWriter = new FileWriter("C:\\Users\\*******\\Desktop\\newtext"); writer = new BufferedWriter(fWriter); writer.write(Data); writer.close(); f.dispose(); FileEncryptor encr = new FileEncryptor(); //problem lies here. encr.encrypt //public void that does the encryption. new complete(); //different .java that is working fine.

    Read the article

  • HTML: order of divs and a tags for href

    - by user2962389
    I'm busy with HTML and CSS and got stuck with this. I have created a button with :hover and :active options, which is centered on the page. Clicking on this button needs to lead to a website. My HTML is: <div> <a href="website"><div id="button">Text</div></a> </div> The CSS is: body, html { height: 100%; } a { text-decoration: none; } #button { text-transform: uppercase; font-size: 18px; text-align: center; padding: 1em 0.5em 0.8em; background-color: white; font-family: Myriad Pro, Source Sans Pro, Helvetica, Arial, sans-serif; color: #ff4700; cursor: pointer; width: 150px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #ff4700; margin-left: auto; margin-right: auto; margin-bottom: 50px; -webkit-transition: all .1s ease; -moz-transition: all .1s ease; -ms-transition: all .1s ease; -o-transition: all .1s ease; transition: all .1s ease; } #button:hover { background-color: #ff4700; color: white; border: 1px solid white; } #button:active { background-color: #cc3900; } The problem lies in the fact that the whole width of the page is clickable at the height of the button and not only the button itself that is 150px wide and is centered on the page. I think I have my divs mixed up and it needs other formatting and precedence, but I'm not sure. Thanks for your help! P.S. First time on StackOverflow, sorry if I formatted something wrong.

    Read the article

  • Removing stopwords,but should return as a line

    - by Sarath R Nair
    My question may appear silly. But as I am a rookie in Python , help me out. I have to pass a line to a stopword removal function. It works fine. But my problem is return of the function is appending the words. I want it as like follows: line = " I am feeling good , but I cant talk" Let "I,but,cant" are stopwords. After passing to the function , my output should be as "am feeling good , talk". What I a getting now is [['am','feeling','good','talk']]. Help me.

    Read the article

  • using iOS 7 status bar in adobe air 4.11

    - by AlexGo
    I am developing an ios app using flex SDK 4.11 from Apache and I encountered a problem regarding iOS status bar. The problem is that even when the app is not in full scree the iOS status bar is displaying over my app. Is there a way to show my app below the status bar without moving the content of my app below the status bar by first determining the status bar height and then set the content below ?

    Read the article

  • Java program has errors, 80 lines of code

    - by user2961687
    I have a problem with a program. It contains a lot of errors in Eclipse. Sorry for my english and thank you in advance. Here is the task: I. Declare a class that contains private fields Jam: String taste, double weight Create constructors containing variables as parameters: (String taste, double weight), (double weight), (String taste). Parameters constructors should initialize class fields. In case the constructor does not provide the necessary parameter, it must be assumed that the field taste must have the value "No Name" and weight - 100.0. Introduce the use of all constructors creating objects that represent three kinds of jams. Note: it must be assumed that the only constructor with two parameters can be assigned to fields of the class. Declare a class Jar that contains the field Jam jam, a dedicated constructor initiating all declared fields and methods: open close isItOpen Next, create an object of class Jar and fill it with the selected type of jam, operations repeat for all the kinds of jams. This is my code this far: public class App { public static void main(String[] args) { Jam strawberry = new Jam("strawberry", 20.45); Jam raspberry = new Jam(40.50); Jam peach = new Jam("peach"); Jar jar_1 = new Jar(); Jar jar_2 = new Jar(); Jar jar_3 = new Jar(); jar_1.open(); jar_1.fillIn(strawberry); jar_2.fillIn(peach); jar_3.fillIn(raspberry); } } class Jam { String taste; double weight; public Jam(String taste, double weight) { this.taste = taste; this.weight = weight; } public Jam(double weight) { this.taste = "No name"; this.weight = weight; } public Jam(String taste) { this.taste = taste; this.weight = 100.0; } } class Jar { public Jam Jam = new Jam(); private String state_jar; public Jar() { Jam.weight = 0; Jam.taste = ""; state_jar = "closed"; } public static String open() { state_jar = open; return state_jar; } public static String close() { state_jar = "closed"; return state_jar; } public static boolean isItOpen() { return state_jar; } public void fillIn(Jam jam) { if (isItOpen == false) open(); this.Jam.weight = jam.weight; this.Jam.taste = jam.taste; this.Jam.close(); } }

    Read the article

  • Templating Word Documents in C#

    - by NullGeo
    I was wondering if there is a library out there such that it could give me the ability to fill in word templates with custom values. For example: Following could be the content of the Word Document {Address} {PhoneNumber} Hello {Name}, How are you doing? In C# I would like to do something like this to replace all the placeholders in the Word document: using(WordDocument doc = WordDocument.Load("Mail.docx")){ var person = new {Name = "John Smith", Address="42 Wallaby Way, Sydney", PhoneNumber="555-555-5555"}; doc.Template(person); doc.Print(); } The resulting document would look like this: 42 Wallaby Way, Sydney 555-555-5555 Hello John Smith, How are you doing? Any libraries out there (preferably free) that let's me do this? Edit: I am not asking you to find anything that let's me do this. If that was the case, I would do a Google search by myself. Honestly, all I am asking is "has anybody used a library in the past to do this exact thing."

    Read the article

  • JQuery remove() not working with a two word id

    - by Programer
    I have a button <button onclick="takedown()"> take down </button> that creates a H1 and button with the id of the text in my text field and h1 at the end for the h1 and button at the end for the button the button has a onclick onclick="delete()". This is that function function takedown(){ note = document.getElementById("noteinput").value; idh1 = note + "h1"; idbutton = note + "button"; idcenter = note + "center"; $('<center id="' + idcenter + '"> <h1 id="' + idh1 + '">' + note + '</h1> <button id="'+ idbutton +'" onclick="deletenote()"> Delete </button> </center>').appendTo("body"); } For the delete function the remove() works only if the id of the button and the h1 is one word. function deletenote(){ // First setting var idbuttondelete = event.target.id; var idh1delete = idbuttondelete.replace("button", "h1"); // Removing the button, h1,center $('#' + idbuttondelete).remove(); $('#' + idh1delete).remove(); } Does anybody know whats wrong or how to use JQuery to delete something if it has a two word id.

    Read the article

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