Search Results

Search found 2396 results on 96 pages for 'alex nauda'.

Page 75/96 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • reorder list elements - jQuery?

    - by Alex
    Hello, I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following: <ul> <li>Foo</li> <li>Bar</li> <li>Cheese</li> </ul> How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar. So is it possible? If so, how? Thanks!!

    Read the article

  • Save or update for FK relationship Sqlalchemy

    - by Alex
    I've googled, but haven't been able to find the answer to this seemingly simple question. I have two relations, a customer and an order. Each order is associated to a single cusomter, and therefore has a FK relationship to the customer table. The customer relation only stores customer names, and I have set a unique constraint on the customer table barring duplicate names. Let's say I create a new order instance and set a customer for the order. Something like: order_instance.customer = Customer("customer name") When I save the order instance, SqlAlchemy will complain if a customer with this name already exists in the customer table. How do I specify to SqlAlchemy to insert into the customer table if a customer with this name doesn't already exist, or just ignore (or even update) to the customer relation? I don't really want to have to check each time if a customer with some name already exists...

    Read the article

  • How to get a category listing from Magento?

    - by alex
    I want to create a page in Magento that shows a visual representation of the categories.. example CATEGORY product 1 product 2 ANOTHER CATEGORY product 3 My problem is, their database is organised very differently to what I've seen in the past. They have tables dedicated to data types like varchar, int, etc. I assume this is for performance or similiar. I haven't found a way to use MySQL to query the database and get a list of categories. I'd then like to match these categories to products, to get a listing of products for each category. Unfortunately Magento seems to make this very difficult. Also I have not found a method that will work from within a page block.. I have created showcase.phtml and put it in the XML layout and it displays and runs it's PHP code. I was hoping for something easy like looping through $this-getAllCategories(); and then a nested loop inside with something like $category-getChildProducts(); Can anyone help me? Thank you!

    Read the article

  • Running an application from an USB device...

    - by Workshop Alex
    I'm working on a proof-of-concept application, containing a WCF service with console host and client, both on a single USB device. On the same device I will also have the client application which will connect to this service. The service uses the entity framework to connect to the database, which in this POC will just return a list of names. If it works, it will be used for a larger project. Creating the client and service was easy and this works well from USB. But getting the service to connect to the database isn't. I've found this site, suggesting that I should modify machine.config but that stops the XCopy deployment. This project cannot change any setting of the PC, so this suggestion is bad. I cannot create a deployment setup either. The whole thing just needs to run from USB disk. So, how do I get it to run? (The service just selects a list of names from the database, which it returns to the client. If this POC works, it will do far more complex things!)

    Read the article

  • A Null Reference Exception

    - by Alex
    "Object reference not set to an instance of an object." using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace XNAdev { class Sprite { //The size of the Sprite public Rectangle Size; //Used to size the Sprite up or down from the original image public float Scale = 1.0f; //The current position of the Sprite public Vector2 Position = new Vector2(115, 0); //The texture object used when drawing the sprite private Texture2D mSpriteTexture; //Load the texture for the sprite using the Content Pipeline public void LoadContent(ContentManager theContentManager, string theAssetName) { mSpriteTexture = theContentManager.Load<Texture2D>(theAssetName); Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale)); } //Draw the sprite to the screen public void Draw(SpriteBatch theSpriteBatch) { theSpriteBatch.Draw(mSpriteTexture, Position, new Rectangle(0, 0, mSpriteTexture.Width, mSpriteTexture.Height), Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0); } } } I am very new at this C# so any help would be great. I have no idea what my error is.

    Read the article

  • What is the correct HTTP status code to send when a site is down for maintenance?

    - by alex
    Is there a HTTP status code to tell Google (and others) to go away, index me again later? Basically, one that semantically tells clients that the site is down for maintenance? The ones I have considered are 304 => Not modified 307 => Temporary redirect 410 => Gone 503 => Service Unavailable I'm leaning towards the last one, but was just curious as to which one was proper choice. Thanks Update Is this the correct way to send it with PHP? header('Status: 503 Service Unavailable');

    Read the article

  • script attributes

    - by Alex Ivasyuv
    Hi, I need to control some script elements, that's why I want to add class attribute to do it. But, w3c says that it's invalid. Some effect, if I add rel or id attribute. Any other ideas how I can access appropriate script tag? Doctype: XHTML 1.0 Strict Thanks,

    Read the article

  • How to reflect over T to build an expression tree for a query?

    - by Alex
    Hi all, I'm trying to build a generic class to work with entities from EF. This class talks to repositories, but it's this class that creates the expressions sent to the repositories. Anyway, I'm just trying to implement one virtual method that will act as a base for common querying. Specifically, it will accept a an int and it only needs to perform a query over the primary key of the entity in question. I've been screwing around with it and I've built a reflection which may or may not work. I say that because I get a NotSupportedException with a message of LINQ to Entities does not recognize the method 'System.Object GetValue(System.Object, System.Object[])' method, and this method cannot be translated into a store expression. So then I tried another approach and it produced the same exception but with the error of The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities. I know it's because EF will not parse the expression the way L2S will. Anyway, I'm hopping someone with a bit more experience can point me into the right direction on this. I'm posting the entire class with both attempts I've made. public class Provider<T> where T : class { protected readonly Repository<T> Repository = null; private readonly string TEntityName = typeof(T).Name; [Inject] public Provider( Repository<T> Repository) { this.Repository = Repository; } public virtual void Add( T TEntity) { this.Repository.Insert(TEntity); } public virtual T Get( int PrimaryKey) { // The LINQ expression node type 'ArrayIndex' is not supported in // LINQ to Entities. return this.Repository.Select( t => (((int)(t as EntityObject).EntityKey.EntityKeyValues[0].Value) == PrimaryKey)).Single(); // LINQ to Entities does not recognize the method // 'System.Object GetValue(System.Object, System.Object[])' method, // and this method cannot be translated into a store expression. return this.Repository.Select( t => (((int)t.GetType().GetProperties().Single( p => (p.Name == (this.TEntityName + "Id"))).GetValue(t, null)) == PrimaryKey)).Single(); } public virtual IList<T> GetAll() { return this.Repository.Select().ToList(); } protected virtual void Save() { this.Repository.Update(); } }

    Read the article

  • Replace a DIV with another using effect and set cookie

    - by Alex
    Hi. I've got some complicated requirements and wondered if there's a way to accomplish this via jQuery: User comes to a web page for the first time today and we show DIV_1. After 30 seconds, we dissolve DIV_1 to DIV_2. We set a cookie on the user's machine that expires when s/he returns tomorrow. If the same user returns today, we only show DIV_2. Tomorrow, we repeat the process: The user will see DIV_1 and then it dissolves to DIV_2. How do you accomplish this via jQuery? Thank you.

    Read the article

  • Why does Perl lose foreign characters on Windows; can this be fixed (if so, how)?

    - by Alex R
    Note below how ã changes to a. NOTE2: Before you blame this on CMD.EXE and Windows pipe weirdness, see Experiment 2 below which gets a similar problem using File::Find. The particular problem I'm trying to fix involves working with image files stored on a local drive, and manipulating the file names which may contain foreign characters. The two experiments shown below are intermediate debugging steps. The ã character is common in latin languages. e.g. http://pt.wikipedia.org/wiki/Cão Experiment 1 Experiment 2 To get around my particular problem, I tried using File::Find instead of piped input. The issue actually gets worse: Debugging update: I tried some of the tricks listed at http://perldoc.perl.org/perlunicode.html, e.g. use utf8, use feature 'unicode_strings', etc, to no avail. Environment and Version Info The OS is Windows 7, 64-bit. The Perl is: This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x64-multi-thread (with 8 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1202 [293621] provided by ActiveState http://www.ActiveState.com Built Sep 6 2010 22:53:42

    Read the article

  • SVN - ignoring files already in repository

    - by Alex
    I have a configuration file in my project which needs to be in the repository (so new developers get it when they checkout the project). Each developer might change some values in the file locally - these changes should not be committed and I don't want them showing in the synchronization menu (I'm using eclipse and subversive if it matters). Note that I can't just set the svn:ignore property since it only works on files that aren't under version control - but I do want to keep a base version of the file in the repository. How can I avoid the file showing in synchronization without deleting it from repository? EDIT: A better description - what I actually need is to be able to set a "read-only" property on the config file, so it can't be changed in the repository as long as the property is on. Do you know anything like this? Thanks

    Read the article

  • XNA AdGameComponent does not draw

    - by Alex Shkor
    I have following code. But AddGameComponent doesn't draw. protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); var li = new LicenseInformation(); IsTrial = li.IsTrial(); if (IsTrial) { AdGameComponent.Initialize(this, AppID); Components.Add(AdGameComponent.Current); CreateAd(); } } private void CreateAd() { bannerAd = AdGameComponent.Current.CreateAd(AdUnitID, new Rectangle(x, y, width, height), true); AdGameComponent.Current.Enabled = true; } I have tried to set DrawOrder to 1000, but ads still doesn't work.

    Read the article

  • Selecting the 2nd row in sql

    - by Alex Chen
    I want to select the second row only from the table. From the ClientUserName column. SELECT ClientUserName, DestHost, count(DestHost) counts FROM #ProxyLog_record WHERE ClientUserName = (Select top 1 ClientUserName from #ProxyLog_count_2) GROUP BY ClientUserName, DestHost ORDER BY counts DESC The (Select top 1 ClientUserName from #ProxyLog_count_2) shows top 1 only but I need to get the 2nd data from that table. How can I do this?

    Read the article

  • Filtering spectrum using FIR filters

    - by Alex Hoppus
    If i have signal values x[T] and filter coefficients b[i], i can perform filtering using convolution. Suppose i have spectrum of x (after FFT) and i need to perform filtering using filters coefficients, how can i perform this? I heard that in frequency domain it will be multiplying, rather than convolution (time domain). But i can't find an equation to use it. I have 614000 values in y = fft(x[T]) vector and 119 filter coefficients (generated using fdatool), i can't multiply them directly ... Thanks.

    Read the article

  • Best way to create Default.png image for iPhone app

    - by Alex
    Originally I though I'll just take a screenshot of my app on the iPhone then tweak it in Photoshop. The images should be 480 x 320 according to Apple doc, and the dimensions of my screenshot are 480 x 320. But, the screenshot contains notification area (where reception bars, battery life, etc. are displayed) So, if I chop that part off my image will be a bit shorter and not 480px high. What do I do? Submit a shorter image? Stretch it up so it's 480px but without the notification bar? Submit it with the notification bar in the image? How did you create your Default.png?

    Read the article

  • length between 2 values

    - by alex
    In R, what is the most efficient way to count the length between 2 values. for example, i have vector x , which are all randomly choose from 1 to 100, how can i find out the length between the first"2" and first"40", x=(1,2,3,4,5,6,7,40,1,2,3,21,4,1,23,4,43,23,4,12,3,43,5,36,3,45,12,31,3,4,23,41,23,5,53,45,3,7,6,36) for this vector, the answer should be 5 and 6

    Read the article

  • Bind an event handler to multiple elements jQuery?

    - by Alex
    Hello all. I've done some experimenting, but can't seem to successfully bind one event handler to multiple elements using jQuery. Here's what I've tried: $('selector1', 'selector2').bind('click', function() { $('someSelector').removeClass('coolClass'); }); I've tested all my selectors, and they are all valid. Is what I'm trying to do even possible? If so, can I do it with .live() as well? Thanks!

    Read the article

  • Some encoded Javascript that I need in plain text

    - by Alex
    Hey, I'm having some issues trying to decode some javascript.. I have no idea what kind of encoding this is.. i tried base 64 decoders etc. If you can please help me out with this, here's a fragment of the code: \x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x61\x70\x70\x34\x39\x34\x39\x3 Any ways I can get plain text from that? Thanks!

    Read the article

  • SkinId and Dynamic Control

    - by Alex
    Hi! I have some control that I add dynamically to my page: public partial class _Default : Page { protected override void CreateChildControls() { base.CreateChildControls(); var testControl = new TestControl { SkinID = "TestSkin" }; Controls.Add(testControl); } } I have the following skin file for this control: <cc:TestControl runat="server" SkinID="TestSkin" TestProperty="LALALA" /> But TestProperty is null (if control is static all works): public class TestControl : LinkButton { public string TestProperty { get; set; } protected override void OnPreRender(EventArgs e) { if (String.IsNullOrEmpty(TestProperty)) { throw new ArgumentNullException("TestProperty"); } } } Any ideas about how to fix it?

    Read the article

  • Multiple calls to /dev/stdin using python subprocess (*nix)

    - by Alex Leach
    Hi, I have a python subprocess call which I would like to link up to three pipes (two standard in and one standard out). I know that there is only one /dev/stdin, but there's all those other devices in /dev I don't know about, and don't know of any python os, sys or subprocess modules that will utilise them in a manner which allows me to give the device path to subprocess.Popen. The reason I ask is because I would like to pipe information from a mysql database or tar archive rather than a directory structure I currently have which has 28,000 directories in. The directory names alone uses a LOT of space! The alternative is to tar / gunzip the entire directory structure and manoeuvre through the compressed archive. With either solution, mysql or tar, I would still like to have two pipes into subprocess.Popen and one out, so that I can bypass the HDD. Any need for an example??

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >