Search Results

Search found 6976 results on 280 pages for 'active'.

Page 107/280 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • Improving WPF memory usage

    - by Krishna
    Hello developers Is there any way you can store the UI state to disk when a WPF form has been minimised. I have a complex GUI with few Tab Controls and it consumes quite a bit of memory which is kept allocated when the application is not active. I was hoping one of you may have got this working along the lines (or similar) Application Active User does work, plays with UI - enters some information in the text boxes and moves around the tabs User minimises the form to work with other applications On Minimise, Save the current state to the disk and dispose the root tabcontrol On Activiate, build the root tabcontrol from the disk and add to the controls collection Before I divein to do this, I thought it will help me if I ask this question here. Please let me know your thoughts

    Read the article

  • rails db migration, undefined method `to_sym', cant figure out syntax

    - by oelbrenner
    the original migration looks like this: class CreateUsers true do |t| t.string :login, :limit = 40 t.string :name, :limit = 100, :default = '', :null = true t.string :email, :limit = 100 t.string :crypted_password, :limit = 40 t.string :salt, :limit = 40 t.string :remember_token, :limit = 40 t.datetime :remember_token_expires_at t.string :activation_code, :limit = 40 t.datetime :activated_at, :datetime t.string :state, :null = :no, :default = 'passive' t.datetime :deleted_at t.integer :occupation_id, :null = :yes t.datetime :paid_up_to_date, :date t.timestamps end and I am trying to change the default of "state" to be "active" instead of passive so my attempt at a migration looks like this: ( still learning.. be gentle ) class ChangeUserStateDefault < ActiveRecord::Migration def self.up change_column :users, :state, :null = :no, :default = 'active' end def self.down end end

    Read the article

  • What is the best way to set default values in ActiveRecord?

    - by ryw
    What is the best way to set default value in ActiveRecord? I see a post from Pratik that describes an ugly, complicated chunk of code: http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model class Item < ActiveRecord::Base def initialize_with_defaults(attrs = nil, &block) initialize_without_defaults(attrs) do setter = lambda { |key, value| self.send("#{key.to_s}=", value) unless !attrs.nil? && attrs.keys.map(&:to_s).include?(key.to_s) } setter.call('scheduler_type', 'hotseat') yield self if block_given? end end alias_method_chain :initialize, :defaults end YUCK! I have seen the following examples googling around: def initialize super self.status = ACTIVE unless self.status end and def after_initialize return unless new_record? self.status = ACTIVE end I've also seen people put it in their migration, but I'd rather see it defined in the model code. What's the best way to set default value for fields in ActiveRecord model?

    Read the article

  • Paging and edit category status

    - by jasmine
    For edit home status of category I have a link: <span class=\"ha\" title=\"Active in Homepage\">Active in Homepage</span><a href=\"?page=homestatus&id={$row['id']}\" class=\"hp\" title=\"\">Passive in home page</a> and function: function homestatus() { $ID = mysql_real_escape_string($_GET['id']); $query = "UPDATE category SET home = 0 WHERE id= $ID "; $result = mysql_query($query); if (mysql_affected_rows () == 1) { header('Location: index.php?page=categories'); } } Everything works fine but there is paging : /index.php?page=categories&pg=2 I want that an item located in pg=2, redirected to index.php?page=categories&pg=2 How can I do this? Thanks in advance

    Read the article

  • Eliminate duplicates in SQL query

    - by ewdef
    i have a table with 6 fields. the columns are ID, new_id price,title,Img,Active. I have datawhich is duplicated for the price column. When I do a select i want to show only distinct rows where new_id is not the same. e.g.- ID New_ID Price Title Img Active 1 1 20.00 PA-1 0X4... 1 2 1 10.00 PA-10 0X4... 1 3 3 20.00 PA-11 0X4... 1 4 4 30.00 PA-5 0X4... 1 5 9 20.00 PA-99A 0X4... 1 6 3 50.00 PA-55 0X4... 1 When the select statement runs, only rows with ID (1,4,9,6) should show. Reason being the new_ID with the higher price should show up. How can i do this?

    Read the article

  • grayscaling images and refering the original image back.

    - by dilip
    I know how to grayscale an image. I am using jquery accordion and I have images on every accordion header. I want to change the image to grayscale when the accordion is active and change the image back to its original form when the accordion is not active. I am using the event accordionChange. The problem is that I am not able to save the original image. Please help. Also after grayscaling I tried to give the original src directly as document.getElementById("imgId").src = "images/pic.jpg"; This is not working.

    Read the article

  • Attaching a jquery function to some textboxes

    - by diver-d
    I am a newbie to jquery and need a little help. I have created the below function which does what I want it to however when I select a textbox every other textbox are automatically selected. How do I change it and pass a parameter from the textbox so only the selected textboxes css changes on focus and blur? <script language="javascript" type="text/javascript"> $(function () { $('.myTextBox').focus(function () { $('.box.textbox').addClass("active"); }).blur(function () { $('.box.textbox').removeClass("active"); }); }); </script>

    Read the article

  • T-SQL UPDATE trigger help

    - by Tan
    Hi iam trying to make an update trigger in my database. But i get this error every time the triggers trigs. Error MEssage: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(3rows) and heres my trigger ALTER TRIGGER [dbo].[x1pk_qp_update] ON [dbo].[x1pk] FOR UPDATE AS BEGIN TRY DECLARE @UserId int , @PackareKod int , @PersSign varchar(10) SELECT @PackareKod = q_packarekod , @PersSign = q_perssign FROM INSERTED IF @PersSign IS NOT NULL BEGIN IF EXISTS (SELECT * FROM [QPMardskog].[dbo].[UserAccount] WHERE [Account] = @PackareKod) BEGIN SET @UserId = (SELECT [UserId] FROM [QPMardskog].[dbo].[UserAccount] WHERE [Account] = @PackareKod) UPDATE [QPMardskog].[dbo].[UserAccount] SET [Active] = 1 WHERE [Account] = @PackareKod UPDATE [QPMardskog].[dbo].[User] SET [Active] = 1 WHERE [Id] = @UserId END END END TRY But i only update one row in the table how can it says 3 rows. Please advise.

    Read the article

  • Google Maps and jQuery Tabs

    - by Dom
    Hello All, I have slight problem with Google maps included in simple jQuery Tabs. Below I pasted the code: jQuery: $(document).ready(function() { //Default Action $(".tab_content").hide(); $("ul.tabs li:first").addClass("active").show(); $(".tab_content:first").show(); //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".tab_content").hide(); var activeTab = $(this).find("a").attr("href"); $(activeTab).fadeIn(); return false; }); }); Here is the HTML for the tabs: <div class="bluecontainer"> <ul class="tabs"> <li><a href="#tab1">Tab1</a></li> <li><a href="#tab2">Tab2</a></li> <li><a href="#tab3">Tab3</a></li> <li><a href="#tab4">Tab4</a></li> </ul> <div class="tab_container"> <div id="tab1" class="tab_content"> <h2>Tab1</h2> </div> <div id="tab2" class="tab_content"> <h2>Tab2</h2> </div> <div id="tab3" class="tab_content"> <div>google Map</div> </div> <div id="tab4" class="tab_content"> <h2>Tab4</h2> </div> </div> </div> I really don't know what to do to. Is that a general problem with google maps or there is something with my tabs? But they are working just fine with everything else. Thank you for your help in advance

    Read the article

  • Jquery Mobile splitview like Android Gmail app [closed]

    - by JDev
    Since I don't know much about jquery mobile, CSS, i don't know what we call this. I want to create a splitview like Android gmail app (image attached). but i am not sure how to create arrow cut on the active (clicked) listview only (like shown in the image) and other listview are normal. Can someone guide me how to approach it. Sorry for confusing everyone. Updated the image with black circle. the nice inward arrow (shown under black circle) is what i am looking for. As you see this inward arrow will appear only for the active left side listview only and others will have a straight line, also left side has a distinct appearance. I want to know the approach for these using jquery mobile, jquery, css etc.

    Read the article

  • jQuery parent()

    - by Happy
    jQuery snippet: $(".sliders dt a").click(function(){ $(this).parent().parent().parent().find(".triggers a").removeClass("active"); return false }); HTML: <div class="triggers"><a href="#" class="active">Hide all</a></div> <dl class="sliders"> <dt><a href="#">text</a></dt> <dd>text</dd> </dl> Three .parent() is used, to catch .triggers block. Is there any way to merge them?

    Read the article

  • trying to set a dropdown in MVC

    - by RJ
    I almost have this solved but need a little push. Here's what I have: In the database I have a field called active that is a bit field (True/False) I have placed a dropdownlist on the View form like this: <%= Html.DropDownList("lstActive", new SelectList((IEnumerable)ViewData["ActiveList"])) %> In my controller, I simply have this code to generate the True/False in the dropdown: List<string> activeList = new List<string>(); activeList.Add("True"); activeList.Add("False"); ViewData["ActiveList"] = new SelectList(activeList); I want to bind to the field in the database called active and select it in the dropdown. When I view it like this I get this: So the questions are these: Obviously I am not pointing to the Value and Text property but what is that in this case? And how do I select the value that is in the database? Any help would be appreciated.

    Read the article

  • Django - Expression based model constraints

    - by rtmie
    Is it possible to set an expression based constraint on a django model object, e.g. If I want to impose a constraint where an owner can have only one widget of a given type that is not in an expired state, but can have as many others as long as they are expired. Obviously I can do this by overriding the save method, but I am wondering if it can be done by setting constraints, e.g. some derivative of the unique_together constraint WIDGET_STATE_CHOICES = ( ('NEW', 'NEW'), ('ACTIVE', 'ACTIVE'), ('EXPIRED', 'EXPIRED') ) class MyWidget(models.Model): owner = models.CharField(max_length=64) widget_type = models.CharField(max_length = 10) widget_state = models.CharField(max_length = 10, choices = WIDGET_STATE_CHOICES) #I'd like to be able to do something like class Meta: unique_together = (("owner","widget_type","widget_state" != 'EXPIRED')

    Read the article

  • Nested <a> and <span> challenge

    - by PaddyO
    Hi all, Trying in vain to get a nested link working within a nested span. This is a working test page for the code below to explain what I'm trying to do. Any ideas on how to get this working in valid html? I guess it's either a nesting order or style syntax thing but I am at a loss. Any thoughts much appreciated. <div id="greyback"> <ul id="scrollbox"> <li class="listcat">List header</li> <li><a class="menu" href="#freeze">List item 1<span><b>This text has popped up because you have clicked the list item, which has an "a" tag and now has :focus. That "a" tag is the first of two.</b><br><br>What I am trying to do is to set the second "a" tag as a DIFFERENT "embedded" link in this box<span style="color: blue; background-color: yellow;">eg, here<a href="http://www.conservationenterprises.com" target="blank">This is the second (nested) "a" tag in this html nest. It is a link to an external site. Instead of this being an always-visible link, I want it to sit within the yellow box in the first span (click the List item 1 to display).</a></span> </a></span> </li> </a></span> </li> </ul> </div> and the CSS: #scrollbox {margin: 0 auto; margin-top: 1em; margin-bottom: 1em; width:19em; height:auto; max-height: 21em; overflow:auto; border-bottom: 0.1em solid #FFA500; border-top: 0.1em solid #FFA500;} #scrollbox a {float: left; color:#000000; text-decoration:none; width:18em; height: auto; margin-bottom: 0.5em; font-family: Arial, sans-serif; font-size: 0.9em; text-align:left;} #scrollbox a.menu {} #scrollbox a span {display:none; position:absolute; left:0em; top:0;} #scrollbox a span img {float: right; border:0; max-width:7.5em;} #scrollbox a:hover {border: 0; color: #7ebb11; font-size:0.9em;} #scrollbox a:hover span {border: 0; color: #535353;} #scrollbox a span:focus {color: blue;} #scrollbox a:active {border:none; color: #535353; text-decoration: none;} #scrollbox a:focus {border:0em solid #000; outline:0;} #scrollbox a:active span, #scrollbox li a:active span, #scrollbox a:focus span, #scrollbox li a:focus span {display: block; width: 52.5em; min-height: 20em; height: auto; left: 1.5em; top:18em; z-index:10; font-size:0.9em; text-align: left; padding: 1em; padding-bottom: 0em; background-color: #c3FFe3; color: #535353; border: solid #FFA500 0.25em;} #scrollbox li a:active span span, #scrollbox li a:focus span span{display: block; width: auto; height: auto; min-height: 2em; left: 25em; top:10em; z-index:10; font-size:0.9em; text-align: left; padding: 1em; padding-bottom: 0em; background-color: transparent; color: #535353; border: dashed red 1px;} .ul#scrollbox {padding-left: 0.1em;} #scrollbox li {float:left; list-style: none; background: url(blank.png) no-repeat left center; margin-left: 0em; font-family:Arial, sans-serif; font-size: 0.9em;} #scrollbox li.listcat {float: left; text-align:left; width: 18em; margin-left: 0em; margin-top: 0.1em; margin-bottom: 0.3em; padding-top:0.5em; color: green; font-size: 0.9em; font-weight:bold;} Cheers Patrick.

    Read the article

  • Which SharePoint Authentication Mode Should I be using for this scenario?

    - by Dynamic
    I currently have a sharepoint 2010 site for which NTLM windows authentication has been enabled (by default it is against Active Directory I believe). I'd need to change this so that I have 1 custom login page which accepts username/password/domain and validates those information against the active directory, then if that was valid, I'll write logic to logon to another webservice which is located on another server and returns me a unique sessionId that I can store (as a cookie) for further use. Please could you advise which authentication mode I can use to create this custom login page? should that be FBA against AD? not sure how that works. Thanks in advance.

    Read the article

  • Format MySQL code inside PHP string

    - by JohnA
    Is there any program IDE or not that can format MySQL code inside PHP string e.g. I use PHPStorm IDE and it cannot do it. It does that for PHP and MYSQL but not for MYSQL inside php string. I am ready to use new IDE because now i have to manually format hundreds of database requests that are one line and not readable. Only criteria for my choice is that ide can do that automatically. <?php ... $request1 = "select * from tbl_admin where admin_id= {$_SESSION['admin_id']} and active= 1 order By admin_id Asc"; ... ?> should become <?php ... $request1 = "SELECT * FROM tbl_admin WHERE admin_id = {$_SESSION['admin_id']} AND active = 1 ORDER BY admin_id ASC"; ... ?>

    Read the article

  • How to return null value if the query has no corresponding value?

    - by Holicreature
    Hi i've a query select c.name as companyname, u.name,u.email,u.role,a.date from useraccount u, company c, audittrial a where u.status='active' and u.companyid=c.id and (u.companyid=a.companyID and a.activity like 'User activated%' and a.email=u.email) order by u.companyid desc limit 10 So if the following part doesnt't satisfy, (u.companyid=a.companyID and a.activity like 'User activated%' and a.email=u.email) no rows will be returned.. but i want to return the result of the following query select c.name as companyname, u.name,u.email,u.role,a.date from useraccount u, company c, audittrial a where u.status='active' and u.companyid=c.id order by u.companyid desc limit 10 but to add that, i should return the date if available and return null value if date is not available.. how can i do this?

    Read the article

  • Centering ToggleButton Image - With No Text

    - by KickingLettuce
    Here is my ToggleButton: <ToggleButton android:id="@+id/bSmenuTopItems" android:layout_width="wrap_content" android:layout_height="48dp" android:background="@drawable/master_button_selector" android:drawableLeft="@drawable/flame_icon" /> I have no text in this image, I need a ToggleButton due to Active State. EDIT: I think question was misunderstood. There is a drawable inside the Toggle Button (flame_icon) and it is set as background. I want it to be centered. There is no Text, just an image. I need a Toggle Button because I need to have an Active State when selected. There is only drawableLeft, drawableRight, drawableTop, etc. I want a draweableMiddle that doesn't seem to exisit.

    Read the article

  • Thread too slow. Better way to execute code (Android AndEngine)?

    - by rphello101
    I'm developing a game where the user creates sprites with every touch. I then have a thread run to check to see if those sprites collide with any others. The problem is, if I tap too quickly, I cause a null pointer exception error. I believe it's because I'm tapping faster than my thread is running. This is the thread I have: public class grow implements Runnable{ public grow(Sprite sprite){ } @Override public void run() { float radf, rads; //fill radius/stationary radius float fx=0, fy=0, sx, sy; while(down){ if(spriteC[spriteNum].active){ spriteC[spriteNum].sprite.setScale(spriteC[spriteNum].scale += 0.001); if(spriteC[spriteNum].sprite.collidesWith(ground)||spriteC[spriteNum].sprite.collidesWith(roof)|| spriteC[spriteNum].sprite.collidesWith(left)||spriteC[spriteNum].sprite.collidesWith(right)){ down = false; spriteC[spriteNum].active=false; yourScene.unregisterTouchArea(spriteC[spriteNum].sprite); } fx = spriteC[spriteNum].sprite.getX(); fy = spriteC[spriteNum].sprite.getY(); radf=spriteC[spriteNum].sprite.getHeightScaled()/2; Log.e("F"+Float.toString(fx),Float.toString(fy)); if(spriteNum>0) for(int x=0;x<spriteNum;x++){ rads=spriteC[x].sprite.getHeightScaled()/2; sx = spriteC[x].body.getWorldCenter().x * 32; sy = spriteC[x].body.getWorldCenter().y * 32; Log.e("S"+Float.toString(sx),Float.toString(sy)); Log.e(Float.toString((float) Math.sqrt(Math.pow((fx-sx),2)+Math.pow((fy-sy),2))),Float.toString((radf+rads))); if(Math.sqrt(Math.pow((fx-sx),2)+Math.pow((fy-sy),2))<(radf+rads)){ down = false; spriteC[spriteNum].active=false; yourScene.unregisterTouchArea(spriteC[spriteNum].sprite); Log.e("Collided",Boolean.toString(down)); } } } } spriteC[spriteNum].body = PhysicsFactory.createCircleBody(mPhysicsWorld, spriteC[spriteNum].sprite, BodyType.DynamicBody, FIXTURE_DEF); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(spriteC[spriteNum].sprite, spriteC[spriteNum].body, true, true)); } } Better solution anyone? I know there is something to do with a handler, but I don't exactly know what that is or how to use one.

    Read the article

  • Removing old directories with logs

    - by Mcgiwer
    My IM stores the logs according to the contact name. I have created a file with the list of active contacts. My problem is following: I would like to create a bash script with read the active contacts names from the file and compare it with the directories. If the directory name wouldn't be found on the list, it would be moved to another directory (let's call it "archive"). I try to visualise it for you. content of the list: contact1 contact2 content of the dir contact1 contact2 contact3 contact4 after running of the script, the content fo the dir: contact1 contact2 contact3 == ../archive contact4 == ../archive

    Read the article

  • jQuery: Scroll the window then addClass() - how to callback

    - by carillonator
    Inside a jQuery event handler, I would like to scroll the window and then add a class to something. This is my code: $('#foo').click(function() { window.scrollTo(y); $('#bar').addClass('active'); }); $(window).scroll(function() { $('#bar').removeClass('active'); }); Notice I have another handler to remove that same class whenever the window is scrolled. The scrolling part works fine, but seems to run asynchronously, so removeClass() happens after addClass() but before the scrolling is finished. I don't know how to do this in plain javascript. I know there is a jQuery scrollTop() function that does the same thing (but seems to have cross-browser issues), but it doesn't accept a callback. What I really need is a callback to add the class after the scrolling is finished. thanks!

    Read the article

  • PHP - ftp_get only works once

    - by William
    I'm connecting to an ftp server that I have no control over, and I'm pretty sure is using something old and outdated due to other issues I've run into. I'm simply using this code in a loop to get all the files in a directory. ftp_put($this->conn_id, $remote, $local, FTP_ASCII); The first time all goes well, but after that I get this error thrown for each file I try to get: "There is already an active transaction" I've tried both passive & active with no luck. It's the exact same code I use to connect to other FTP servers and get files with no problem. Any ideas? I suppose my last resort could be disconnecting and reconnecting for each file, but that seems like a huge waste.

    Read the article

  • Getting Data Specific to Logged in user

    - by user1770470
    I need to list logged in users active leads,and allow paging and selectable sorting, I cant use the grid because of the layout requirement. I have been searching the web for the last 2 days and cant find any viable solution Any help or direction would be greatly appreciated. var query = db.Query("SELECT a.listingId, a.datetime, c.details, c.buycommercial, c.buyindustrial, c.buyretail, c.buyland, c.tencommercial, c.tenindustrial, c.tenretail, c.tenland, c.investor, c.developer, d.companyname, d.firstname, d.lastname, d.tel, d.cell, d.email FROM dbo.tblactivebroker a JOIN dbo.tblActiveListing b ON a.ListingId = b.ListingId JOIN dbo.tblListings c ON b.ListingId = c.ListingId JOIN dbo.tblContact d ON c.crmid = d.id WHERE b.active = 'True' AND a.ActiveBrokerID = @0",brokerid);

    Read the article

  • [cakephp] problem with find query

    - by luk4s
    Hi I have a problem with find query: $userInProjects = $this->Timesheet->RegularPost->UserInProject->find('all', array('conditions' => array('UserInProject.user_id' => $id))); The result array: Array ( [0] => Array ( [UserInProject] => Array ( [id] => 11 [project_id] => 3 [position_id] => 1 [user_id] => 15 ) [Project] => Array ( [id] => 3 [short_name] => proj1 [full_name] => project 1 [start_date] => 2010-01-01 [end_date] => 2010-05-01 [agreement_number] => 12/34U/23 [active] => 1 [user_id] => 1 ) [Position] => Array ( [id] => 1 [name] => some_name ) [User] => Array ( [id] => 15 [username] => foo [first_name] => [last_name] => [email] => [email protected] [active] => 1 [created] => [modified] => ) [RegularPost] => Array ( [0] => Array ( [id] => 792 [date] => 2010-01-01 [size] => 0.20000 [users_in_project_id] => 11 ) [1] => Array ( [id] => 793 [date] => 2010-02-01 [size] => 0.20000 [users_in_project_id] => 11 ) ( and many more ...) ) ) [1] => Array ( [UserInProject] => Array ( [id] => 20 [project_id] => 3 [position_id] => 2 [user_id] => 15 ) [Project] => Array ( [id] => 3 [short_name] => proj1 [full_name] => project 1 [start_date] => 2010-01-01 [end_date] => 2010-05-01 [agreement_number] => 12/34U/23 [active] => 1 [user_id] => 1 ) [Position] => Array ( [id] => 2 [name] => some_name2 ) [User] => Array ( [id] => 15 [username] => foo [first_name] => [last_name] => [email] => [email protected] [active] => 1 [created] => [modified] => ) [RegularPost] => Array ( [0] => Array ( [id] => 836 [date] => 2010-01-01 [size] => 0.2 [users_in_project_id] => 20 ) [1] => Array ( [id] => 837 [date] => 2010-02-01 [size] => 0.3 [users_in_project_id] => 20 ) [2] => Array ( [id] => 838 [date] => 2010-03-01 [size] => 0.3 [users_in_project_id] => 20 ) ( and many more ...) ) ) ) What I want to achive is the array like above but RegularPost with [date] = 2010-02-01 only. Is there any way to pass the date '2010-02-01' to the RegularPost in this query? This query doesn't work: $userInProjects = $this->Timesheet->RegularPost->UserInProject->find('all', array('conditions' => array('UserInProject.user_id' => $id, 'RegularPost.date' => '2010-02-01'))); 1054: Unknown column 'RegularPost.date' in 'where clause' Please help. :)

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >