Daily Archives

Articles indexed Tuesday November 20 2012

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

  • How do I get Google to crawl my content when it's only displayed when you fill in a form?

    - by Sarang Patil
    I have a webpage. It has a form and the "results" section is blank. When the user searches for items, and a list that pops up, he/she chooses one option from list and then the corresponding results are displayed in results section. I once decided to log every ip,url of person with time that visits my page. One ip was 66.249.73.26, and on doing google search I came to know it is ip of google bot. link for whatmyipaddress google bot Now when I searched for the links that this ip visited, it was like this: search?id=100 search?id=110 ... search?id=200 ... then afterwards it incremented in steps of 1, like 400,401.. But people search for strings and not numbers. And because googlebot searches for numbers like this, I think the corresponding content is never displayed and so my page content is never indexed, even though it has rich content. So I want to ask you is that in order to show google bot all the content that the webpage has, should I list all the results in index page and ask users to enter string to filter results?

    Read the article

  • What are the ways to get included in Google Alerts mails

    - by stacker
    There is a news website / blog - I'll call it the Site from now on. The site mention a keyword in one of its articles. I add a Google Alerts for the keyword, but I do not get any alert for the word from The Site. Furthermore, searching the keyword in the news section don't getting any results from The Site. The Site has a sitemap, that indexed by Google every x minutes. And in the main search, searching for a news title bring the item on the top. What are the best ways to get included in Google Alerts mails?

    Read the article

  • Cutting objects and applying texture to cut. Unity3d/C#

    - by Timothy Williams
    Basically what I'm trying to do is figure out how to calculate realtime cutting of objects, and apply a texture to the cut. I found some good scripts, but most of them have been abandoned and aren't really fully working yet. Applying textures: http://forum.unity3d.com/threads/75949-Mesh-Real-Cutting?highlight=mesh+real+cutting Cutting: http://forum.unity3d.com/threads/78594-Object-Cutter Another (Free) Cutter (Also, I'm not entirely sure how this one will handle cutting complex meshes): http://forum.unity3d.com/threads/69992-fake-slicer?p=449114&viewfull=1#post449114 My plan as of right now is to combine links 1 & 2 or 1 & 3 programming wise. What I'm asking here for is any advice on how to advance (links to asset store packages, or other codes to show how to accomplish something complex like this.)

    Read the article

  • How access PhysicalMaterial from Actor Class?

    - by EmAdpres
    I use Projectile for my weapon system and UDKProjectile has two main function to handle Hit of projectiles(=bullet of my weapon): simulated function ProcessTouch(Actor Other, Vector HitLocation, Vector HitNormal) // For Actors simulated event HitWall(vector HitNormal, actor Wall, PrimitiveComponent WallComp) // Everything except Actors ( I guess) the first method, the function just give me the actor which I hit and my question is How I can get that actor's physical material by first parameter ( Other ), in order to make a proper react about it ( for example a proper Sound of collide ) ... A tricky (but hateful ) way which I knew works is, make a Trace from a little back of that actor to that actor, and use HitInfo parameter which include physical Material ! But there should be a more standard way !

    Read the article

  • Why do I have to divide the origin of a quad by 4 instead of 2?

    - by vinzBad
    I'm currently transitioning from C#/XNA to C#/OpenTK but I'm getting stuck at the basics. So I have this Sprite-Class: public static bool EnableDebugDraw = true; public float X; public float Y; public float OriginX = 0; public float OriginY = 0; public float Width = 0.1f; public float Height = 0.1f; public Color TintColor = Color.Red; float _layerDepth = 0f; public void Render() { Vector2[] corners = { new Vector2(X-OriginX,Y-OriginY), //top left new Vector2(X +Width -OriginX,Y-OriginY),//top right new Vector2(X +Width-OriginX,Y+Height-OriginY),//bottom rigth new Vector2(X-OriginX,Y+Height-OriginY)//bottom left }; GL.Color3(TintColor); GL.Begin(BeginMode.Quads); { for (int i = 0; i < 4; i++) GL.Vertex3(corners[i].X,corners[i].Y,_layerDepth); } GL.End(); if (EnableDebugDraw) { GL.Color3(Color.Violet); GL.PointSize(3); GL.Begin(BeginMode.Points); { for (int i = 0; i < 4; i++) GL.Vertex2(corners[i]); } GL.End(); GL.Color3(Color.Green); GL.Begin(BeginMode.Points); GL.Vertex2(X + OriginX, Y + OriginY); GL.End(); } With the following setup I try to set the origin of the quad to the middle of the quad. _sprite.OriginX = _sprite.Width / 2; _sprite.OriginY = _sprite.Height / 2; but this sets the origin to the upper right corner of the quad, so i have to _sprite.OriginX = _sprite.Width / 4; _sprite.OriginY = _sprite.Height / 4; However this is not the intended behaviour, could you advise me how I fix this?

    Read the article

  • Issues with shooting in a HTML5 platformer game

    - by fnx
    I'm coding a 2D sidescroller using only JavaScript and HTML5 canvas, and in my game I have two problems with shooting: 1) Player shoots continous stream of bullets. I want that player can shoot only a single bullet even though the shoot-button is being held down. 2) Also, I get an error "Uncaught TypeError: Cannot call method 'draw' of undefined" when all the bullets are removed. My shooting code goes like this: When player shoots, I do game.bullets.push(new Bullet(this, this.scale)); and after that: function Bullet(source, dir) { this.id = "bullet"; this.width = 10; this.height = 3; this.dir = dir; if (this.dir == 1) { this.x = source.x + source.width - 5; this.y = source.y + 16; } if (this.dir == -1) { this.x = source.x; this.y = source.y + 16; } } Bullet.prototype.update = function() { if (this.dir == 1) this.x += 8; if (this.dir == -1) this.x -= 8; for (var i in game.enemies) { checkCollisions(this, game.enemies[i]); } // Check if bullet leaves the viewport if (this.x < game.viewX * 32 || this.x > (game.viewX + game.tilesX) * 32) { removeFromList(game.bullets, this); } } Bullet.prototype.draw = function() { // bullet flipping uses orientation of the player var posX = game.player.scale == 1 ? this.x : (this.x + this.width) * -1; game.ctx.scale(game.player.scale, 1); game.ctx.drawImage(gameData.getGfx("bullet"), posX, this.y); } I handle removing with this function: function removeFromList(list, object) { for (i in list) { if (object == list[i]) { list.splice(i, 1); break; } } } And finally, in the main game loop I have this: for (var i in game.bullets) { game.bullets[i].update(); game.bullets[i].draw(); } I have tried adding if (game.bullets.length > 0) to the main game loop before the above draw&update calls, but I still get the same error.

    Read the article

  • How To Scale Canvas In Android

    - by Daniel Braithwaite
    I am writing a android game using Canvas as the way to draw everything, the problem is that when i run it on different android phones the canvas dosn't change size i tried using canvas.scale() but that didn't make a i difference. The code i use for drawing is ... public void draw( Canvas c, int score ) { Obstical2[] obstmp = Queue.toArray(this.o); Coin[] cointmp = QueueC.toArray(this.c); for( int i = 0; i < obstmp.length; i++ ) { obstmp[i].draw(c); } for( int i = 0; i < cointmp.length; i++ ) { cointmp[i].draw(c); } c.drawText(String.format("%d", score ), 20, 50, textPaint); if( isWon && isStarted ) c.drawText("YOU WON", 20, 400, resPaint); else if( isLost && isStarted ) c.drawText("YOU LOST", 20, 400, resPaint); } The function above calls the draw functions for the entity's on the screen, theses function are as follows Draw Function For Obstical : public void draw( Canvas c ) { Log.i("D", "COIN"); coin.draw(c); } Draw Function For Coin : public void draw( Canvas c ) { obstical.draw(c); } How could i make the canvas re-size to it would look the same on any screen ? Cheers Daniel

    Read the article

  • 2D tower defense - A bullet to an enemy

    - by Tashu
    I'm trying to find a good solution for a bullet to hit the enemy. The game is 2D tower defense, the tower is supposed to shoot a bullet and hit the enemy guaranteed. I tried this solution - http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/ The link mentioned to subtract the bullet's origin and the enemy as well (vector subtraction). I tried that but a bullet just follows around the enemy. float diffX = enemy.position.x - position.x; float diffY = enemy.position.y - position.y; velocity.x = diffX; velocity.y = diffY; position.add(velocity.x * deltaTime, velocity.y * deltaTime); I'm familiar with vectors but not sure what steps (vector math operations) to be done to get this solution working.

    Read the article

  • How do I filter out NaN FLOAT values in Teradata SQL?

    - by Paul Hooper
    With the Teradata database, it is possible to load values of NaN, -Inf, and +Inf into FLOAT columns through Java. Unfortunately, once those values get into the tables, they make life difficult when writing SQL that needs to filter them out. There is no IsNaN() function, nor can you "CAST ('NaN' as FLOAT)" and use an equality comparison. What I would like to do is, SELECT SUM(VAL**2) FROM DTM WHERE NOT ABS(VAL) > 1e+21 AND NOT VAL = CAST ('NaN' AS FLOAT) but that fails with error 2620, "The format or data contains a bad character.", specifically on the CAST. I've tried simply "... AND NOT VAL = 'NaN'", which also fails for a similar reason (3535, "A character string failed conversion to a numeric value."). I cannot seem to figure out how to represent NaN within the SQL statement. Even if I could represent NaN successfully in an SQL statement, I would be concerned that the comparison would fail. According to the IEEE 754 spec, NaN = NaN should evaluate to false. What I really seem to need is an IsNaN() function. Yet that function does not seem to exist.

    Read the article

  • Why can i not upload images to my folder anymore?

    - by Hannah_B
    This was something I had working a few weeks back but after I made some changes to my view file images are now no longer being saved into my assets/uploads folder. I keep getting back the error - You did not select a file to upload. This is despite having made sure the path is definitely correct. What am i doing wrong here? Here is my controller: <?php class HomeProfile extends CI_Controller { function HomeProfile() { parent::__construct(); $this->load->model("profiles"); $this->load->model("profileimages"); $this->load->helper(array('form', 'url')); } function upload() { $config['path'] = './web-project-jb/assets/uploads/'; $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = '10000'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); $img = $this->session->userdata('img'); $username = $this->session->userdata('username'); $this->profileimages->putProfileImage($username, $this->input->post("profileimage")); //fail show upload form if (! $this->upload->do_upload()) { $error = array('error'=>$this->upload->display_errors()); $username = $this->session->userdata('username'); $viewData['username'] = $username; $viewData['profileText'] = $this->profiles->getProfileText($username); $this->load->view('shared/header'); $this->load->view('homeprofile/homeprofiletitle', $viewData); $this->load->view('shared/nav'); $this->load->view('homeprofile/upload_fail', $error); $this->load->view('homeprofile/homeprofileview', $viewData, array('error' => ' ' )); $this->load->view('shared/footer'); //redirect('homeprofile/index'); } else { //successful upload so save to database $file_data = $this->upload->data(); $data['img'] = base_url().'./web-project-jb/assets/uploads/'.$file_data['file_name']; // you may want to delete the image from the server after saving it to db // check to make sure $data['full_path'] is a valid path // get upload_sucess.php from link above //$image = chunk_split( base64_encode( file_get_contents( $data['file_name'] ) ) ); $this->username = $this->session->userdata('username'); $data['profileimages'] = $this->profileimages->getProfileImage($username); $viewData['username'] = $username; $viewData['profileText'] = $this->profiles->getProfileText($username); $username = $this->session->userdata('username'); } } function index() { $username = $this->session->userdata('username'); $data['profileimages'] = $this->profileimages->getProfileImage($username); $viewData['username'] = $username; $viewData['profileText'] = $this->profiles->getProfileText($username); $this->load->view('shared/header'); $this->load->view('homeprofile/homeprofiletitle', $viewData); $this->load->view('shared/nav'); //$this->load->view('homeprofile/upload_form', $data); $this->load->view('homeprofile/homeprofileview', $data, $viewData, array('error' => ' ' ) ); $this->load->view('shared/footer'); } } Here is my view: <div id="maincontent"> <div id="primary"> <?//=$error;?> <?//=$img;?> <h3><?="Profile Image"?></h3> <img src="<?php echo'$img'?>" width='300' height='300'/> <?=form_open_multipart('homeprofile/upload');?> <input type="file" name="img" value=""/> <?=form_submit('submit', 'upload')?> <?=form_close();?> <?php if (isset($error)) echo $error;?> </div> </div> Your help is much appreciated

    Read the article

  • Invalid method declaration, return type required

    - by Brett Steen
    I am getting an error at public Rectangle(double width, double height){ saying that it's an invalid method declaration, return type required. I'm not sure how to fix it. These are also my instructions for my assignment: Write a super class encapsulating a rectangle. A rectangle has two attributes representing the width and the height of the rectangle. It has methods returning the perimeter and the area of the rectangle. This class has a subclass, encapsulating a parallelepiped, or box. A parallelepiped has a rectangle as its base, and another attribute, its length. It has two methods that calculate and return its area and volume. `public class Rectangle1 { private double width; private double height; public Rectangle1(){ } public Rectangle(double width, double height){ this.width = width; this.height = height; } public double getWidth(){ return width; } public void setWidth(double width) { this.width = width; } public double getHeight(){ return height; } public void setHeight(double height){ this.height = height; } public double getArea(){ return width * height; } public double getPerimeter(){ return 2 * (width + height); } } public class TestRectangle { public static void main(String[] args) { Rectangle1 rectangle = new Rectangle1(2,4); System.out.println("\nA rectangle " + rectangle.toString()); System.out.println("The area is " + rectangle.getArea()); System.out.println("The perimeter is " + rectangle.getPerimeter()); } }`

    Read the article

  • Replace string in one file with contents of a second file

    - by jag7720
    I have two files: fileA: date >> /root/kvno.out kvno serverXXX\$ >> /root/kvno.out fileB: foobar I need to create a new file, fileC, with the same contents as fileA, except with the string XXX being replaced with the contents of fileB: date >> /root/kvno.out kvno serverfoobar\$ >> /root/kvno.out I'd like to do this using sed. I tried some of the examples I found but I only get the contents of fileB in fileC.

    Read the article

  • Why doesn't functools.partial return a real function (and how to create one that does)?

    - by epsilon
    So I was playing around with currying functions in Python and one of the things that I noticed was that functools.partial returns a partial object rather than an actual function. One of the things that annoyed me about this was that if I did something along the lines of: five = partial(len, 'hello') five('something') then we get TypeError: len() takes exactly 1 argument (2 given) but what I want to happen is TypeError: five() takes no arguments (1 given) Is there a clean way to make it work like this? I wrote a workaround, but it's too hacky for my taste (doesn't work yet for functions with varargs): def mypartial(f, *args): argcount = f.func_code.co_argcount - len(args) params = ''.join('a' + str(i) + ',' for i in xrange(argcount)) code = ''' def func(f, args): def %s(%s): return f(*(args+(%s))) return %s ''' % (f.func_name, params, params, f.func_name) exec code in locals() return func(f, args)

    Read the article

  • Android - Take a photo, save it in app drawables and display it in an ImageButton

    - by Andres7X
    I have an Android app with an ImageButton. When user clicks on it, intent launches to show camera activity. When user capture the image, I'd like to save it in drawable folder of the app and display it in the same ImageButton clicked by the user, replacing the previous drawable image. I used the activity posted here: Capture Image from Camera and Display in Activity ...but when I capture an image, activity doesn't return to activity which contains ImageButton. Edit code is: public void manage_shop() { static final int CAMERA_REQUEST = 1888; [...] ImageView photo = (ImageView)findViewById(R.id.getimg); photo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent camera = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(camera, CAMERA_REQUEST); } }); [...] } And onActivityResult(): protected void onActivityResult(int requestCode, int resultCode, Intent data) { ImageButton getimage = (ImageButton)findViewById(R.id.getimg); if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) { Bitmap getphoto = (Bitmap) data.getExtras().get("data"); getimage.setImageBitmap(getphoto); } } How can I also store the captured image in drawable folder?

    Read the article

  • Dynamical array of strings in C

    - by Ir0nm
    I'm trying to make array of strings, I have function rLine which reads line from stdin, each inputted line I need to save in array, but I don't have any idea about number of inputted string lines. So I need to dynamically increase array size to store them, I wrote such code: char *res[2], *old = res; while( 1 ){ line = rLine( stdin ), len = strlen( line ); res[row] = (char*)malloc( len + 1); strcpy( res[row++], line); res = (char**) realloc( res, row ); /* adding 1 more row, not sure adding size row? */ if ( /*some cond*/ ) break; } But this code doesn't seem to work, how correctly declare array and increase it size?

    Read the article

  • Python: Give a class its own `self` at instantiation time

    - by SuperDisk
    I've got a button class that you can instantiate like so: engine.createElement((0, 0), Button(code=print, args=("Stuff!",))) And when it is clicked it will print "Stuff!". However, I need the button to destroy itself whenever it is clicked. Something like this: engine.createElement((0, 0), Button(code=engine.killElement, args=(self,))) However, that would just kill the caller, because self refers to the caller at that moment. What I need to do is give the class its own 'self' in advance... I thought of just making the string 'self' refer to the self variable upon click, but what if I wanted to use the string 'self' in the arguments? What is the way to do this? Is my architecture all wrong or something? Thanks.

    Read the article

  • delete element from xml using LINQ

    - by Shishir
    Hello I've a xml file like: <starting> <start> <site>mushfiq.com</site> <site>mee.con</site> <site>ttttt.co</site> <site>jkjhkhjkh</site> <site>jhkhjkjhkhjkhjkjhkh</site> <site>dasdasdasdasdasdas</site> </start> </starting> Now I need to delete any ... and value will randomly be given from a textbox. Here is my code : XDocument doc = XDocument.Load(@"AddedSites.xml"); var deleteQuery = from r in doc.Descendants("start") where r.Element("site").Value == txt.Text.Trim() select r; foreach (var qry in deleteQuery) { qry.Element("site").Remove(); } doc.Save(@"AddedSites.xml"); If I put the value of first element in the textbox then it can delete it, but if I put any value of element except the first element's value it could not able to delete! I need I'll put any value of any element...as it can be 2nd element or 3rd or 4th and so on.... can anyone help me out? thanks in advanced!

    Read the article

  • php random image file name

    - by bush man
    Okay im using a snippet I found on google to take a users uploaded image and put it in my directory under Content But Im worried about duplicates so I was going have it upload the image as a Random number well here is my code you can probably understand what im going for through it anyways <label for="file">Profile Pic:</label> <input type="file" name="ProfilePic" id="ProfilePic" /><br /> <input type="submit" name="submit" value="Submit" /> $ProfilePicName = $_FILES["ProfilePic"]["name"]; $ProfilePicType = $_FILES["ProfilePic"]["type"]; $ProfilePicSize = $_FILES["ProfilePic"]["size"]; $ProfilePicTemp = $_FILES["ProfilePic"]["tmp_name"]; $ProfilePicError = $_FILES["ProfilePic"]["error"]; $RandomAccountNumber = mt_rand(1, 99999); echo $RandomAccountNumber; move_uploaded_file($ProfilePicTemp, "Content/".$RandomAccountNumber.$ProfilePicType); And then basicly after all this Im going try to get it to put that random number in my database

    Read the article

  • When Logged out, one blog shows - logged in, all blogs show

    - by dgPehrson
    I've coded this Wordpress site but I'm finding difficulties with the blog area. Only one blog shows in the blog section but with I am logged in as an admin, I can see all the blogs on the page. I need it to show for everyone, whether they are logged in as a user or just a visitor to the website. I have attempted to see if it was a wordpress issue by checking the 'Settings Reading' settings and they are set just fine, showing to be 10 posts per page.. It could be something wrong with the loop. I have the blog pulling from the index.php. http://www.ilovepennycakes.com/category/blog/ Here is the direct link to the blog not showing in the feed. http://www.ilovepennycakes.com/thanksgiving-thoughts/ The code is as follows: <?php get_header(); ?> <!-- Article Loop --> <article> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <div class="news-top"></div> <div class="news"> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="post-header"> <h1 class="meander"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> <p class="likes m500"><?php comments_popup_link( '0', '1', '%' ); ?></p> <div class="clear"></div> </div><!--end post header--> <!--div class="entry clear"--> <div class="blog-content m500"> <?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?> <?php the_content(); ?> <?php wp_link_pages(); ?> </div> <!--/div--><!--end entry--> <p class="date M500">Posted <?php the_time( 'j M Y' ); ?></p> <p class="M500"><?php edit_post_link( __( 'Edit', 'pennycakes' ), '<span>', '</span>' ); ?></p> <!--end post footer--> </div><!--end post--> </div> <div class="news-bottom"></div> <?php endwhile; /* rewind or continue if all posts have been fetched */ ?> </div><!--end navigation--> <div class="navigation index"> <div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div> <div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div> <?php else : ?> <?php endif; ?> </article> <!-- //Article Loop --> Any help will be appreciated.

    Read the article

  • Why can't I access the facebook friends list after reopening a session in ios

    - by user1532390
    I am upgrading to the facebook 3.0 sdk for ios. Things went well, until I tried to open an existing session after relaunching the application. I am trying to access the list of friends for the facebook user. if ([[FBSession activeSession] isOpen]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //do something here }]; }else{ [[self session] openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if ([self isValid]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //log this error we always get NSLog(@"%@",error); //do something else }]; } }]; } However I get this error: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1d92ff40 {com.facebook.sdk:ParsedJSONResponseKey={ body = { error = { code = 2500; message = "An active access token must be used to query information about the current user."; type = OAuthException; }; }; code = 400; }, com.facebook.sdk:HTTPStatusCode=400} I've found that if I use the FBSession reauthorize method it allows me to complete the request without error, but it also means I must show UI or switch apps every time we relaunch the application which is unacceptable. Any suggestions on what I should be doing differently?

    Read the article

  • JSON image viewer not working in firefox

    - by jarga
    I have tried to find out why JSON is not working in Firefox all over this forum and the internet. It works on tablets, ie, safari. It works on my desktop in firefox. It only does not work after uploading I've tried a few things (commented out), such as mimeType with no solution. I have tried using the $.ajax with no better luck. Firefox had no javascript errors. I'm using jQuery 1.7. Console.log is printing out the data. $(document).ready(function(){ jQuery.support.cors = true; //$.ajaxSetup({ mimeType: "application/json" }); /*$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"}); */ // loading pictures $.getJSON("intro.json?format=json", function(data){ var links = ''; var imageload = ''; var title = ''; console.log(data) $.each(data, function(key, item){ links += ' <a href=' + item.image + '>' + key + '</a>'; imageload += '<img src="' + item.image + ' " />'; title += item.alt; }); $('.introCon').html(imageload); $('.introCon img').hide(); $('.introCon img:last').fadeIn(500); $('.introCon img').fadeIn(1000); rotatePics(2); }); }); function rotatePics(currentPhoto) { var numberOfPhotos = $('.introCon img').length; currentPhoto = currentPhoto % numberOfPhotos; $('.introCon img').eq(currentPhoto).fadeOut( function() { // re-order the z-index $('.introCon img').each(function(i) { $(this).css( 'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos ); }); $(this).show(); setTimeout(function() {rotatePics(++currentPhoto);}, 3000); }); } Here is the simple JSON from a separate file. { "1" : { "image" : "portfolio/chrpic.png", "alt" : "Blah.", "detail": "Quartz"}, "2" : { "image" : "portfolio/mysspic.png", "alt" : "Landing page.", "detail": "Container"}, "3" : { "image" : "portfolio/decode-pic3.png", "alt" : "Decode this.", "detail": "Landing page 2"}, "4" : { "image" : "portfolio/simple-think-pic.png", "alt" : "Simple Think", "detail": "simpilify your life"} }

    Read the article

  • jsf messed up links

    - by Mateusz
    I'm new to JSF. My application is working, but I'm confused with links in browser when using controller. BTW, there is also PrimeFaces in my app so don't be suprised with p: tags. Let's say I have 'list' and 'show' pages with controller doing redirection between them. First I'm on http://localhost:8080/y/r/conversation/list.xhtml page. There is link created with line <p:commandLink action="#{lazyConversationBean.doShow(conv)}" ajax="false" value="View"/>. lazyConversationBean acts here as my Controller. There is method: public String doShow(Conversation c) { this.setSelectedConversation(c); return "view"; } from which I got redirected to ...... again http://localhost:8080/y/r/conversation/list.xhtml (browser shows it) even when it's correct http://localhost:8080/y/r/conversation/view.xhtml page. There I have link <p:commandButton action="#{lazyConversationBean.doList()}" ajax="false" value="Back to list"/> and again controller has method: public String doList() { return "list"; } from which I got redirected to ... yeah, you guessed right ... http://localhost:8080/y/r/conversation/view.xhtml (that is again what browser shows) even when again it is correct http://localhost:8080/y/r/conversation/list.xhtml page. It seams as browser link area is always one step behind page currently being displayed. I don't even know if it's some incorrect behaviour as I have no idea how to query google for this :D Just for test I did this short tutorial, where netbeans created whole stack of code on one of my entities, and behaviour was the same, so it's not PrimeFaces magic related. Can you tell my why it happens, and how to fix it? Users likes to copy correct links ;)

    Read the article

  • Extracting the source code of a facebook page with JavaScript

    - by Hafizi Vilie
    If I write code in the JavaScript console of Chrome, I can retrieve the whole HTML source code by entering: var a = document.body.InnerHTML; alert(a); For fb_dtsg on Facebook, I can easily extract it by writing: var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; Now, I am trying to extract the code "h=AfJSxEzzdTSrz-pS" from the Facebook Page. The h value is especially useful for Facebook reporting. How can I get the h value for reporting? I don't know what the h value is; the h value is totally different when you communicate with different users. Without that h correct value, you can not report. Actually, the h value is AfXXXXXXXXXXX (11 character values after 'Af'), that is what I know. Do you have any ideas for getting the value or any function to generate on Facebook page. The Facebook Source snippet is below, you can view source on facebook profile, and search h=Af, you will get the value: <code class="hidden_elem" id="ukftg4w44"> <!-- <div class="mtm mlm"> ... .... <span class="itemLabel fsm">Unfriend...</span></a></li> <li class="uiMenuItem" data-label="Report/Block..."> <a class="itemAnchor" role="menuitem" tabindex="-1" href="/ajax/report/social.php?content_type=0&amp;cid=1352686914&amp;rid=1352686914&amp;ref=http%3A%2F%2Fwww.facebook.com%2 F%3Fq&amp;h=AfjSxEzzdTSrz-pS&amp;from_gear=timeline" rel="dialog"> <span class="itemLabel fsm">Report/Block...</span></a></li></ul></div> ... .... </div> --> </code> Please guide me. How can extract the value exactly? I tried with following code, but the comment block prevent me to extract the code. How can extract the value which is inside comment block? var a = document.getElementsByClassName('hidden_elem')[3].innerHTML;alert(a);

    Read the article

  • C# Alternating threads

    - by Mutoh
    Imagine a situation in which there are one king and n number of minions submissed to him. When the king says "One!", one of the minions says "Two!", but only one of them. That is, only the fastest minion speaks while the others must wait for another call of the king. This is my try: using System; using System.Threading; class Program { static bool leaderGO = false; void Leader() { do { lock(this) { //Console.WriteLine("? {0}", leaderGO); if (leaderGO) Monitor.Wait(this); Console.WriteLine("> One!"); Thread.Sleep(200); leaderGO = true; Monitor.Pulse(this); } } while(true); } void Follower (char chant) { do { lock(this) { //Console.WriteLine("! {0}", leaderGO); if (!leaderGO) Monitor.Wait(this); Console.WriteLine("{0} Two!", chant); leaderGO = false; Monitor.Pulse(this); } } while(true); } static void Main() { Console.WriteLine("Go!\n"); Program m = new Program(); Thread king = new Thread(() => m.Leader()); Thread minion1 = new Thread(() => m.Follower('#')); Thread minion2 = new Thread(() => m.Follower('$')); king.Start(); minion1.Start(); minion2.Start(); Console.ReadKey(); king.Abort(); minion1.Abort(); minion2.Abort(); } } The expected output would be this (# and $ representing the two different minions): > One! # Two! > One! $ Two! > One! $ Two! ... The order in which they'd appear doesn't matter, it'd be random. The problem, however, is that this code, when compiled, produces this instead: > One! # Two! $ Two! > One! # Two! > One! $ Two! # Two! ... That is, more than one minion speaks at the same time. This would cause quite the tumult with even more minions, and a king shoudln't allow a meddling of this kind. What would be a possible solution?

    Read the article

  • Django-admin.py not being recognized suddenly

    - by Jen Camara
    I tried starting a new Django project yesterday but when I did "django-admin.py startproject projectname" I got an error stating: "django-admin.py is not recognized as an internal or external command." The strange thing is, when I first installed Django, I made a few projects and everything worked fine. But now after going back a few months later it has suddenly stopped working. I've tried looking around for an answer and all I could find is that this typically has to do with the system path settings, however, I know that I have the proper paths set up so I don't understand what's happening. Does anybody have any idea what's going on?

    Read the article

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