Search Results

Search found 5464 results on 219 pages for 'effect'.

Page 143/219 | < Previous Page | 139 140 141 142 143 144 145 146 147 148 149 150  | Next Page >

  • Thread Jobs in Java

    - by Bragaadeesh
    Hi, I want to spawn 200 threads simultaneously in Java. What I'm doing right now is running into a loop and creating 200 threads and starting them. After these 200 gets completed, I want to spawn another 200 set of threads and so on. The gist here is that the first 200 threads I spawned need to be FINISHED before spawning the next set. I tried the code below, but its not working for(int i=0;i<200;i++){ Thread myThread = new Thread(runnableInstance); myThread.start(); } for(int i=0;i<200;i++){ Thread myThread = new Thread(runnableInstance); myThread.start(); } Note: I have intentionally put the for loop Twice, but the desired effect I intend is not happening simply because the second for loop is executed before the first set of threads end their execution. Please advise

    Read the article

  • How do I produce an external URL as part of a replace_html call in Ruby on Rails?

    - by vlasits
    Basically, I am attempting to render an external website (the url of which is stored in the database) into a page in my Ruby on Rails app. I have a field in my model 'search' called 'search' that contains web addresses with the form 'www.example.com' or 'example.com'. I am trying to use a link_to_function call with replace_html to replace the 'maincontent' div with an iframe tag using the value of 'search' in the current instance as the src for the tag. My current attempt is the very ugly code below. I'd be grateful for either of the following types of responses: How can I rewrite the concatenation string to work correctly? How can I get the same effect (replacing the current content of the "mainContent" div with an iframe tag using a different method? (I had to modify the code before to remove the < from the iframe) link_to_function h(search.title) do |page| page.replace_html 'mainContent', 'iframe id="embedded" src="http://" + #{search.search} />' end

    Read the article

  • get foreign key objects in a single query - Django

    - by John
    Hi I have 2 models in my django code: class ModelA(models.Model): name = models.CharField(max_length=255) description = models.CharField(max_length=255) created_by = models.ForeignKey(User) class ModelB(models.Model): category = models.CharField(max_length=255) modela_link = models.ForeignKey(ModelA, 'modelb_link') functions = models.CharField(max_length=255) created_by = models.ForeignKey(User) Say ModelA has 100 records, all of which may or may not have links to ModelB Now say I want to get a list of every ModelA record along with the data from ModelB I would do: list_a = ModelA.objects.all() Then to get the data for ModelB I would have to do for i in list_a: i.additional_data = i.modelb_link.all() However this runs a query on every instance of i. Thus making 101 queries to run. Is there any way of running this all in just 1 query. Or at least less than the 101 queries. I've tried putting in ModelA.objects.select_related().all() but this didn't seem to have any effect. Thanks

    Read the article

  • CSS3 transition of background-color

    - by jean-guy
    I'm trying to make a transition effect with background-color when hovering menu items but it does not work. Here is my CSS code: #content #nav a:hover { color: black; background-color: #AD310B; /* Firefox */ -moz-transition: all 1s ease-in; /* WebKit */ -webkit-transition: all 1s ease-in; /* Opera */ -o-transition: all 1s ease-in; /* Standard */ transition: all 1s ease-in; } The #nav div is a menu ul list of items. Thank you for your help.

    Read the article

  • Change iframe content within an element

    - by user610983
    $(document).ready(function () { $('#keywordframe').contents().find("#step12").html(''); $('#keywordframe').contents().find("#step12").html('11'); $('#keywordframe').contents().find("#step13").html(''); $('#keywordframe').contents().find("#step13").html('12'); $('#keywordframe').contents().find("#step14").html(''); $('#keywordframe').contents().find("#step14").html('13'); $('#keywordframe').contents().find("#step15").html(''); $('#keywordframe').contents().find("#step15").html('14'); }); I try to use the above code to change the content in an iframe, but it is not working. Unless I put alert(''); on top of $('#keywordframe').contents().find("#step12").html(''); if just will take effect. What is the reason for that, anyone could help?

    Read the article

  • Showing a hidden form

    - by Arcadian
    Newb question: how do i show a from that have been hidden using this.Hide(); I have tried MainMenuForm.Show(); and this just says i need an object ref have tried: MainMenuForm frmMainMenu = new MainMenuForm(); frmMainMenu.Show(); which seems to show the appropriate form. but when you exit the app, it is still held in memory because it hasn't shown the form that was hidden, instead it has shown a new version of the form. in effect having 2 instances of the form (one hidden, one visible). whats the correct procedure here Thanks in advance

    Read the article

  • vb.net press/release keys

    - by Cyclone
    How can you simulate keypresses and releases? I know you can essentially hit a key with Sendkeys.SendWait, but how can your code press and hold q, for example? Any help is much appreciated! Everything I find keeps pointing me at sendkeys, which is not correct. I essentially wish to be able to call something like press("q") and release("q"). The effect would be the same as physically holding them down. Thanks for your help!

    Read the article

  • the correct actionscript to find if object already exists

    - by touB
    I have a Rect object that I'd like to create and set its properties only once. After that, I want to just modify its properties since it already exists. This is my general idea if(theRect == undefined){ Alert.show("creating"); var theRect:Rect = new Rect(); //then set properties addElement(theRect); //then add it using addElement because addChild() does not work } else { Alert.show("updating"); //no need to create it since it's already been created //just access and change the properties } I tried several ways and combinations for the if conditional check: if(theRect == undefined){ if(theRect == null){ declaring and not declaring `var theRect:Rect;` before the if check declaring and instantiating to null before the if check `var theRect:Rect = null;` but can't get the desired effect. Everytime this code block runs, and depending on which version I've used, it either gives me a "can't access null object" error or the if statement always evaluates to true and creates a new Rect object and I get the "creating" Alert. What's the right way of creating that Rect but only if doesn't exist?

    Read the article

  • IQueryable<> dynamic ordering/filtering with GetValue fails

    - by MyNameIsJob
    I'm attempting to filter results from a database using Entity Framework CTP5. Here is my current method. IQueryable<Form> Forms = DataContext.CreateFormContext().Forms; foreach(string header in Headers) { Forms = Forms.Where(f => f.GetType() .GetProperty(header) .GetValue(f, null) .ToString() .IndexOf(filter, StringComparison.InvariantCultureIgnoreCase) >= 0); } However, I found that GetValue doesn't work using Entity Framework. It does when the type if IEnumerable< but not IQueryable< Is there an alternative I can use to produce the same effect?

    Read the article

  • Extreamely fast way to clone the values of an array into a second array?

    - by George
    I am currently working on an application that is responsible for calculating random permutations of a multidemensional array. Currently the bulk of the time in the application is spent copying the array in each iteration (1 million iterations total). On my current system, the entire process takes 50 seconds to complete, 39 of those seconds spent cloning the array. My array cloning routine is the following: public static int[][] CopyArray(this int[][] source) { int[][] destination = new int[source.Length][]; // For each Row for (int y = 0; y < source.Length; y++) { // Initialize Array destination[y] = new int[source[y].Length]; // For each Column for (int x = 0; x < destination[y].Length; x++) { destination[y][x] = source[y][x]; } } return destination; } Is there any way, safe or unsafe, to achieve the same effect as above, much faster?

    Read the article

  • problem getting a form image background

    - by Deumber
    I'm creating a datagridview transparent //I got the parent background image Bitmap parentBackGround = new Bitmap(this.Parent.BackgroundImage); //Set the area i want to create equal to the size of my grid Rectangle rect = new Rectangle(this.Location.X, this.Location.Y, this.Width, this.Height); //And draw in the entire grid the area of the background image that is cover with my grid, making a "transparent" effect. graphics.DrawImage(parentBackGround.Clone(rect, PixelFormat.Format32bppRgb), gridBounds); When the backgroundimage of the grid's parent is show in an normal layout all work ok, but if the layout is stretch, center or any other, the transparency effent gone, have you any idea to fix it?

    Read the article

  • how does [<Literal>] differ from other constants in F#

    - by Mitzh
    I am a bit confused by the Literal keyword and why it is necessary in F#. Reading the docs, it sounds to me that [<Literal>] is used to define a constant, however I am a bit confused how this constant differs from all other constants in F#.. Values that are intended to be constants can be marked with the Literal attribute. This attribute has the effect of causing a value to be compiled as a constant. When I think of a constant, I think of something which is immutable.... let x = "a" + "b" //this is a immutable value, its value is constant [<Literal>] let y = "a" + "b" //this is also a immutable value, but why is this a special constant? Is it because the 'normal' F# values are evaluated lazily and the [<Literal>] is not evaluated lazily..? is that what they mean with 'compiled as constant'..? or is there something else to it?

    Read the article

  • Make the text of a disabled textbox easier to see

    - by Vaccano
    I have a text box that when it is disabled the text in it is gray and kind of dithered. (This is the standard functionality.) Is there a way to make this easier to see? I have tried this: txtBoxNumber.Enabled = false; txtBoxNumber.ForeColor = Color.Black; and that has no effect. NOTE: This is a .net Compact Framework app, but I am not tagging the question with CF because I think it is the same for normal .net.

    Read the article

  • Will the next iPhone Simulator be able to simulate the high resolution of iPhone 4?

    - by dontWatchMyProfile
    As a follow-up to this question, the next one is: Will we be able to simulate our interfaces how they look on the new high resolution display, even without owning an iPhone 4? I guess that there is a formula that we can use to calculate the exact needed distance between our monitors and our eyes, to achieve the exact same visual effect of the Retina Display. This would help a lot to get things right. The first thing we need is an high resolution iPhone Simulator. I can't get any sleep until I know.

    Read the article

  • jquery/ajax load new content when available

    - by Tim
    I know this is quite a vague question -- sorry about that. If I have a forum, shoutbox or something similar where users enter and submit data, running on PHP and MySQL, what is the best way to have the newly submitted content automatically display on the page for all users when it is submitted? Much like a live newsfeed, if you like... The effect sort-of works here at stackoverflow, when you are answering a question you are told when new answer is submitted. I want to test for newly submitted content and then display it automatically. Any suggestions? Many thanks :)

    Read the article

  • Flex: How to create a floating notification message of sorts for a custom component?

    - by aberrant80
    I have a custom TextInput-based component for date and time with certain restrictions on what's considered "within range". But it's still fine to insert dates that are outside the range. When a user types in a date, on valueCommit, I'd like to be able to display a hovering notification to the user, to inform/warn them that the date is outside the accepted range. I'm thinking of notifications ala the Validators, but I'd rather not use the Validator mechanism because it's really not validation, just notification. Something like a tooltip, but it will only appear if the user changed the value. Maybe an effect of some sort? If anyone has any ideas or if anyone has done something like this, I'm all ears!

    Read the article

  • Wrapping an array of elements.

    - by fivetwentysix
    I'm trying to write an unobtrusive script and I don't want to add any html that's not needed unless javascript is enabled. Using MooTools 1.2.4, is it possible to wrap a an array of elements with say for example: tags? Desired effect: Before: <p>Something</p> <p>Something1</p> <p>Something2</p> <p>Something3</p> Wishful thinking javascript code: $$('p').wrapWith(new Element('div', {id: 'master'})); After: <div id="master"> <p>Something</p> <p>Something1</p> <p>Something2</p> <p>Something3</p> </div>

    Read the article

  • jQuery: Fade not working

    - by Rosarch
    For some reason, jQuery's fade effect isn't working. Could it be because of the code? This function does everything it is supposed to, aside from the fading. It gets called at the correct time. function moveToTerm(original_course, helper, term) { var cloned_course = original_course.clone(true); original_course.addClass('already-scheduled'); helper.fadeOut(function() { cloned_course.appendTo(term).attr('style', '').fadeIn("slow"); }); } UPDATE: It fails in both FF 3.5.9 and IE 8.

    Read the article

  • jQuery slideDown() not animating (jquery-rails 3.0.4; jquery-ui-rails (4.0.5)

    - by Michael Guren
    I am following along in the latest Agile Web Development with Rails 4 book. In Chapter 11 (AJAX), the book instructs us to use the following code in the "create.js.erb" file: if ($('#cart tr').length == 1) { $('#cart').show('blind', 1000); } This code causes the #cart div to jump down without any content. After 1 second it appears. There is no sliding effect. I tried using slideDown(); as well, but the div just appears immediately. Out of curiosity, I tried slideUp(); when the div was visible. Voila. The div slid up. This appears to be a jQuery bug and wondered if anyone else has experienced this, or has any suggestions for me. Thanks.

    Read the article

  • Run C# code after running all javascript codes

    - by Devi
    I am having a form in which a button is there on click of that button i am calling a javascript function in which i am displaying like 3.. 2.. 1 kind of effect then i am returning true. But after showing 3 only return true is getting executed and the form is getting submitted. How to stop form submitting before running the script. Edit: function jsFun() { timerCount(3); //Calling the Timer Function. } var t; function timerCount(cDown) { if (cDown == 0) { clearTimeout(t); return true; } $('#<%= mainContainer.ClientID %>').html(cDown); cDown = cDown - 1; t = setTimeout('timerCount(' + cDown + ')', 1000); } <asp:Button ID="btnStarts" runat="server" Text="Start" OnClientClick="return jsFun();" OnClick="btn_click" />

    Read the article

  • problem in jquery with showing pop message on submit form

    - by user1400
    hi guys in my application on php i use of 'jQuery Notify Bar' plugin for display messages, i'd like to show message when my form submit(in edit page) ,the other page(index page) is opened and notify bar be open until the other page(index page) is completely load and even some second more but the problem is that notify bar show for short Moment and when the index page begin to load , notify bar is closed, and the delay property is not effect to that $('#myForm').submit(function(){ $.notifyBar({ html: "Thank you, your settings were updated!", **delay: 20000,** animationSpeed: "normal" }); how to show notify bar in the other page too? thanks

    Read the article

  • Detecting and reloading updated application parameters at runtime

    - by VeeKayBee
    I am working on an ASP.NET web application(using .NET 4.5 and C#).The application deals with lot of units (for measuring like KG,Litre,KM etc). So based on the selected unit we have to implement some allowed range.This values can be configured without much effort. We identified two solutions for this Keeping a configuration xml. Suppose the values in xml, does it requires an iisreset or any other thing which can take the site down for some time, if we are changing the xml file to change some validation. Keeping in Db, then use SQL dependency caching. So an update to DB can reflect the caching values.SO i believe if we change the values, it will update the cache. How much complex is this and does it effect the performance ? It will be great helpful, if we have some other method to achieve this. Thanks in advance.

    Read the article

  • Getting a divs z-index to overlap a div with absolute positioning

    - by Paul Herron
    Does anyone know how I could get the logo at the top of my page to appear on top of the curtains. http://nuigums.tumblr.com/ The logo is within a section tag along with the rest of the content with a z-index of 2, which is required to get the footer reveal effect I want. The curtain has a z-index of 3. I tried setting the z-index of the logo div to 4 but I presume the fact that the sections styling overrides that? I would like the logo to scroll with the content of the page also. Thanks. :)

    Read the article

  • Why is rails called a dsl?

    - by b_ayan
    Recently, when I tried to explain why Rails is a DSL to an intern at my organisation, I was not able to articulate my reasonings to the effect I would like to. Maybe I do not understand the space well enough to teach the nuances. Redirecting him to Martin Fowler' article or the google ranked one InfoQ or other material has not helped much either. Can some explain why Rails is a DSL with an example / parallel situation which is not voodoo stuff for someone who is fairly new to the world of code? Understanding the ideology might also help in elaborating the intricacies of the rails ecosystem?

    Read the article

  • Securing database keys for client-side processing

    - by danp
    I have a tree of information which is sent to the client in a JSON object. In that object, I don't want to have raw IDs which are coming from the database. I thought of making a hash of the id and a field in the object (title, for example) or a salt, but I'm worried that this might have a serious effect on processing overhead. SELECT * FROM `things` where md5(concat(id,'some salt')) = md5('1some salt'); Is there a standard practice for obscuring IDs in this kind of situation?

    Read the article

< Previous Page | 139 140 141 142 143 144 145 146 147 148 149 150  | Next Page >