Daily Archives

Articles indexed Monday March 26 2012

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

  • Recommend an open source CMS for single page web site

    - by RedMan
    Hi I want to create a single page web site like http://kiskolabs.com/ or http://www.carat.se to display my portfolio. I want to add new products after launching the site without having to edit the entire site. I've looked at opencart (too much for single page site), Magneto (more for ecommerce), Wordpress (couldn't find open source / free templates which i can start from). Can you suggest a CMS which will support the creation of a single page site and allow insertion of new products without having to edit the entire page? I would prefer a CMS which also has open source / free templates which I can tweak for my use. I can do php and mysql, xml. If it is an easier option I can do PSD to site (but don't know much about this at all).

    Read the article

  • Prevent hotlinking of attachments

    - by reggie
    People are able to embed my forum's attachments (vbulletin). I tried to create an htaccess rule for the hotlinking, but it did not work. RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com.*$ [NC] RewriteRule attachmentid=\d+(\&d=\d*)?|\.([Gg][Ii][Ff]|[Jj][Pp][Gg])$ http://mydomain.com/antihotlink.jpeg [R] Is it not possible to check for numbers in regular expressions in htaccess files?

    Read the article

  • Debugging "Premature end of script headers" - WSGI/Django [migrated]

    - by Marcin
    I have recently deployed an app to a shared host (webfaction), and for no apparent reason, my site will not load at all (it worked until today). It is a django app, but the django.log is not even created; the only clue is that in one of the logs, I get the error message: "Premature end of script headers", identifying my wsgi file as the source. I've tried to add logging to my wsgi file, but I can't find any log created for it. Is there any recommended way to debug this error? I am on the point of tearing my hair out. My WSGI file: import os import sys from django.core.handlers.wsgi import WSGIHandler import logging logger = logging.getLogger(__name__) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' os.environ['CELERY_LOADER'] = 'django' virtenv = os.path.expanduser("~/webapps/django/oneclickcosvirt/") activate_this = virtenv + "bin/activate_this.py" execfile(activate_this, dict(__file__=activate_this)) # if 'VIRTUAL_ENV' not in os.environ: # os.environ['VIRTUAL_ENV'] = virtenv sys.path.append(os.path.dirname(virtenv+'oneclickcos/')) logger.debug('About to run WSGIHandler') try: application = WSGIHandler() except (Exception,), e: logger.debug('Exception starting wsgihandler: %s' % e) raise e

    Read the article

  • SEO penalty for landing page redirects

    - by therealsix
    Using ebay as an example- lets say I have a large number of items whose URLs' look like this: cgi.ebay.com/ebaymotors/1981-VW-Vanagon-manual-seats-seven-/250953153841 I want to give my client the ability to put links to these items on their website EASILY, without knowing or checking my URL. So I created a redirect service that will map their identifier with my URL: ebay.com/fake_redirect_service/shared_identifier9918 would redirect to the link above. This works great- my clients can easily setup these links with information they already have, and the user will see the page as usual. So on to the problem... I'm concerned that this redirecting service will have a negative impact on my SEO ranking. Having a landing page redirect you immediately to a different URL seems like something a typical spam site would do. Will this hurt me? Any better solutions?

    Read the article

  • adding slugs to the URLs afterwards

    - by altuure
    we have a website for last 5 months and we did not used slug at bottom level elements so urls was like /apps/webmasters/badges/1100 would it make sense to add name to the URL after that point and redirect to the new ones ? I am interested in building more search terms. and increase page ranks ..... /apps/webmasters/badges/1100 - redirect and served at /apps/webmasters/badges/1100-supporter Or should I keep old URLs as is and create new urls with slugs. I would also appreciate some advice on shared urls on facebook or on twitter in those cases. Thanks in advance...

    Read the article

  • How to perform simple collision detection?

    - by Rob
    Imagine two squares sitting side by side, both level with the ground like so: A simple way to detect if one is hitting the other is to compare the location of each side. They are touching if all of the following are false: The right square's left side is to the right of the left square's right side. The right square's right side is to the left of the left square's left side. The right square's bottom side is above the left square's top side. The right square's top side is below the left square's bottom side. If any of those are true, the squares are not touching. But consider a case like this, where one square is at a 45 degree angle: Is there an equally simple way to determine if those squares are touching?

    Read the article

  • How can I design good continuous (seamless) tiles?

    - by Mikalichov
    I have trouble designing tiles so that when assembled, they don't look like tiles, but look like a homogeneous thing. For example, see the image below: Even though the main part of the grass is only one tile, you don't "see" the grid; you know where it is if you look a bit carefully, but it is not obvious. Whereas when I design tiles, you can only see "oh, jeez, 64 times the same tile," like in this image: (I took this from another GDSE question, sorry; not be critical of the game, but it proves my point. And actually has better tile design that what I manage, anyway.) I think the main problem is that I design them so they are independent, there is no junction between two tiles if put closed to each other. I think having the tiles more "continuous" would have a smoother effect, but can't manage to do it, it seems overly complex to me. I think it is probably simpler than I think once you know how to do it, but couldn't find a tutorial on that specific point. Is there a known method to design continuous / homogeneous tiles? (My terminology might be totally wrong, don't hesitate to correct me.)

    Read the article

  • Why do I get this file loading exception when trying to draw sprites with libgdx?

    - by BluFire
    I'm having trouble with the "Drawing Images" section on the libgdx tutorial. I set up the documents completely and I typed the code as follows: public class Game implements ApplicationListener { public static final String LOG = Game.class.getSimpleName(); private FPSLogger fpsLogger; private SpriteBatch batch; private Texture texture; private Sprite sprite; private TextureRegion region; //removed irrelevant code for this question... @Override public void render() { texture = new Texture(Gdx.files.internal("android.png")); region = new TextureRegion(texture, 20, 20, 50, 50); sprite = new Sprite(texture, 20, 20, 50, 50); sprite.setPosition(10, 10); sprite.setRotation(45); Gdx.gl.glClearColor(0f, 1f, 0f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); batch.draw(texture,10,10); batch.draw(region,10,10); sprite.draw(batch); batch.end(); // output the current FPS fpsLogger.log(); } } I went through the tutorial on the website but when I run the code I get errors: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: android.png at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137) at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:55) at com.badlogic.gdx.graphics.Texture.load(Texture.java:175) at com.badlogic.gdx.graphics.Texture.create(Texture.java:159) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:122) at com.game.Game.render(Game.java:46) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop (LwjglApplication.java:163) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: android.png (Internal) at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:108) at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:364) at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:156) at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:134) ... 8 more I set the android.png in my assests folder in my android project linking it to the desktop one, I don't understand what I'm doing wrong. What is making these errors? FIX. Weird ending.this was the plus where the sprite is suppose to look like. The top right corner of the next image should look like, the bottom left is what turned out in the code. I'm think it was because of the texture region but I'm not 100%. Can somebody explain why it is really warped? I thought the changes I made in the coding will just change position/rotation, rather then a change in the image.

    Read the article

  • How to highlight non-rectangular hotspots?

    - by HuseyinUslu
    So my question is highly related to Creating non-rectangular hotspots and detecting clicks. Yet again, I've irregular hot-spots (think the game Risk). So basically, we can detect clicks on these hot-spots easily using color key mapping as discussed in above question which I don't have any problems implementing (which is also covered here in details). The problem is about highlighting these irreguar hotspots. So let me explain the question a bit more - the above color key mapping guide uses this as a world map: Then the author color-maps the imaginary countries: Now we can now detect the country the pointer is over. In the same article author mentions outlining countries on mouse-over. Though to get the effect, he creates unique border assets for each country - like: For the game I'm working on I'm using the same color-key mapping idea to detect hot-spots, but I didn't like the way of highlighting hot-spots. Coloring all the hot-spots is already a time-consuming job for me - as I have 25+ hot-spots for each map. Further, the need to have 25 unique border/highlight asset per hot-spot doesn't sound right. Anyone have a better idea/suggestion on highlighting these hot-spots?

    Read the article

  • Dropping multiple objects using an array in Actionscript?

    - by Eratosthenes
    I'm trying to get these fireBalls to drop more often, I'm not sure if I'm using Math.random correctly. Also, for some reason I'm getting a null reference because I think the fireBalls array waits for one to leave the stage before dropping another one? This is the relevant code: var sun:Sun=new Sun var fireBalls:Array=new Array() var left:Boolean; function onEnterFrame(event:Event){ if (left) { sun.x = sun.x - 15; }else{ sun.x = sun.x + 15; } if (fireBalls.length>0&&fireBalls[0].y>stage.stageHeight){ // Fireballs exit stage removeChild(fireBalls[0]); fireBalls.shift(); } for (var j:int=0; j<fireBalls.length; j++){ fireBalls[j].y=fireBalls[j].y+15; if (fireBalls[j].y>stage.stageHeight-fireBall.width/2){ } } if (Math.random()<.2){ // Fireballs shooting from Sun var fireBall:FireBall=new FireBall; fireBall.x=sun.x; addChild(fireBall); fireBalls.push(fireBall); } }

    Read the article

  • Actionscript - Dropping Multiple Objects Using an Array? [closed]

    - by Eratosthenes
    Possible Duplicate: Actionscript - Dropping Multiple Objects Using an Array? I'm trying to get these fireBalls to drop more often, im not sure if im using Math.random correctly also, for some reason I'm getting a null reference because I think the fireBalls array waits for one to leave the stage before dropping another one? this is the relevant code: var sun:Sun=new Sun var fireBalls:Array=new Array() var left:Boolean; function onEnterFrame(event:Event){ if (left) { sun.x = sun.x - 15; }else{ sun.x = sun.x + 15; } if (fireBalls.length>0&&fireBalls[0].y>stage.stageHeight){ // Fireballs exit stage removeChild(fireBalls[0]); fireBalls.shift(); } for (var j:int=0; j<fireBalls.length; j++){ fireBalls[j].y=fireBalls[j].y+15; if (fireBalls[j].y>stage.stageHeight-fireBall.width/2){ } } if (Math.random()<.2){ // Fireballs shooting from Sun var fireBall:FireBall=new FireBall; fireBall.x=sun.x; addChild(fireBall); fireBalls.push(fireBall); } }

    Read the article

  • How can a load and play an .x model using vertex animation in XNA?

    - by Christian
    From a game I developed years ago, I still have character models that my former 3D engine designer created and that I'd like to reuse in a Windows Phone project now. However, the files are in DirectX format (.x) containing keyframe animation only. No bones. No skeleton. There are a lot of animation keys defined on several frames to animate the characters. I don't quite understand how that works, to be frankly. However, I did a lot of research regarding a possible way of getting the characters animated via XNA on Windows Phone and all I found are hints that it is generally possible but not supported. Possibly by implementing own Content Importers and Processors. I didn't find anyone who successfully did something like that yet. How should I go about loading and displaying these models in XNA?

    Read the article

  • How to visualize real time data on Android? [closed]

    - by matarsak
    I want to build and android app that visualizes real time data (2D animation). I set up a UDP channel that get the data, now I want to visualize it. I know that I can use OpenGL ES, but after a few weeks, I dont think that I'm able to learn that. What about Android Processing? Could it be used for an extensive visualization task like this? or is it limited in some way? I've heard it's not hard learn. Any other options?

    Read the article

  • sed multiline pygmentize

    - by dasickis
    I would like to take the html piece and pass it to pygmentize to colorize it accordingly. I'm wondering how I could use sed or some other cli tool to get that accomplished. I tried a bunch of sed one-liners and tried to use the following SO questions: Sed multiline replacement question Using or in multiline sed replacement sed or awk multiline replace I have the following log: 2012-03-26 18:04:27,385 9372 [main] ERROR web.commons.exception.ServiceInvocationException - Response from server cannot be decoded to JSON, responsePayload = <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing jetty-url. Reason: <pre> Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> </body> </html> org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@369133f6; line: 1, column: 2] UPDATE I'm adding this to a longer command: mvn -U test | (while read line; do echo ${line} | sed -e "s/.*ERROR.*/`echo -e '\e[91m&\e[0m'`/g" -e "s/.*\(WARN|INFO\).*/`echo -e '\e[93m&\e[0m'`/g"; done)

    Read the article

  • Possible to capture the returned value from a Python list comprehension for use a condition?

    - by Joe
    I want to construct a value in a list comprehension, but also filter on that value. For example: [expensive_function(x) for x in generator where expensive_function(x) < 5] I want to avoid calling expensive_function twice per iteration. The generator may return an infinite series, and list comprehensions aren't lazily evaluated. So this wouldn't work: [y in [expensive_function(x) for x in generator where expensive_function(x)] where y < 5] I could write this another way, but it feels right for a list comprehension and I'm sure this is a common usage pattern (possible or not!).

    Read the article

  • rails semi-complex STI with ancestry data model planning the routes and controllers

    - by ere
    I'm trying to figure out the best way to manage my controller(s) and models for a particular use case. I'm building a review system where a User may build a review of several distinct types with a Polymorphic Reviewable. Country (has_many reviews & cities) Subdivision/State (optional, sometimes it doesnt exist, also reviewable, has_many cities) City (has places & review) Burrow (optional, also reviewable ex: Brooklyn) Neighborhood (optional & reviewable, ex: williamsburg) Place (belongs to city) I'm also wondering about adding more complexity. I also want to include subdivisions occasionally... ie for the US, I might add Texas or for Germany, Baveria and have it be reviewable as well but not every country has regions and even those that do might never be reviewed. So it's not at all strict. I would like it to as simple and flexible as possible. It'd kinda be nice if the user could just land on one form and select either a city or a country, and then drill down using data from say Foursquare to find a particular place in a city and make a review. I'm really not sure which route I should take? For example, what happens if I have a Country, and a City... and then I decide to add a Burrow? Could I give places tags (ie Williamsburg, Brooklyn) belong_to NY City and the tags belong to NY? Tags are more flexible and optionally explain what areas they might be in, the tags belong to a city, but also have places and be reviewable? So I'm looking for suggestions for anyone who's done something related. Using Rails 3.2, and mongoid.

    Read the article

  • How would I implement code in a .h file into the main.cpp file?

    - by Lea
    I have a c++ project I am working on. I am a little stumped at the moment. I need a little help. I need to implement code from the .h file into the main.cpp file and I am not sure how to do that. For example code code from main.cpp: switch (choice){ case 1: // open an account { cout << "Please enter the opening balence: $ "; cin >> openBal; cout << endl; cout << "Please enter the account number: "; cin >> accountNum; cout << endl; break; } case 2:// check an account { cout << "Please enter the account number: "; cin >> accountNum; cout << endl; break; } and code from the .h file: void display(ostream& out) const; // displays every item in this list through out bool retrieve(elemType& item) const; // retrieves item from this list // returns true if item is present in this list and // element in this list is copied to item // false otherwise // transformers void insert(const elemType& item); // inserts item into this list // preconditions: list is not full and // item not present in this list // postcondition: item is in this list In the .h file you would need to use the void insert under transformer in the main.cpp under case 1. How would you do that? Any help is apprecaited. I hope I didn't confuse anyone on what I am needing to know how to do. Thanks

    Read the article

  • Fortran: output format dependent on a variable

    - by Flux Capacitor
    I would like to have a FORTRAN write statement formatted to depend on some variable. For example, I could write: write(*,'(3f15.3,3f9.2)') x,y,z,(var(i),i=1,nvari) where nvari = 3 But, what if, in some cases, I actually have 4 variables (i.e. nvari = 4) I would like to write something like this: write(*,'(3f15.3,nvari(f9.2))') x,y,z,(var(i),i=1,nvari) Now, nvari can be anything and the output will work as I like. How can I make something like this work?

    Read the article

  • antlr: How to rewrite only specific

    - by user1293945
    I am sure antlr can solve my problem, but can't figure out how to implement it, even high level. I rapidly got caught into syntax problems of antlr itself. My grammar is quite simple and made of following tokens and rules. Don't really need to go in their details here. The evaluator resolves to expressions, which finally resolve to IDENT: evaluator : expression EOF! ; ... ... term : PARTICIPANT_TYPE(IDENT | '('! expression ')'! | max | min | if_ | NUMBER)+ ; Now, I would like to analyse and rewrite the 'term', so that IDENT tokens (and them only) get re-written with the PARTICIPANT_TYPE. All the others should simply remain the same.

    Read the article

  • Regexs in Ruby getting filename

    - by user1290757
    i am extracting file names of html files using line: filename = File.basename(input_filename, ".*") which currently prints full file name excluding .html extension All files are stored in the form of http^x.x.edu^1^2 all file names begin with http^ and contain edu^ what i want is to extract 2 (which changes) but it is always the second element after .edu I have attempted destructive gsub! but i m weak with regular expressions.

    Read the article

  • How to have multiple paths display URL as root

    - by Verdi Erel Ergün
    I want users#new and tasks#index to display as the root path URL, i.e. / When a user logs in on the path users#new (set as root) they are redirected to tasks#index and URL does not change. Can this be done in the routes.rb file? This is my routes.rb file: Todo::Application.routes.draw do resources :sessions resources :subscriptions resources :users resources :tasks do collection do post :sort end end root :to => "users#new" match "sessions#new" => "tasks#index" match "sessions#" => "tasks#index"

    Read the article

  • vlcj not displaying the video

    - by Cássio Eudardo
    I'm using vlcj to play video, but the video doesn't display on some computers(i tested in 4 and worked on 2, all windows), on 1 it displays the button but not the video and on the other it just display a gray background without the button. I tested .wmv and .avi files. I'm using the following code: public class Video extends JFrame implements WindowListener{ private JPanel contentPane; private JButton btnClose; private Dimension size; private float aspectRatio; private EmbeddedMediaPlayer mediaPlayer; public Video() { try { size = Toolkit.getDefaultToolkit().getScreenSize(); aspectRatio = (float)size.width/size.height; String file = "..."; btnClose = new JButton("X"); btnClose.addActionListener(new ActionListener() {...}); btnClose.setBounds(640 - 50, 10, 40, 40); setBounds(size.width/2 - 320, (int)(size.height - 40*aspectRatio) - 250, 640, 200); contentPane = new JPanel(); contentPane.setLayout(null); setContentPane(contentPane); WindowsCanvas surface = new WindowsCanvas(); contentPane.setBounds(0, 0, 640, 200); surface.setBounds(0, 0, 640, 200); MediaPlayerFactory factory = new MediaPlayerFactory(new String("--no-video-title-show")); mediaPlayer = factory.newEmbeddedMediaPlayer(); surface.addMouseListener(new MouseListener() {...}); contentPane.add(btnClose); contentPane.add(surface); setVisible(true); mediaPlayer.setVideoSurface(factory.newVideoSurface(surface)); mediaPlayer.setRepeat(true); mediaPlayer.playMedia(file); } catch(Exception e) { } }}

    Read the article

  • Create a callback function within a custom jQuery function

    - by Thomas
    I'm not sure how to approach this as I am fairly new to jQuery. I'm wanting to create a callback function within a custom function. Here's my example: function doSomething() { var output = 'output here'; // Do something here // This is where I want to create the callback function and pass output as a parameter } I want the callback function to be accessible by any number of scripts (e.g. more than one script can access this callback). This function (doSomething) is not part of a plugin but rather part of another callback function itself. I've also created a var within the function and want to pass that through the callback function as well. How can I do this?

    Read the article

  • How to request Transponder list from a TV satellite

    - by Muhammad alaa
    I have a DTV-DVB Mantis BDA satellite card and I was wondering if i can use it programmatically to request a satellite transponder list throw some library or if i should create one Where should i start? I saw applications do that such as ProgDVB, but i didn't know what is the idea behind that. Another question: is there any standard that define how to communicate with Satellite TV, and if there is where i can get/read it. thank you

    Read the article

  • How to validate a form reCaptcha in MVC C#

    - by Alexidze
    I have a page that contains several forms, by submitting each one of them, next form becomes visible. the last form contains a recaptcha validator, my problem starts here, if i declare an action result for that page like this [CaptchaValidator] public ActionResult myAction(SomeModel model, string lang) { return View("towing", model); } I'm getting an argument null exeption parameter "Challenge", which in fact means that you have to POST those fields from recaptcha for the validation to appear and I cannot post anyting untill the last for is visible and posted. then I've added a news ActionResult like myActionValidated, defined a route for it like: mypage/validate pointing to that actionresult and then i don't know where to go from here, i want simply do display a message if the reCaptcha did not validate and redirect to a URL if it succeeded. I hope I made myself clear. Thank you in advance

    Read the article

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