Search Results

Search found 23262 results on 931 pages for 'content analysis'.

Page 153/931 | < Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >

  • My approach towards SEO implementation needs improvements. [closed]

    - by Eritrea
    I have always copy/paste this below code as a template for meta tags on project, but I think they are not effective as they could possible be. So, I need to know if there is anyway I can improve it. suppose I have a site called coop.com for a company called Coopm and we do import and export as a business in France. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="rpbots" content="index, follow" /> <meta name="description" content="ccop is a major import and export company" /> <meta name="keywords" content="coop, coop.com coop company, import export, import export france, " /> <meta name='REVISIT-AFTER' content='30 DAYS'> <title>coop is an import and export company located in France</title> </head> The reason I am asking, is because I want to know if there are better ways of constructing your SEO tags, and construction.

    Read the article

  • SEHException throw using Microsoft XACT Audio Framework (XACT3)

    - by Sweta Dwivedi
    I have been developing a game using Kinect + XNA and using Microsoft Audio Creation tool (XACT3) for managing my sound files and music, however in the code an SEHException is thrown whenever it tries to get the wave file from the wave Bank . . Sometimes the code works magically and all of a sudden it will start throwing this exception randomly ..I need a help on solving this exception /*Declaring Audio Engine for music*/ AudioEngine engine; SoundBank soundBank; WaveBank waveBank; Cue cue; /*Declaring Audio engine for sound effects*/ AudioEngine engine1; SoundBank soundbank; WaveBank wavebank; Cue effect; engine = new AudioEngine(@"Content\therapy.xgs"); soundBank = new SoundBank(engine, @"Content\Sound Bank.xsb"); **waveBank = new WaveBank(engine, @"Content\Wave Bank.xwb");** cue = null; engine1 = new AudioEngine(@"Content\Music_Manager\Sound_effects.xgs"); soundbank = new SoundBank(engine1, @"Content\Music_Manager\Sound1.xsb"); **wavebank = new WaveBank(engine1, @"Content\Music_Manager\Wave1.xwb");** effect = null; cue = soundBank.GetCue("hypnotizing"); cue.Play();

    Read the article

  • 500 INTERNAL SERVER ERROR

    - by jude
    Hi, I have and old content database which i restored in my sharepoint 2007. But whenver i try to access web sites in my sharepoint i get error : 500 INTERNAL SERVER ERROR. I can see the old content database at :- Sharepoint Centre Admin-Application Management-Content databases. There is no difference in the version of the old content database. My current content database is working fine.Its just the old content database is not. What could be the reason? Thanks, Jude Aloysius.

    Read the article

  • Snake Game Help

    - by MuhammadA
    I am making a snake game and learning XNA at the same time. I have 3 classes : Game.cs, Snake.cs and Apple.cs My problem is more of a conceptual problem, I want to know which class is really responsible for ... detecting collision of snake head on apple/itself/wall? which class should increase the snakes speed, size? It seems to me that however much I try and put the snake stuff into snake.cs that game.cs has to know a lot about the snake, like : -- I want to increase the score depending on size of snake, the score variable is inside game.cs, which means now I have to ask the snake its size on every hit of the apple... seems a bit unclean all this highly coupled code. or -- I DO NOT want to place the apple under the snake... now the apple suddenly has to know about all the snake parts, my head hurts when I think of that. Maybe there should be some sort of AppleLayer.cs class that should know about the snake... Whats the best approach in such a simple scenario? Any tips welcome. Game.cs : using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Design; namespace Snakez { public enum CurrentGameState { Playing, Paused, NotPlaying } public class Game1 : Microsoft.Xna.Framework.Game { private GraphicsDeviceManager _graphics; private SpriteBatch _spriteBatch; private readonly Color _niceGreenColour = new Color(167, 255, 124); private KeyboardState _oldKeyboardState; private SpriteFont _scoreFont; private SoundEffect _biteSound, _crashSound; private Vector2 _scoreLocation = new Vector2(10, 10); private Apple _apple; private Snake _snake; private int _score = 0; private int _speed = 1; public Game1() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); _scoreFont = Content.Load<SpriteFont>("Score"); _apple = new Apple(800, 480, Content.Load<Texture2D>("Apple")); _snake = new Snake(Content.Load<Texture2D>("BodyBlock")); _biteSound = Content.Load<SoundEffect>("Bite"); _crashSound = Content.Load<SoundEffect>("Crash"); } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { Content.Unload(); } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { KeyboardState newKeyboardState = Keyboard.GetState(); if (newKeyboardState.IsKeyDown(Keys.Escape)) { this.Exit(); // Allows the game to exit } else if (newKeyboardState.IsKeyDown(Keys.Up) && !_oldKeyboardState.IsKeyDown(Keys.Up)) { _snake.SetDirection(Direction.Up); } else if (newKeyboardState.IsKeyDown(Keys.Down) && !_oldKeyboardState.IsKeyDown(Keys.Down)) { _snake.SetDirection(Direction.Down); } else if (newKeyboardState.IsKeyDown(Keys.Left) && !_oldKeyboardState.IsKeyDown(Keys.Left)) { _snake.SetDirection(Direction.Left); } else if (newKeyboardState.IsKeyDown(Keys.Right) && !_oldKeyboardState.IsKeyDown(Keys.Right)) { _snake.SetDirection(Direction.Right); } _oldKeyboardState = newKeyboardState; _snake.Update(); if (_snake.IsEating(_apple)) { _biteSound.Play(); _score += 10; _apple.Place(); } base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(_niceGreenColour); float frameRate = 1 / (float)gameTime.ElapsedGameTime.TotalSeconds; _spriteBatch.Begin(); _spriteBatch.DrawString(_scoreFont, "Score : " + _score, _scoreLocation, Color.Red); _apple.Draw(_spriteBatch); _snake.Draw(_spriteBatch); _spriteBatch.End(); base.Draw(gameTime); } } } Snake.cs : using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework; namespace Snakez { public enum Direction { Up, Down, Left, Right } public class Snake { private List<Rectangle> _parts; private readonly Texture2D _bodyBlock; private readonly int _startX = 160; private readonly int _startY = 120; private int _moveDelay = 100; private DateTime _lastUpdatedAt; private Direction _direction; private Rectangle _lastTail; public Snake(Texture2D bodyBlock) { _bodyBlock = bodyBlock; _parts = new List<Rectangle>(); _parts.Add(new Rectangle(_startX, _startY, _bodyBlock.Width, _bodyBlock.Height)); _parts.Add(new Rectangle(_startX + bodyBlock.Width, _startY, _bodyBlock.Width, _bodyBlock.Height)); _parts.Add(new Rectangle(_startX + (bodyBlock.Width) * 2, _startY, _bodyBlock.Width, _bodyBlock.Height)); _parts.Add(new Rectangle(_startX + (bodyBlock.Width) * 3, _startY, _bodyBlock.Width, _bodyBlock.Height)); _direction = Direction.Right; _lastUpdatedAt = DateTime.Now; } public void Draw(SpriteBatch spriteBatch) { foreach (var p in _parts) { spriteBatch.Draw(_bodyBlock, new Vector2(p.X, p.Y), Color.White); } } public void Update() { if (DateTime.Now.Subtract(_lastUpdatedAt).TotalMilliseconds > _moveDelay) { //DateTime.Now.Ticks _lastTail = _parts.First(); _parts.Remove(_lastTail); /* add new head in right direction */ var lastHead = _parts.Last(); var newHead = new Rectangle(0, 0, _bodyBlock.Width, _bodyBlock.Height); switch (_direction) { case Direction.Up: newHead.X = lastHead.X; newHead.Y = lastHead.Y - _bodyBlock.Width; break; case Direction.Down: newHead.X = lastHead.X; newHead.Y = lastHead.Y + _bodyBlock.Width; break; case Direction.Left: newHead.X = lastHead.X - _bodyBlock.Width; newHead.Y = lastHead.Y; break; case Direction.Right: newHead.X = lastHead.X + _bodyBlock.Width; newHead.Y = lastHead.Y; break; } _parts.Add(newHead); _lastUpdatedAt = DateTime.Now; } } public void SetDirection(Direction newDirection) { if (_direction == Direction.Up && newDirection == Direction.Down) { return; } else if (_direction == Direction.Down && newDirection == Direction.Up) { return; } else if (_direction == Direction.Left && newDirection == Direction.Right) { return; } else if (_direction == Direction.Right && newDirection == Direction.Left) { return; } _direction = newDirection; } public bool IsEating(Apple apple) { if (_parts.Last().Intersects(apple.Location)) { GrowBiggerAndFaster(); return true; } return false; } private void GrowBiggerAndFaster() { _parts.Insert(0, _lastTail); _moveDelay -= (_moveDelay / 100)*2; } } } Apple.cs : using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework; namespace Snakez { public class Apple { private readonly int _maxWidth, _maxHeight; private readonly Texture2D _texture; private readonly Random random = new Random(); public Rectangle Location { get; private set; } public Apple(int screenWidth, int screenHeight, Texture2D texture) { _maxWidth = (screenWidth + 1) - texture.Width; _maxHeight = (screenHeight + 1) - texture.Height; _texture = texture; Place(); } public void Place() { Location = GetRandomLocation(_maxWidth, _maxHeight); } private Rectangle GetRandomLocation(int maxWidth, int maxHeight) { // x and y -- multiple of 20 int x = random.Next(1, maxWidth); var leftOver = x % 20; x = x - leftOver; int y = random.Next(1, maxHeight); leftOver = y % 20; y = y - leftOver; return new Rectangle(x, y, _texture.Width, _texture.Height); } public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(_texture, Location, Color.White); } } }

    Read the article

  • How can I get cross-browser consistent behavior for TR heights within a table with a set height? [migrated]

    - by Dan
    I have an arbitrary number of tables with an arbitrary number of rows in each, and all tables are the same height. My initial approach was to just set the overall height of the table and hope the rows were smart enough to distribute themselves appropriately. That's not the case. I have 4 different behaviors going on with 4 browsers, but I need them to all render at the very least in a similar way. Safari & Chrome (WebKit): All rows are equal height, creating scroll bars as needed and fitting within table height. Firefox: All rows are the height necessary to fit their content, with the remaining rows overflowing out of the table. Additionally, If the content of the rows does not take up all of the height, only the part of the table with content in it takes the background (though it seems, through use of Firebug, that the actual table [and TR] extend to the bottom of the proper table height). IE: All rows are the height necessary to fit their content, with the remaining rows overflowing out of the table. Obviously this only includes one version of each browser and additional variation would likely appear with more being tested. Ideally, a solution where the browser renders TRs with less content smaller than those with larger content, while still using scrolling within the variable height TRs when the overall height of the table is not enough would be optimum. I could potentially see a solution to achieve that with JS, but can it be done with CSS? Or, if not, can the behavior that WebKit displays be made to work across the browsers? Thanks! PS: Example can be found here.

    Read the article

  • Can Mailchimp APIs be used to send templated transaction email triggered by actions on my website?

    - by HenryW
    I am currently playing around with Mailchimp's APIs, but the documentation to me is not very clear. Here is what I actually want: Have the templates I created on Mailchimp, be visible on my own server. Assign each template I made to a specific action (logged in,subscribed, created order, or new password). This is functionality that I already tested with Mandrill, but the template exists on mandrill's account. If option 1 is not possible, can I still make my own template in my own environment, and send that template out over Mailchimp or Mandrill? Should I use Mailchimps services for this or send the email directly from my own server? Curent used function: function tep_mandrill_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { if (SEND_EMAILS != 'true') return false; $uri = 'https://mandrillapp.com/api/1.0/messages/send-template.json'; $postString = '{ "key": "xxxxxxxxxxx", "template_name": "sometemplatename", "template_content": [ { "name": "header", "content": "*|HEADERSTUFF|*" }, { "name": "main", "content": "*|CONTENTSTUFF|*" }, { "name": "footer", "content": "*|FOOTERSTUFF|*" } ], "message": { "subject": "'.$email_subject.'", "from_email": "'.$from_email_adress.'", "from_name": "'.$from_email_name.'", "to": [ { "email": "'.$to_email_address.'", "name": "'.$to_name.'" } ], "important": false, "track_opens": true, "merge": true, "merge_vars": [ { "rcpt": "'.$to_email_address.'", "vars": [ { "name": "HEADERSTUFF", "content": "'.$email_subject.'" }, { "name": "CONTENTSTUFF", "content": "'.$email_text.'" }, { "name": "FOOTERSTUFF", "content": "paulvale-foot" } ] } ], "tags": [ "password_forgotten" ] }, "async": false, "ip_pool": "Main Pool" }'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $uri); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); curl_exec($ch); }

    Read the article

  • Reminder: For a Complete View Of Your Concurrent Processing Take A Look At The CP Analyzer!

    - by LuciaC
    For a complete view of your Concurrent Processing take a look at the CP Analyzer!  Doc ID 1411723.1 has the script to download and a 9 min video. The Concurrent Processing Analyzer is a Self-Service Health-Check script which reviews the overall Concurrent Processing Footprint, analyzes the current configurations and settings for the environment providing feedback and recommendations on Best Practices.This is a non-invasive script which provides recommended actions to be performed on the instance it was run on.  For production instances, always apply any changes to a recent clone to ensure an expected outcome. E-Business Applications Concurrent Processing Analyzer Overview E-Business Applications Concurrent Request Analysis E-Business Applications Concurrent Manager Analysis Identifies Concurrent System Setup and configurations Identifies and recommends Concurrent Best Practices Easy to add Tool for regular Concurrent Maintenance Execute Analysis anytime to compare trending from past outputs Feedback welcome!

    Read the article

  • What classes are useful for an aspiring software developer? [closed]

    - by Anonymouse
    I'm a freshman in college trying to graduate in 3 years with a Math/CS dual major, and I don't have a lot of time to be fooling around with useless classes. I've tested out of most of my gen eds and science-y courses, but I need to know: what math and cs courses are most important for someone interested in algorithm development? Math courses already taken: Calc I-III,Linear Algebra, Discrete Math. CS courses taken: Java. Math courses I'm planning to take: ODE, Linear Algebra II, Vector calc, Logic, (Analysis or Algebra), Stats, probability CS courses I'm planning to take: C(required), Data Structures, Numerical Methods, Intro to Analysis of Algorithms. Which is better, analysis or algebra? Did I take enough CS courses? Am I missing out on anything? Thanks.

    Read the article

  • would it be bad to put <span> tags within the <head>, for grouping meta data in schema.org format?

    - by hdavis84
    Alright, I'm currently practicing schema.org microdata, and trying to find the best route for every site I build. I have found that i can piggyback itemprops on open graph meta tags. I would like to piggyback more itemprops on opengraph meta tags. However, schema.org requires you to change itemtypes to define all aspects of a "thing". Say I'm defining a LocalBusiness. Open graph has street address, locality, and region i'd like to piggyback on. I'd have to do something like: <html lang="en" itemscope itemtype="http://schema.org/LocalBusiness"> <head> ... <meta itemprop="name" content="Business Name" /> <meta property="og:url" itemprop="url" content="http://example.com" /> <meta property="og:image" itemprop="image" content="http://example.com/logo.png" /> <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <meta property="og:street-address" itemprop="streetAddress" content="1234 Amazing Rd." /> <meta property="og:locality" itemprop="addressLocality" content="Greenfield" /> <meta property="og:region" itemprop="addressRegion" content="IN" /> </span> </head> Although there's more that can be added in, this is enough of an example to show what I'm trying to achieve. I've searched the web to see if it is an issue to use spans in the head or not, because I don't want invalid markup. I know I can mark up the address information in the body of the pages, but the route above would be more efficient. Does anyone have an answer for this?

    Read the article

  • Need a Holistic view of your Concurrent Processing? Choose CP Analyzer

    - by user793044
    The Concurrent Processing Analyzer is a Self-Service Health-Check script which reviews the overall Concurrent Processing Footprint, analyzes the current configurations and settings for the environment providing feedback and recommendations on Best Practices. This is a non-invasive script which provides recommended actions to be performed on the instance it was run on.  For production instances, always apply any changes to a recent clone to ensure an expected outcome. Benefits include: E-Business Applications Concurrent Processing Analyzer Overview E-Business Applications Concurrent Request Analysis E-Business Applications Concurrent Manager Analysis Identifies Concurrent System Setup and configurations Identifies and recommends Concurrent Best Practices Easy to add Tool for regular Concurrent Maintenance Execute Analysis anytime to compare trending from past outputs Go to Doc ID 1411723.1 for more details and script download. Feedback welcome!

    Read the article

  • strange 404 errors

    - by user1400532
    i have this website thinkmovie.in recently i enabled cloudfare along with maxcdn. When i look at my server logs, i see these strange 404 errors for many of the files. for eg: http://thinkmovie.in/img/content/15062012faith/thumbs/model_fai12e8th_latest_photoshoot_10.jpg But the actual url is http://thinkmovie.in/img/content/15062012faith/thumbs/model_faith_latest_photoshoot_10.jpg refer_url: http://www.thinkmovie.in/gallery/ It means the term "model_faith" is replaced by "model_fai12e8th" and one more http://thinkmovie.in/image.php/?offset=1&height=120&width=144&cropratio=1.2:1%E2%84%91=/img/content/07052012pranitha/pranitha_hot_in_saguni_movie_press_meet_0.jpg?offset=1&height=120&width=144&cropratio=1.2:1%E2%84%91=/img/content/07052012pranitha/pranitha_hot_in_saguni_movie_press_meet_0.jpg actual url http://thinkmovie.finalytics.in/image.php/?offset=1&height=120&width=144&cropratio=1.2:1%E2%84%91=/img/content/07052012pranitha/pranitha_hot_in_saguni_movie_press_meet_0.jpg?offset=1&height=120&width=144&cropratio=1.2:1&image=/img/content/07052012pranitha/pranitha_hot_in_saguni_movie_press_meet_0.jpg refer_url: http://www.thinkmovie.in/gallery/hotactress/album/pranitha_hot_stills_19012012pranitha/ {&image replaced by %E2%84%91} I'm not able to understand how this is happening. I checked my code server times. And I am not able to replicate this problem from my browser. Please help me.

    Read the article

  • using apple-mobile-web-app-capable and cache.manifest issue [migrated]

    - by LocoMike
    So I have this simple html file <!DOCTYPE HTML> <html manifest="cache.manifest"><head> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <title>Test</title> <meta http-equiv="content-type" content="text/html"> <meta name="HandheldFriendly" content="true"> <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <style type="text/css"></style></head> <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> <h1>hello</h1> </body> </html> My cache.manifest is simply CACHE MANIFEST I run this website on my local server (localhost). I load it from iphone safari and it works fine. I then stop the server and load it again, and it works, because the offline cache is doing its job. However... if I save the website as a start icon in the iphone dashboard, and then I try to open it with the server stopped it won't load. However... if I open it with the server running at least once (it will work) then I can open it later without problem. It looks like even though the page was cached in safari, it is not cached in this saved app. Anybody knows how to get around this? Thank you!

    Read the article

  • jQuery JSON encode set of input values

    - by gurun8
    I need tp serialize a group of input elements but I can't for the life of me figure out this simple task. I can successfully iterate through the targeted inputs using: $("#tr_Features :input").each(function() { ... } Here's my code, that doesn't work: var features = new Array(); $("#tr_Features :input").each(function() { features += {$(this).attr("name"): $(this).val()}; } Serializing the entire form won't give me what I need. The form has much more than this subset of inputs. This seems like it should be a pretty straightforward task but apparently programming late into a Friday afternoon isn't a good thing. If it's helpful, here's the form inputs I'm targeting: <table cellspacing="0" border="0" id="TblGrid_list" class="EditTable" cellpading="0"> <tbody><tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Cable Family</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:8" name="feature_id:8"></td> </tr> <tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Material</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:9" name="feature_id:9"></td> </tr> <tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Thread Size</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:10" name="feature_id:10"></td> </tr> <tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Attachment Style</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:11" name="feature_id:11"></td> </tr> <tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Feature</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:12" name="feature_id:12"></td> </tr> <tr id="tr_Features" class="FormData" rowpos="1"> <td class="CaptionTD ui-widget-content">Comments</td> <td id="td_Features" class="DataTD ui-widget-content" style="white-space: pre;">&nbsp;<input type="text" value="" id="feature_id:13" name="feature_id:13"></td> </tr> </tbody></table>

    Read the article

  • In C, during step by step debugging in a function, how can i view the content of an array in the "Autos?" window along with the other variables?

    - by AppsAndGo
    I'm using VS 2012, and I'm working on a bubble sort. After searching I found a nifty trick to see the content of the array in the "Watch 1" tab, (How to view contents of an array while debugging in Code Blocks?), but going from "watch 1" to "Autos" every step to see what's changing in the array isn't practical at all. How can i see the array content within "Autos" along side my other changing variables, where i need it to show?

    Read the article

  • ASP.NET MVC - dropdown list post handling problem

    - by ile
    I've had troubles for a few days already with handling form that contains dropdown list. I tried all that I've learned so far but nothing helps. This is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using CMS; using CMS.Model; using System.ComponentModel.DataAnnotations; namespace Portal.Models { public class ArticleDisplay { public ArticleDisplay() { } public int CategoryID { set; get; } public string CategoryTitle { set; get; } public int ArticleID { set; get; } public string ArticleTitle { set; get; } public DateTime ArticleDate; public string ArticleContent { set; get; } } public class HomePageViewModel { public HomePageViewModel(IEnumerable<ArticleDisplay> summaries, Article article) { this.ArticleSummaries = summaries; this.NewArticle = article; } public IEnumerable<ArticleDisplay> ArticleSummaries { get; private set; } public Article NewArticle { get; private set; } } public class ArticleRepository { private DB db = new DB(); // // Query Methods public IQueryable<ArticleDisplay> FindAllArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID orderby article.Date descending select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public IQueryable<ArticleDisplay> FindTodayArticles() { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where article.Date == DateTime.Today select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } public Article GetArticle(int id) { return db.Articles.SingleOrDefault(d => d.ArticleID == id); } public IQueryable<ArticleDisplay> DetailsArticle(int id) { var result = from category in db.ArticleCategories join article in db.Articles on category.CategoryID equals article.CategoryID where id == article.ArticleID select new ArticleDisplay { CategoryID = category.CategoryID, CategoryTitle = category.Title, ArticleID = article.ArticleID, ArticleTitle = article.Title, ArticleDate = article.Date, ArticleContent = article.Content }; return result; } // // Insert/Delete Methods public void Add(Article article) { db.Articles.InsertOnSubmit(article); } public void Delete(Article article) { db.Articles.DeleteOnSubmit(article); } // // Persistence public void Save() { db.SubmitChanges(); } } } using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Portal.Models; using CMS.Model; namespace Portal.Areas.CMS.Controllers { public class ArticleController : Controller { ArticleRepository articleRepository = new ArticleRepository(); ArticleCategoryRepository articleCategoryRepository = new ArticleCategoryRepository(); // // GET: /Article/ public ActionResult Index() { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); Article article = new Article() { Date = DateTime.Now, CategoryID = 1 }; HomePageViewModel homeData = new HomePageViewModel(articleRepository.FindAllArticles().ToList(), article); return View(homeData); } // // GET: /Article/Details/5 public ActionResult Details(int id) { var article = articleRepository.DetailsArticle(id).Single(); if (article == null) return View("NotFound"); return View(article); } // // GET: /Article/Create //public ActionResult Create() //{ // ViewData["categories"] = new SelectList // ( // articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" // ); // Article article = new Article() // { // Date = DateTime.Now, // CategoryID = 1 // }; // return View(article); //} // // POST: /Article/Create [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Article article) { if (ModelState.IsValid) { try { // TODO: Add insert logic here articleRepository.Add(article); articleRepository.Save(); return RedirectToAction("Index"); } catch { return View(article); } } else { return View(article); } } // // GET: /Article/Edit/5 public ActionResult Edit(int id) { ViewData["categories"] = new SelectList ( articleCategoryRepository.FindAllCategories().ToList(), "CategoryId", "Title" ); var article = articleRepository.GetArticle(id); return View(article); } // // POST: /Article/Edit/5 [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection collection) { Article article = articleRepository.GetArticle(id); try { // TODO: Add update logic here UpdateModel(article, collection.ToValueProvider()); articleRepository.Save(); return RedirectToAction("Details", new { id = article.ArticleID }); } catch { return View(article); } } // // HTTP GET: /Article/Delete/1 public ActionResult Delete(int id) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); else return View(article); } // // HTTP POST: /Article/Delete/1 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Delete(int id, string confirmButton) { Article article = articleRepository.GetArticle(id); if (article == null) return View("NotFound"); articleRepository.Delete(article); articleRepository.Save(); return View("Deleted"); } [ValidateInput(false)] public ActionResult UpdateSettings(int id, string value, string field) { // This highly-specific example is from the original coder's blog system, // but you can substitute your own code here. I assume you can pick out // which text field it is from the id. Article article = articleRepository.GetArticle(id); if (article == null) return Content("Error"); if (field == "Title") { article.Title = value; UpdateModel(article, new[] { "Title" }); articleRepository.Save(); } if (field == "Content") { article.Content = value; UpdateModel(article, new[] { "Content" }); articleRepository.Save(); } if (field == "Date") { article.Date = Convert.ToDateTime(value); UpdateModel(article, new[] { "Date" }); articleRepository.Save(); } return Content(value); } } } and view: <%@ Page Title="" Language="C#" MasterPageFile="~/Areas/CMS/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Portal.Models.HomePageViewModel>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <div class="naslov_poglavlja_main">Articles Administration</div> <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %> <% using (Html.BeginForm("Create","Article")) {%> <div class="news_forma"> <label for="Title" class="news">Title:</label> <%= Html.TextBox("Title", "", new { @class = "news" })%> <%= Html.ValidationMessage("Title", "*") %> <label for="Content" class="news">Content:</label> <div class="textarea_okvir"> <%= Html.TextArea("Content", "", new { @class = "news" })%> <%= Html.ValidationMessage("Content", "*")%> </div> <label for="CategoryID" class="news">Category:</label> <%= Html.DropDownList("CategoryId", (IEnumerable<SelectListItem>)ViewData["categories"], new { @class = "news" })%> <p> <input type="submit" value="Publish" class="form_submit" /> </p> </div> <% } %> <div class="naslov_poglavlja_main"><%= Html.ActionLink("Write new article...", "Create") %></div> <div id="articles"> <% foreach (var item in Model.ArticleSummaries) { %> <div> <div class="naslov_vijesti" id="<%= item.ArticleID %>"><%= Html.Encode(item.ArticleTitle) %></div> <div class="okvir_vijesti"> <div class="sadrzaj_vijesti" id="<%= item.ArticleID %>"><%= item.ArticleContent %></div> <div class="datum_vijesti" id="<%= item.ArticleID %>"><%= Html.Encode(String.Format("{0:g}", item.ArticleDate)) %></div> <a class="news_delete" href="#" id="<%= item.ArticleID %>">Delete</a> </div> <div class="dno"></div> </div> <% } %> </div> </asp:Content> When trying to post new article I get following error: System.InvalidOperationException: The ViewData item that has the key 'CategoryId' is of type 'System.Int32' but must be of type 'IEnumerable'. I really don't know what to do cause I'm pretty new to .net and mvc Any help appreciated! Ile EDIT: I found where I made mistake. I didn't include date. If in view form I add this line I'm able to add article: <%=Html.Hidden("Date", String.Format("{0:g}", Model.NewArticle.Date)) %> But, if I enter wrong datetype or leave title and content empty then I get the same error. In this eample there is no need for date edit, but I will need it for some other forms and validation will be necessary. EDIT 2: Error happens when posting! Call stack: App_Web_of9beco9.dll!ASP.areas_cms_views_article_create_aspx.__RenderContent2(System.Web.UI.HtmlTextWriter __w = {System.Web.UI.HtmlTextWriter}, System.Web.UI.Control parameterContainer = {System.Web.UI.WebControls.ContentPlaceHolder}) Line 31 + 0x9f bytes C#

    Read the article

  • XNA 3D model collision is inaccurate

    - by Daniel Lopez
    I am creating a classic game in 3d that deals with asteriods and you have to shoot them and avoid being hit from them. I can generate the asteroids just fine and the ship can shoot bullets just fine. But the asteroids always hit the ship even it doesn't look they are even close. I know 2D collision very well but not 3D so can someone please shed some light to my problem. Thanks in advance. Code For ModelRenderer: using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace _3D_Asteroids { class ModelRenderer { private float aspectratio; private Model model; private Vector3 camerapos; private Vector3 modelpos; private Matrix rotationy; float radiansy = 0; private bool isalive; public ModelRenderer(Model m, float AspectRatio, Vector3 initial_pos, Vector3 initialcamerapos) { isalive = true; model = m; if (model.Meshes.Count == 0) { throw new Exception("Invalid model because it contains zero meshes!"); } modelpos = initial_pos; camerapos = initialcamerapos; aspectratio = AspectRatio; return; } public float RadiusOfSphere { get { return model.Meshes[0].BoundingSphere.Radius; } } public BoundingBox BoxBounds { get { return BoundingBox.CreateFromSphere(model.Meshes[0].BoundingSphere); } } public BoundingSphere SphereBounds { get { return model.Meshes[0].BoundingSphere; } } public Vector3 CameraPosition { set { camerapos = value; } get { return camerapos; } } public bool IsAlive { get { return isalive; } } public Vector3 ModelPosition { set { modelpos = value; } get { return modelpos; } } public void RotateY(float radians) { radiansy += radians; rotationy = Matrix.CreateRotationY(radiansy); } public Matrix RotationY { set { rotationy = value; } get { return rotationy; } } public float AspectRatio { set { aspectratio = value; } get { return aspectratio; } } public void Kill() { isalive = false; } public void Draw(float scale) { Matrix world; if (rotationy == new Matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) { world = Matrix.CreateScale(scale) * Matrix.CreateTranslation(modelpos); } else { world = rotationy * Matrix.CreateScale(scale) * Matrix.CreateTranslation(modelpos); } Matrix view = Matrix.CreateLookAt(camerapos, Vector3.Zero, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), this.AspectRatio, 1f, 100000f); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = world; effect.View = view; effect.Projection = projection; } mesh.Draw(); } } public void Draw() { Matrix world; if (rotationy == new Matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) { world = Matrix.CreateTranslation(modelpos); } else { world = rotationy * Matrix.CreateTranslation(modelpos); } Matrix view = Matrix.CreateLookAt(camerapos, Vector3.Zero, Vector3.Up); Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), this.AspectRatio, 1f, 100000f); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.World = world; effect.View = view; effect.Projection = projection; } mesh.Draw(); } } } Code For Game1: using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace _3D_Asteroids { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; int score = 0, lives = 5; SpriteBatch spriteBatch; GameState gstate = GameState.OnMenuScreen; Menu menu = new Menu(Color.Yellow, Color.White); SpriteFont font; Texture2D background; ModelRenderer ship; Model b, a; List<ModelRenderer> bullets = new List<ModelRenderer>(); List<ModelRenderer> asteriods = new List<ModelRenderer>(); float time = 0.0f; int framecount = 0; SoundEffect effect; public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 796; graphics.ApplyChanges(); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load<SpriteFont>("Fonts\\Lucida Console"); background = Content.Load<Texture2D>("Textures\\B1_stars"); Model p1 = Content.Load<Model>("Models\\p1_wedge"); b = Content.Load<Model>("Models\\pea_proj"); a = Content.Load<Model>("Models\\asteroid1"); effect = Content.Load<SoundEffect>("Audio\\tx0_fire1"); ship = new ModelRenderer(p1, GraphicsDevice.Viewport.AspectRatio, new Vector3(0, 0, 0), new Vector3(0, 0, 9000)); } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { KeyboardState state = Keyboard.GetState(PlayerIndex.One); switch (gstate) { case GameState.OnMenuScreen: { if (state.IsKeyDown(Keys.Enter)) { switch (menu.SelectedChoice) { case MenuChoices.Play: { gstate = GameState.GameStarted; break; } case MenuChoices.Exit: { this.Exit(); break; } } } if (state.IsKeyDown(Keys.Down)) { menu.MoveSelectedMenuChoiceDown(gameTime); } else if(state.IsKeyDown(Keys.Up)) { menu.MoveSelectedMenuChoiceUp(gameTime); } else { menu.KeysReleased(); } break; } case GameState.GameStarted: { foreach (ModelRenderer bullet in bullets) { if (bullet.ModelPosition.X < (ship.ModelPosition.X + 4000) && bullet.ModelPosition.Z < (ship.ModelPosition.X + 4000) && bullet.ModelPosition.X > (ship.ModelPosition.Z - 4000) && bullet.ModelPosition.Z > (ship.ModelPosition.Z - 4000)) { bullet.ModelPosition += (bullet.RotationY.Forward * 120); } else if (collidedwithasteriod(bullet)) { bullet.Kill(); } else { bullet.Kill(); } } foreach (ModelRenderer asteroid in asteriods) { if (ship.SphereBounds.Intersects(asteroid.BoxBounds)) { lives -= 1; asteroid.Kill(); // This always hits no matter where the ship goes. } else { asteroid.ModelPosition -= (asteroid.RotationY.Forward * 50); } } for (int index = 0; index < asteriods.Count; index++) { if (asteriods[index].IsAlive == false) { asteriods.RemoveAt(index); } } for (int index = 0; index < bullets.Count; index++) { if (bullets[index].IsAlive == false) { bullets.RemoveAt(index); } } if (state.IsKeyDown(Keys.Left)) { ship.RotateY(0.1f); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Right)) { ship.RotateY(-0.1f); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Up)) { ship.ModelPosition += (ship.RotationY.Forward * 50); if (state.IsKeyDown(Keys.Space)) { if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0; } } else if (state.IsKeyDown(Keys.Space)) { time += gameTime.ElapsedGameTime.Milliseconds; if (time < 17) { firebullet(); //effect.Play(); } } else { time = 0.0f; } if ((framecount % 60) == 0) { createasteroid(); framecount = 0; } framecount++; break; } } base.Update(gameTime); } void firebullet() { if (bullets.Count < 3) { ModelRenderer bullet = new ModelRenderer(b, GraphicsDevice.Viewport.AspectRatio, ship.ModelPosition, new Vector3(0, 0, 9000)); bullet.RotationY = ship.RotationY; bullets.Add(bullet); } } void createasteroid() { if (asteriods.Count < 2) { Random random = new Random(); float z = random.Next(-13000, -11000); float x = random.Next(-9000, -8000); Random random2 = new Random(); int degrees = random.Next(0, 45); float radians = MathHelper.ToRadians(degrees); ModelRenderer asteroid = new ModelRenderer(a, GraphicsDevice.Viewport.AspectRatio, new Vector3(x, 0, z), new Vector3(0,0, 9000)); asteroid.RotateY(radians); asteriods.Add(asteroid); } } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); switch (gstate) { case GameState.OnMenuScreen: { spriteBatch.Begin(); spriteBatch.Draw(background, Vector2.Zero, Color.White); menu.DrawMenu(ref spriteBatch, font, new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2) - new Vector2(50f), 100f); spriteBatch.End(); break; } case GameState.GameStarted: { spriteBatch.Begin(); spriteBatch.Draw(background, Vector2.Zero, Color.White); spriteBatch.DrawString(font, "Score: " + score.ToString() + "\nLives: " + lives.ToString(), Vector2.Zero, Color.White); spriteBatch.End(); ship.Draw(); foreach (ModelRenderer bullet in bullets) { bullet.Draw(); } foreach (ModelRenderer asteroid in asteriods) { asteroid.Draw(0.1f); } break; } } base.Draw(gameTime); } bool collidedwithasteriod(ModelRenderer bullet) { foreach (ModelRenderer asteroid in asteriods) { if (bullet.SphereBounds.Intersects(asteroid.BoxBounds)) { score += 10; asteroid.Kill(); return true; } } return false; } } } }

    Read the article

  • lucene query issue

    - by Sunil
    I am using Lucene with Alfresco. Here is my query: ( TYPE:"{com.company.customised.content.model}test" && (@\{com.company.customised.content.model\}testNo:111 && (@\{com.company.customised.content.model\}skill:or)) I have to search documents which are having property skill of value "or". The above query is not giving any results (I am getting failed to parse query). If I use the query up until testNo (ignoring skill), I am getting proper results: ( TYPE:"{com.company.customised.content.model}test" && (@\{com.company.customised.content.model\}testNo:111)) Can you please help me? Thanks

    Read the article

  • How does NameScope in WPF works ?

    - by Nicolas Dorier
    I'm having a strange behavior with NameScopes in WPF, I have created a CustomControl called FadingPopup which is a child class of Window with nothing special inside. <Window.Resources> <local:FadingPopup> <Button Name="prec" Content="ahah"></Button> <Button Content="{Binding ElementName=prec, Path=Content}"></Button> </local:FadingPopup> </Window.Resources> In this snippet, the binding doesn't work (always empty). If I move these buttons from the resources to the content of the window like this : <Window ...> <Button Name="prec" Content="ahah"></Button> <Button Content="{Binding ElementName=prec, Path=Content}"></Button> </Window> The binding works as expected. Now, I have tried a mix between these two snippets : <Window...> <Window.Resources> <local:FadingPopup> <Button Name="prec" Content="Haha"></Button> </local:FadingPopup> </Window.Resources> <Button Content="{Binding ElementName=prec, Path=Content}"></Button> </Window> It works as well. Apparently, if the button prec is in the resources it registers itself in the NameScope of the Window. BUT, it seems that the Binding tries to resolve ElementName with the NameScope of the FadingPopup (which is null), thus the binding doesn't work... My first snipped works well if I specify a NameScope in my class FadingPopup : static FadingPopup() { NameScope.NameScopeProperty.OverrideMetadata(typeof(FadingPopup), new PropertyMetadata(new NameScope())); } But I don't like this solution because I don't understand why, in the first snippet, prec is registered in the NameScope of Window, but ElementName is resolved with the NameScope of FadingGroup (which is null by default)... Does someone can explain to me what is going on ? Why my first snippet doesn't work, if I don't specify a default NameScope for FadingGroup ?

    Read the article

  • working as expectedJQuery load function with fading effects not working as expected

    - by Roland
    I have the following scenario jQuery('#content').fadeOut('slow',function(){ jQuery('#content').load("detail.php?product="+imgID+"&category="+cat); jQuery('#content').fadeIn('fast'); }); My problem however is that all the effects happen and when the effects are done, then only the contents of the PHP file loads into content, is there a better way so that the content is not slow in loading

    Read the article

  • How to successfully implement og:image for the LinkedIn

    - by Sabo
    THE PROBLEM: I am trying, without much success, to implement open graph image on site: http://www.guarenty-group.com/cz/ The homepage is completeply bypassing the og:image tag, where internal pages are reading all images from the site and place og:image as the last option. Other social networks are working fine on both internal pages and homepage. THE CONFIGURATION: I have no share buttons or alike, all I want is to be able to share the link via my profile. The image is well over 300x300px: http://guarenty-group.com/img/gg_seal.png Here is how my head tag looks like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Guarenty Group : Pojištení pro nájemce a pronajímatelé</title> <meta name="keywords" content="" /> <meta name="description" content="Guarenty Group pojištuje príjem z nájmu pronajímatelum, kauci nájemcum - aby nemuseli platit velkou cástku v hotovostí predem - a dále nájemcum pojištuje príjmy, aby meli na nájem pri nemoci, úrazu ci nezamestnání." /> <meta name="image_src" content="http://guarenty-group.com/img/gg_seal.png" /> <meta name="image_url" content="http://guarenty-group.com/img/gg_seal.png" /> <meta property="og:title" content="Pojištení pro nájemce a pronajímatelé" /> <meta property="og:url" content="http://guarenty-group.com/cz/" /> <meta property="og:image" content="http://guarenty-group.com/img/gg_seal.png" /> <meta property="og:description" content="Guarenty Group pojištuje príjem z nájmu pronajímatelum, kauci nájemcum - aby nemuseli platit velkou cástku v hotovostí predem - a dále nájemcum pojištuje príjmy, aby meli na nájem pri nemoci, úrazu ci nezamestnání [...]" /> ... </head> THE TESTING RESULTS: In order to trick the cache i have tested the site with http://www.guarenty-group.com/cz/?try=N, where I have changed the N every time. The strange thing is that images found for different value of N is different. Sometimes there is no image, sometimes there is 1, 2 or 3 images, but each time there is a different set of images. But, in any case I could not find the image specified in the og:graph! MY QUESTIONS: https://developer.linkedin.com/documents/setting-display-tags-shares is saying one thing, and the personnel on the support forum is saying "over 300" Does anyone know What is the official minimum dimension of the image (both w and h)? Can an image be too large? Should I use the xmlns, should I not use xmlns or it doesn't matter? What are the maximum (and minimum) lengths for og:title and og:description tags? Any other suggestion is of course welcomed :) Thanks in advance, cheers~

    Read the article

  • Different behaviour using unidirectional or bidirectional relation

    - by sinuhepop
    I want to persist a mail entity which has some resources (inline or attachment). First I related them as a bidirectional relation: @Entity public class Mail extends BaseEntity { @OneToMany(mappedBy = "mail", cascade = CascadeType.ALL, orphanRemoval = true) private List<MailResource> resource; private String receiver; private String subject; private String body; @Temporal(TemporalType.TIMESTAMP) private Date queued; @Temporal(TemporalType.TIMESTAMP) private Date sent; public Mail(String receiver, String subject, String body) { this.receiver = receiver; this.subject = subject; this.body = body; this.queued = new Date(); this.resource = new ArrayList<>(); } public void addResource(String name, MailResourceType type, byte[] content) { resource.add(new MailResource(this, name, type, content)); } } @Entity public class MailResource extends BaseEntity { @ManyToOne(optional = false) private Mail mail; private String name; private MailResourceType type; private byte[] content; } And when I saved them: Mail mail = new Mail("[email protected]", "Hi!", "..."); mail.addResource("image", MailResourceType.INLINE, someBytes); mail.addResource("documentation.pdf", MailResourceType.ATTACHMENT, someOtherBytes); mailRepository.save(mail); Three inserts were executed: INSERT INTO MAIL (ID, BODY, QUEUED, RECEIVER, SENT, SUBJECT) VALUES (?, ?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE, MAIL_ID) VALUES (?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE, MAIL_ID) VALUES (?, ?, ?, ?, ?) Then I thought it would be better using only a OneToMany relation. No need to save which Mail is in every MailResource: @Entity public class Mail extends BaseEntity { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name = "mail_id") private List<MailResource> resource; ... public void addResource(String name, MailResourceType type, byte[] content) { resource.add(new MailResource(name, type, content)); } } @Entity public class MailResource extends BaseEntity { private String name; private MailResourceType type; private byte[] content; } Generated tables are exactly the same (MailResource has a FK to Mail). The problem is the executed SQL: INSERT INTO MAIL (ID, BODY, QUEUED, RECEIVER, SENT, SUBJECT) VALUES (?, ?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE) VALUES (?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE) VALUES (?, ?, ?, ?) UPDATE MAILRESOURCE SET mail_id = ? WHERE (ID = ?) UPDATE MAILRESOURCE SET mail_id = ? WHERE (ID = ?) Why this two updates? I'm using EclipseLink, will this behaviour be the same using another JPA provider as Hibernate? Which solution is better?

    Read the article

  • How to add ads to the end of RSS on wordpress?

    - by zeina
    I have added a function to functions.php on my theme. function insertAds($content) { $content = $content.' add goes here'; return $content;} add_filter('the_content_feed', 'insertAds'); add_filter('the_excerpt_rss', 'insertAds'); The problem is that I'm having the add displayed under each content, and not at the end of the rss page. How can I fix that?

    Read the article

  • how to send some data to the Thread module on python and google-map-engine

    - by zjm1126
    from google.appengine.ext import db class Log(db.Model): content = db.StringProperty(multiline=True) class MyThread(threading.Thread): def run(self,request): #logs_query = Log.all().order('-date') #logs = logs_query.fetch(3) log=Log() log.content=request.POST.get('content',None) log.put() def Log(request): thr = MyThread() thr.start(request) return HttpResponse('') error is : Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner self.run() File "D:\zjm_code\helloworld\views.py", line 33, in run log.content=request.POST.get('content',None) NameError: global name 'request' is not defined

    Read the article

  • Patterns for dynamic CMS components (event driven?)

    - by CitrusTree
    Sorry my title is not great, this is my first real punt at moving 100% to OO as I've been procedural for more years than I can remember. I'm finding it hard to understand if what I'm trying to do is possible. Depending on people's thoughts on the 2 following points, I'll go down that route. The CMS I'm putting together is quote small, however focuses very much on different types of content. I could easily use Drupal which I'm very comfortable with, but I want to give myself a really good reasons to move myself into design patterns / OO-PHP 1) I have created a base 'content' class which I wish to be able to extend to handle different types of content. The base class, for example, handles HTML content, and extensions might handle XML or PDF output instead. On the other hand, at some point I may wish to extend the base class for a given project completely. I.e. if class 'content-v2' extended class 'content' for that site, any calls to that class should actually call 'content-v2' instead. Is that possible? If the code instantiates an object of type 'content' - I actually want it to instantiate one of type 'content-v2'... I can see how to do it using inheritance, but that appears to involve referring to the class explicitly, I can't see how to link the class I want it to use instead dynamically. 2) Secondly, the way I'm building this at the moment is horrible, I'm not happy with it. It feels very linear indeed - i.e. get session details get content build navigation theme page publish. To do this all the objects are called 1-by-1 which is all very static. I'd like it to be more dynamic so that I can add to it at a later date (very closely related to first question). Is there a way that instead of my orchestrator class calling all the other classes 1-by-1, then building the whole thing up at the end, that instead each of the other classes can 'listen' for specific events, then at the applicable point jump in and do their but? That way the orchestrator class would not need to know what other classes were required, and call them 1-by-1. Sorry if I've got this all twisted in my head. I'm trying to build this so it's really flexible.

    Read the article

  • log in and send sms with java

    - by noobed
    I'm trying to log into a site and afterwards to send a SMS (you can do that for free by the site - it's nothing more than just enter some text into some fields and 'submit'). I've used wireshark to track some of the post/get requests that my machine has been exchanging with the server - when using the browser. I'd like to paste some of my Java code: URL url; String urlP = "maccount=myRawUserName7&" + "mpassword=myRawPassword&" + "redirect_http=http&" + "submit=........"; String urlParameters = URLEncoder.encode(urlP, "CP1251"); HttpURLConnection connection = null; // Create connection url = new URL("http://www.mtel.bg/1/mm/smscenter/mc/sendsms/ma/index/mo/1"); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); //I'm not really sure if these RequestProperties are necessary //so I'll leave them as a comment // connection.setRequestProperty("Content-Type", // "application/x-www-form-urlencoded"); // connection.setRequestProperty("Accept-Charset", "CP1251"); // connection.setRequestProperty("Content-Length", // "" + Integer.toString(urlParameters.getBytes().length)); // connection.setRequestProperty("Content-Language", "en-US"); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); // Send request DataOutputStream wr = new DataOutputStream( connection.getOutputStream()); wr.writeBytes(urlParameters); wr.flush(); wr.close(); String headerName[] = new String[10]; int count = 0; for (int i = 1; (headerName[count] = connection.getHeaderFieldKey(i)) != null; i++) { if (headerName[count].equals("Set-Cookie")) { headerName[count++] = connection.getHeaderField(i); } } //I'm not sure if I have to close the connection here or not if (connection != null) { connection.disconnect(); } //the code above should be the login part //----------------------------------------- //this is copy-pasted from wireshark's info. String smsParam="from=men&" + "sender=0&" + "msisdn=359886737498&" + "tophone=0&" + "smstext=tova+e+proba%21+1.&" + "id=&" + "sendaction=&" + "direction=&" + "msgLen=84"; url = new URL("http://www.mtel.bg/moyat-profil-sms-tsentar_3004/" + "mm/smscenter/mc/sendsms/ma/index"); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Cookie", headerName[0]); connection.setRequestProperty("Cookie", headerName[1]); //conn urlParameters = URLEncoder.encode(urlP, "CP1251"); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); wr = new DataOutputStream( connection.getOutputStream()); wr.writeBytes(urlParameters); wr.flush(); wr.close(); //I'm not rly sure what exactly to do with this response. // Get Response InputStream is = connection.getInputStream(); BufferedReader rd = new BufferedReader(new InputStreamReader(is, "CP1251")); String line; StringBuffer response = new StringBuffer(); while ((line = rd.readLine()) != null) { response.append(line); response.append('\r'); } rd.close(); System.out.println(response.toString()); if (connection != null) { connection.disconnect(); } so that's my code so far. When I execute it ... I don't receive any text on my phone - so it clearly doesn't work as supposed to. I would appreciate any guidance or remarks. Is my cookie handling wrong? Is my login method wrong? Do I pass the right URLs. Do I encode and send the parameter string correctly? Is there any addition valuable data from these POSTs I should take? P.S. just in any case let me tell you that the username and password is not real. For security reasons I don't want to give valid ones. (I think this is appropriate approach) Here are the POST requests: POST /1/mm/auth/mc/auth/ma/index/mo/1 HTTP/1.1 Host: www.mtel.bg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive Referer: http://www.mtel.bg/1/mm/smscenter/mc/sendsms/ma/index/mo/1 Cookie: __utma=209782857.541729286.1349267381.1349270269.1349274374.3; __utmc=209782857; __utmz=209782857.1349267381.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __atuvc=28%7C40; PHPSESSID=q0mage2usmv34slcv3dmd6t057; __utmb=209782857.3.10.1349274374 Content-Type: multipart/form-data; boundary=---------------------------151901450223722 Content-Length: 475 -----------------------------151901450223722 Content-Disposition: form-data; name="maccount" myRawUserName -----------------------------151901450223722 Content-Disposition: form-data; name="mpassword" myRawPassword -----------------------------151901450223722 Content-Disposition: form-data; name="redirect_https" http -----------------------------151901450223722 Content-Disposition: form-data; name="submit" ........ -----------------------------151901450223722-- HTTP/1.1 302 Found Server: nginx Date: Wed, 03 Oct 2012 14:26:40 GMT Content-Type: text/html; charset=Utf-8 Connection: close Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: /moyat-profil-sms-tsentar_3004/mm/smscenter/mc/sendsms/ma/index Content-Length: 0 The above text is vied with wireshark's follow tcp stream when pressing the log in button. POST /moyat-profil-sms-tsentar_3004/mm/smscenter/mc/sendsms/ma/index HTTP/1.1 *same as the above ones* Referer: http://www.mtel.bg/moyat-profil-sms-tsentar_3004/mm/smscenter/mc/sendsms/ma/index Cookie: __utma=209782857.541729286.1349267381.1349270269.1349274374.3; __utmc=209782857; __utmz=209782857.1349267381.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __atuvc=29%7C40; PHPSESSID=q0mage2usmv34slcv3dmd6t057; __utmb=209782857.4.10.1349274374 Content-Type: application/x-www-form-urlencoded Content-Length: 147 from=men&sender=0&msisdn=35988888888&tophone=0&smstext=this+is+some+FREE+SMS+text%21+100+char+per+sms+only%21&id=&sendaction=&direction=&msgLen=50 HTTP/1.1 302 Found Server: nginx Date: Wed, 03 Oct 2012 14:31:38 GMT Content-Type: text/html; charset=Utf-8 Connection: close Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: /moyat-profil-sms-tsentar_3004/mm/smscenter/mc/sendsms/ma/success/s/1 Content-Length: 0 The above text is when you press the send button.

    Read the article

< Previous Page | 149 150 151 152 153 154 155 156 157 158 159 160  | Next Page >