Daily Archives

Articles indexed Saturday May 1 2010

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

  • Switch to selected tab by name in Jquery-UI Tabs

    - by Rob
    If I have three tabs: <div id="tabs"> <ul> <li><a href="#sample-tab-1"><span>One</span></a></li> <li><a href="#sample-tab-2"><span>Two</span></a></li> <li><a href="#sample-tab-3"><span>Three</span></a></li> </ul> </div> I would like to swap to #sample-tab-2 by it's name. I know I can switch to a tab if I know it's number, but in the case I've run into I won't know that. Notes: JQuery 1.3.1 / JQuery-UI 1.6rc6

    Read the article

  • Comment out a python code block

    - by gbarry
    Is there any mechanism to comment out large blocks of Python code? Right now the only ways I can see of commenting out code are to either start every line with a #, or to enclose the code in """ (triple quotes), except that actually makes it show up in various doc tools. Edit--After reading the answers (and referring to the "duplicate"), I have concluded the correct answer is "No". One person said so, and the rest lectured us about editors. Not a bad thing, but I feel it's important to put the answer at the top.

    Read the article

  • Rich image scroll and zooming on android

    - by F0RR
    I'm looking for a way to implement image zoom and scrolling the way it is implemented in Droid Comic Viewer. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling.

    Read the article

  • Data Binding Error retrival

    - by saurabh
    Hello My scenarion is this 1- i have a Form which is dynamically generated with some XML configuration information. 2- i am attaching Data Binding for a textbox in Text_Loaded event a well as Validation Rules and i am attaching Validation.AddErrorHandler for showing message boxs 3- Data Source for the binding is a DataTable. 4- I am having record navigation buttons on the form generated in step 1 (Next,Last,First,Previous) 5- If user edits data with invalid values in record no 1 validation fires and it creats a red border 6-user press Next button to navigate to record no 2 but does not update error field in record no 1 i.e. she leaves record no 1 with some error not in my data source but on the form. 7- She came back to record no 1 , here my problem begins , Record no 1 is updated with old values and does not show error which she made. i know that ValidationRules will not allow wrong input to update my data source which is fine but i need to handle point no 7 , there is no direct way to handle this situation , any help is much appriciated

    Read the article

  • Javascript with Django?

    - by Rosarch
    I know this has been asked before, but I'm having a hard time setting up JS on my Django web app, even though I'm reading the documentation. I'm running the Django dev server. My file structure looks like this: mysite/ __init__.py MySiteDB manage.py settings.py urls.py myapp/ __init__.py admin.py models.py test.py views.py templates/ index.html Where do I want to put the Javascript and CSS? I've tried it in a bunch of places, including myapp/, templates/ and mysite/, but none seem to work. From index.html: <head> <title>Degree Planner</title> <script type="text/javascript" src="/scripts/JQuery.js"></script> <script type="text/javascript" src="/media/scripts/sprintf.js"></script> <script type="text/javascript" src="/media/scripts/clientside.js"></script> </head> From urls.py: (r'^admin/', include(admin.site.urls)), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'media'}) (r'^.*', 'mysite.myapp.views.index'), I suspect that the serve() line is the cause of errors like: TypeError at /admin/auth/ 'tuple' object is not callable Just to round off the rampant flailing, I changed these settings in settings.py: MEDIA_ROOT = '/media/' MEDIA_URL = 'http://127.0.0.1:8000/media'

    Read the article

  • Is it possible to write C# code as below and send email using my home network?

    - by kedar karthik
    Is it possible to write C# code as below and send email using my home network? I have a valid user name and password on that exchange server. Is there any configuration that I can set to achieve this? BTW this code blow works when I run it within office network. I want this code to work when run from any network. String cMSExchangeWebServiceURL = (String)System.Configuration.ConfigurationSettings.AppSettings["MSExchangeWebServiceURL"]; String cEmail = (String)System.Configuration.ConfigurationSettings.AppSettings["Cemail"]; String cPassword = (String)System.Configuration.ConfigurationSettings.AppSettings["Cpassword"]; String cTo = (String)System.Configuration.ConfigurationSettings.AppSettings["CTo"]; ExchangeServiceBinding esb = new ExchangeServiceBinding(); esb.Timeout = 1800000; esb.AllowAutoRedirect = true; esb.UseDefaultCredentials = false; esb.Credentials = new NetworkCredential(cEmail, cPassword); esb.Url = cMSExchangeWebServiceURL; ServicePointManager.ServerCertificateValidationCallback += delegate(object sender1, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; // Create a CreateItem request object CreateItemType request = new CreateItemType(); // Setup the request: // Indicate that we only want to send the message. No copy will be saved. request.MessageDisposition = MessageDispositionType.SendOnly; request.MessageDispositionSpecified = true; // Create a message object and set its properties MessageType message = new MessageType(); message.Subject = subject; message.Body = new TestOutgoingEmailServer.com.cogniti.mail1.BodyType(); message.Body.BodyType1 = BodyTypeType.HTML; message.Body.Value = body; message.ToRecipients = new EmailAddressType[3]; message.ToRecipients[0] = new EmailAddressType(); //message.ToRecipients[1] = new EmailAddressType(); //message.ToRecipients[2] = new EmailAddressType(); message.ToRecipients[0].EmailAddress = "[email protected]"; message.ToRecipients[0].RoutingType = "SMTP"; //message.CcRecipients = new EmailAddressType[1]; //message.CcRecipients[0] = new EmailAddressType(); //message.CcRecipients[0].EmailAddress = toEmailAddress.ElementAt(1).ToString(); //message.CcRecipients[0].RoutingType = "SMTP"; //There are some more properties in MessageType object //you can set all according to your requirement // Construct the array of items to send request.Items = new NonEmptyArrayOfAllItemsType(); request.Items.Items = new ItemType[1]; request.Items.Items[0] = message; // Call the CreateItem EWS method. CreateItemResponseType response = esb.CreateItem(request);

    Read the article

  • Are fragments of hashes collision-resistent?

    - by Mark
    Let me see if someone would mind clearing up this elementary point about md5 and hashing. If you only use the first 4 bytes of an md5 hash, would that mean theoretically only 1 in 255^4 chance of collision. iow is that the intention with it (and other hash algorithms) - that you only have to use a small portion of the returned hash (say the hash is of a file of some size).

    Read the article

  • How to stop Lean programming becoming Cowboy Coding?

    - by Matt Howells
    My team has been progressively adopting more and more lightweight methodologies, moving from Scrum to Lean/Kanban where there is less and less formal process. At some point we will be back to Cowboy Coding; indeed I fear we may already be on the border line. Where can the line be drawn between a very lightweight Lean and Agile process and anarchy? How will we know when we have crossed the line? And how can we prevent ourselves from crossing the line? The question might also be phrased as, 'what processes cannot be safely eliminated in Lean's drive to eliminate waste'?

    Read the article

  • I am not seeing named session in gnu screen

    - by dorelal
    I am tying to learn gnu screen. I am using mac(snow leopard). I am running 4.00.03 version of screen. I am starting a new screen with following command screen -S foo However after that if I do ctrl + A + " then I see the list of screens. However all the lists have numbers and then bash. Because all it says is 'bash' I can't figure out which screen has what. Am I missing something?

    Read the article

  • Green IT : Microsoft et Google peuvent mieux faire, selon le rapport annuel de Greenpeace

    Green IT : Microsoft et Google peuvent mieux faire, selon le rapport annuel de Greenpeace Quand les écolos mettent leur nez dans le milieu de l'informatique, certaines firmes se font tapper sur les doigts. De bons points ont cependant été accordés à Cisco et Ericsson, qui sont arrivés en première position des entreprises informatiques ayant le moins d'impact sur les changements climatiques. Malgré son lobbying en faveur des énergies propres et ses investissements dans les énergies renouvelables, Google obtient un mauvais résultat et se place à la 6éme position. Greenpeace a publié en début de semaine sont Cool IT Leaderboard annuel. Si la première place a été attribuée à Cisco, c'est à cause de ...

    Read the article

  • What is the recommended approach towards multi-tenant databases in MongoDB?

    - by Braintapper
    I'm thinking of creating a multi-tenant app using MongoDB. I don't have any guesses in terms of how many tenants I'd have yet, but I would like to be able to scale into the thousands. I can think of three strategies: All tenants in the same collection, using tenant-specific fields for security 1 Collection per tenant in a single shared DB 1 Database per tenant The voice in my head is suggesting that I go with option 2. Thoughts and implications, anyone?

    Read the article

  • Rad upload Java applet and z-index

    - by Belgurinn
    I'm using Rad upload for drag and drop upload. It's working perfectly except I'm having a problem with the z-index. I'm also using jquery UI on the site and the overlay doesn't cover the applet. Any ideas on how to control the z-index. It would be nice if there where a setting like in flash where you control wmode. But I've tried z-index on the div that controls it and no result.

    Read the article

  • Get Criteria by associationPath

    - by niklassaers
    Hi guys, Every so often, I get a "org.hibernate.QueryException: duplicate association path: myAssociation". This is because the complex criteria I'm working with can define the same path in many places. I'd love to do something like Criteria association = myCriteria.getAssociation("wax"); if(association == null) association = myCriteria.createCriteria("wax"); Is there any such way that I can check if an association is already in place? Cheers Nik

    Read the article

  • Using JLabels as pseudo buttons.

    - by FreeThinker
    Currently I am developing a small todo list manager and would like to use labels in place of buttons on the 'context' bar. If any one could provide me with information on how I could go about doing this I would appreciate it greatly.

    Read the article

  • How do I efficiently write a "toggle database value" function in AJAX?

    - by AmbroseChapel
    Say I have a website which shows the user ten images and asks them to categorise each image by clicking on buttons. A button for "funny", a button for "scary", a button for "pretty" and so on. These buttons aren't exclusive. A picture can be both funny and scary. The user clicks the "funny" button. An AJAX request is sent off to the database to mark that image as funny. The "funny" button lights up, by assigning a class in the DOM to mark it as "on". But the user made a mistake. They meant to hit the next button over. They should click "funny" again to turn it off, right? At this point I'm not sure whats the most efficient way to proceed. The database knows that the "funny" flag is set, but it's inefficient to query the database every time a button is clicked to say, is this flag set or not, then go on with a second database call to toggle it. Should I infer the state of the database flag from the DOM, i.e. if that button has the class "on" then the flag must be set, and branch at that point? Or would it be better to have a data structure in Javascript in the page which duplicates the state of each image in the database, so that every time I set the database flag to true, I also set the value in the Javascript data to true and so on?

    Read the article

  • random number in VC++

    - by BillDickson
    int randomNumber = (double)rand() / (RAND_MAX + 1) * (10 - 0) + 0; is the code I'm using, it is getting a random number, but is getting the SAME random combination every time? Can anyone see what I'm doing wrong?

    Read the article

  • C/C++ __restrict type

    - by aaa
    hello. Is there a way to define using typedef integral/float type which implies no aliasng? something equivalent to (but primitive construct): template < typename T > struct restrict { T* __restrict data; };

    Read the article

  • Best way to author man pages?

    - by vy32
    What's the best way to author man pages? Should I write using the standard man macros, or is there some clever package available now that takes some kind of XML-ified source and can output man pages, HTML, ASCII, and what not? Thanks

    Read the article

  • Row image changes in listview in android?

    - by sunil
    Hi, I am developing an android application where I need to manipulate the background image of the rows in listview on certain conditions. Initially when the listview is loaded all works properly. But when I scroll down to the listview and come up again the background image changes. Can someone tell me the reason why its happening so? Hope to get the reply soon. Regards Sunil

    Read the article

  • C# class design - expose variables for reading but not setting

    - by James Brauman
    I have a a polygon class which stores a list of Microsoft.Xna.Framework.Vector2 as the vertices of the polygon. Once the polygon is created, I'd like other classes to be able to read the position of the vertices, but not change them. I am currently exposing the vertices through this field: /// <summary> /// Gets the vertices stored for this polygon. /// </summary> public List<Vector2> Vertices { get { return _vertices; } } List<Vector2> _vertices; However you can change any vertex using code like: Polygon1.Vertices[0] = new Vector2(0, 0); or Polygon1.Vertices[0].X = 0; How can I limit other classes to be able to only read the properties of these vertices, and not be able to set a new one to my List? The only thing I can think of is to pass a copy to classes that request it. Note that Vector2 is a struct that is part of the XNA framework and I cannot change it. Thanks.

    Read the article

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