Search Results

Search found 15535 results on 622 pages for 'mat keep'.

Page 16/622 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to keep my functions (objects/methods) 'lean and mean'

    - by Michel
    Hi, in all (Agile) articles i read about this: keep your code and functions small and easy to test. How should i do this with the 'controller' or 'coordinator' class? In my situation, i have to import data. In the end i have one object who coordinates this, and i was wondering if there is a way of keeping the coordinator lean(er) and mean(er). My coordinator now does the followling (pseudocode) //Write to the log that the import has started Log.StartImport() //Get the data in Excel sheet format result = new Downloader().GetExcelFile() //Log this step Log.LogStep(result ) //convert the data to intern objects result = new Converter().Convertdata(result); //Log this step Log.LogStep(result ) //write the data result = Repository.SaveData(result); //Log this step Log.LogStep(result ) Imho, this is one of those 'know all' classes or at least one being 'not lean and mean'? Or, am i taking this lean and mean thing to far and is it impossible to program an import without some kind of 'fat' importer/coordinator? Michel

    Read the article

  • Keep only a subtree of the DOM tree

    - by Randomblue
    On BBC articles, such as this one, there is a DOM element with class story-body, deep in the DOM chain. I want to hide all DOM element "outside" of this (unique) DOM element. The problem is that I can't just do $('*').hide(); $('.story-body'); because I need to make sure to keep the parents, grand-parents, etc. of story-body. I also can't do $('*').hide(); var current = $('.story-body').show(); while(current = current.parent()) { current.show(); } because that would simply show everything. Any suggestions?

    Read the article

  • How to keep the highlight border of a JComponent, when custom border is set

    - by Frederik Wordenskjold
    I have a JTextField, where I've set some custom properties: nameField.setPreferredSize(new Dimension(275,40)); nameField.setBackground(bgColor); nameField.setForeground(txtColor); nameField.setFont(new Font("HelveticaNeue",Font.PLAIN,22)); nameField.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2)); When the component has focus, there is no highlight shown around the field. On a Mac, it is usually a blue glowing rectangle, indicating that this component has focus. If I comment out the nameField.setBorder(...), the highlight reappears. How do I keep the highlight, but also my custom border!? Basically, I just want the highlight-border to show when the component has focus, and no border when the component is unfocused.

    Read the article

  • how to keep dragged TitleWindow within Flex app boundary

    - by Tim
    I am using PopupManager in FB4 to display a custom dialog. popwin = new TitleWindow(); popwin.addElement(myCustomDialog); PopUpManager.addPopUp(popwin,this,false); PopUpManager.centerPopUp(popwin); It's possible to drag the popped up TitleWindow and let go of it when its gray title bar lies outside the bounds of the Flex app rectangle, and then the popup cannot be grabbed again. It's also possible to drag the TitleWindow downwards so it becomes completely invisible below the bottom edge of the Flex app rectangle. When the Flex app bounds are less than the full browser window, and the user is working quickly, this chances of this happening increase. Is there a simple setting that will keep this from happening, or must the programmer intercept the behavior during the drag operation? Thanks Tim

    Read the article

  • jQuery code to delete all spans with same content but keep one

    - by Axel
    Hello, Say i have the following html: <span class="fruit">Apple</span> <span class="fruit">banana</span> <span class="fruit">Apple</span> <span class="fruit">Apple</span> <span class="fruit">orange</span> I tried different methods but it didn't work, I want a jQuery code to remove all (.fruit) spans with same content but keep one (the first if possible), so i will end up with the following: <span class="fruit">Apple</span> <span class="fruit">banana</span> <span class="fruit">orange</span> Thank you

    Read the article

  • I keep Getting KeyError: 'tried' Whenever I Tried to Run Django Dev Server from Remote Machine

    - by Spikie
    I am running django on python2.6.1, and did start the django web server like this manage.py runserver 192.0.0.1:8000 then tried to connect to the django dev web server on http://192.0.0.1:8000/ keep getting this message on the remote computer Traceback (most recent call last): File "C:\Python26\Lib\site-packages\django\core\servers\basehttp.py", line 279, in run self.result = application(self.environ, self.start_response) File "C:\Python26\Lib\site-packages\django\core\servers\basehttp.py", line 651, in call return self.application(environ, start_response) File "C:\Python26\lib\site-packages\django\core\handlers\wsgi.py", line 241, in call response = self.get_response(request) File "C:\Python26\lib\site-packages\django\core\handlers\base.py", line 115, in get_response return debug.technical_404_response(request, e) File "C:\Python26\Lib\site-packages\django\views\debug.py", line 247, in technical_404_response tried = exception.args[0]['tried'] KeyError: 'tried' what i am doing wrong ? it seen to work ok if i run http://192.0.0.1:8000/ on the computer that runs the Django web server and have that ip 192.0.0.1:8000

    Read the article

  • How to keep the session of user login?

    - by YaW
    Hi, I have an app that requires user to register. I've got the app conected to PHP in my server to do the logic of register/login and so, this is not problem at all. But, I want to keep a session of the user in local, so the user doesn't have to login again every time he runs the app. So, I want something like this: First time user, he opens the app, register and login. Do some stuff with the app and closes it. Open the app again, the user is recognized so he doesn't need to login again. I only need to store an ID and a Username (both fetched from the DB in the login php method). What's the best way to do this?? I've thought about doing a custom preference, store the data in files or even a local DB (sqlite). Any suggestions?

    Read the article

  • Keep user connected with WCF

    - by Frank
    Hi, Context : I would like to create WCF Service that can be consumed by an ASP.NET web app and an iphone application. My goal : Create an SOA architecture. My problem : How "keep the user connected" on the WCF service? I tried asp.net membership provider with wcf and that works fine. But the problem is that I have to give username/password for each call. What can I do to resolve this problem? What's the best way to solve this kind of problem? Possible solution after googlising : Use Windows Identity Foundation. Thank you, Frank

    Read the article

  • How to move an element in a sorted list and keep the CouchDb write "atomic"

    - by karlthorwald
    I have elements of a list in couchdb documents. Let's say these are 3 elements in 3 documents: { "id" : "783587346", "type" : "aList", "content" : "joey", "sort" : 100.0 } { "id" : "358734ff6", "type" : "aList", "content" : "jill", "sort" : 110.0 } { "id" : "abf587346", "type" : "aList", "content" : "jack", "sort" : 120.0 } A view retrieves all "aList" documents and displays them sorted by "sort". Now I want to move the elements, when I want to move "jack" to the middle, I could do this atomic in one write and change it's sort key to 105.0. The view now returns the documents in the new sort order. After a lot of sorting I could end up with sort keys like 50.99999 and 50.99998 after some years and in extreme situations run out of digits? What can you recommend, is there a better way to do this? I'd rather keep the elements in seperate documents. Different users might edit different elements in parallel (which also can get tricky). Maybe there is a much better way?

    Read the article

  • Using Flex to keep local SQLite database in sync with live server database

    - by DaveC
    I want to create a Flex 3 application running in Adobe Air that accesses an SQLite database and I need to keep this database in sync with an SQL server 2005 database running a website. Is this something that Flex supports or is it going to be a custom script? Also, has anybody done anything like this? Edit: The synchronisation can be done on a daily basis rather than real time. The data will be read only from a front end perspective with a CMS to do updates on the website.

    Read the article

  • wpf keep base style in custom control

    - by Archana R
    Hello, I have created a custom button as i wanted an image and a text inside it as follows: <Style TargetType="{x:Type Local:ImageButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Local:ImageButton}"> <StackPanel Height="Auto" Orientation="Horizontal"> <Image Margin="0,0,3,0" Source="{TemplateBinding ImageSource}"/> <TextBlock Text="{TemplateBinding Content}" /> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> Here, ImageButton is a class which inherits from Button class and has ImageSource as a dependency property. But i want to keep the look and feel of the original button. How can i do it? Thanks.

    Read the article

  • How do you keep yourself and your co-workers from creating huge classes

    - by PieterG
    Stackoverflow users, How do you keep yourself from creating large classes with large bodied methods. When deadlines are tight, you end up trying to hack things together and it ends up being a mess which would need to be refactored. For me, the one way was to start with test driven development and that lends itself to good class design as well as the SRP (Single Responsibility Principle). I also see developers just double clicking on controls and typing out line after line in the event method that gets fired. What are your suggestions?

    Read the article

  • i'm trying to solve an equation using gfortran but i keep getting error

    - by sameon
    i'm using the below program but i keep getting error.What is wrong with my progam? real x complex y real m1,H0,Ms,P1,P2,P3,w0,wm,wh complex w1,w2,o1,o2 integer i,n real pi n=4000000000 pi=4*atan(1.0) m1=4*pi*1e-7 H0=39.79e3 Ms=1400e3 P1=0.7*0.12 P2=0.3*0.12 P3=P1-P2 w0=m1*(1.76e11)*H0 wm=m1*(1.76e11)*Ms wh=w0-P3*wm im=cmplx(0,1) w1=wm/2+wh-im*0.06*2*pi*x w2=wm/2-wh-im*0.06*2*pi*x o1=x**2-x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1) o2=x**2+x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1) do i=0,n x=i y=1+wm*(P1*w1*((w2)**2-x**2))/(o1*o2) & +wm*(P2*w2*((w1)**2-x**2))/(o1*o2) & -wm*((wm/2)*((P1*w2+P2*w1)**2)))/(o1*o2) & +wm*((wm/2)*((P3*x)**2))/(o1*o2) write(10,*)x,y enddo return end

    Read the article

  • XMLHttpRequest inside an object: how to keep the reference to "this"

    - by Julien
    I make some Ajax calls from inside a javascript object.: myObject.prototye = { ajax: function() { this.foo = 1; var req = new XMLHttpRequest(); req.open('GET', url, true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) { alert(this.foo); // reference to this is lost } } } }; Inside the onreadystatechange function, this does not refer to the main object anymore, so I don't have access to this.foo. Ho can I keep the reference to the main object inside XMLHttpRequest events?

    Read the article

  • keep viewdata on RedirectToAction

    - by Thomas Stock
    [AcceptVerbs(HttpVerbs.Post)] public ActionResult CreateUser([Bind(Exclude = "Id")] User user) { ... db.SubmitChanges(); ViewData["info"] = "The account has been created."; return RedirectToAction("Index", "Admin"); } This doesnt keep the "info" text in the viewdata after the redirectToAction. How would I get around this issue in the most elegant way? My current idea is to put the stuff from the Index controlleraction in a [NonAction] and call that method from both the Index action and in the CreateUser action, but I have a feeling there must be a better way. Thanks.

    Read the article

  • How to keep plug-in manifest version and pom version in sync in Maven with Tycho

    - by abhin4v
    I am using Maven with Tycho to build an eclipse plugin. Tycho generates the pom.xml file for Maven by inspecting the manifest file of the plugin. Now both the manifest file and the pom file have the version of the plugin and they need to be kept in sync manually. This is because I have done some customization in the generated pom file and cannot overwrite it every time I change the version in the manifest. My question here is, is there a way to keep these versions in sync automatically using Tycho?

    Read the article

  • How to keep code maintainable after original programmer quit

    - by Stan
    Say if it's a 10 people project, 2-3 of the original programmer quit after the project has been release a stable version for a while. How to have the code maintainable in this case? My imagination is reviewing the code after the project goes to release version and keep review it afterwards? Maybe split into 2-3 small groups and have each group review part of the code. So at least 3-4 people are familiar with part of code. Does this work? How do companies deal with this issue? Usually how many percentage of time spent on reviewing the code? Please advise, thanks to community.

    Read the article

  • XMLHttpRequest inside an oject: how to keep the refrence to "this"

    - by Julien
    I make some Ajax calls from inside a javascript object.: myObject.prototye = { ajax: function() { this.foo = 1; var req = new XMLHttpRequest(); req.open('GET', url, true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) { alert(this.foo); // reference to this is lost } } } }; Inside the onreadystatechange function, this does not refer to the main obecjt anymore, so I don't have access to this.foo. Ho can I keep the reference to the main object inside XMLHttpRequest events?

    Read the article

  • How to keep an Hibernate's Session open until the page is rendered

    - by Neuquino
    I'm having the following problem: I'm using Oracle ADF for the view and controller of my app. With OpenSessionInViewFilter, I intercept the request and open an Hibernate's Session, and it is closed as soon as the bean's method finishes. What I need is to keep the Session opened until the page is rendered, because in my JSP y use the lazy attributes of the object i load from the DB. For example: When I enter index.jspx the IndexBean#main() is executed: public class IndexBean{ private DBObject myDBObject; public String main(){ this.myDBObject = this.myDAO.loadObjectFromDB(); return null; } } in index.jspx I have: ... <af:inputText value="#{myDBObject.lazyAttribute}" /> ... I'd like that the Hibernate's Session keeps open until the af:inputText is processed. Is this possible? How? Thanks in advance

    Read the article

  • Keep local MS SQL 2008 DB table and remote SQL Azure DB table in sync

    - by Boomerangertanger
    Hi there, I have a dedicated server which hosts a Windows Service which does a lot of very heavy load stuff and populates a number of SQL Server database tables. However, of all the database tables it populates and works with, I want only one to be synchronised with a remote SQL Azure DB table. This is because this table holds what I called Resolved data, which is the end result of the Windows Service's work. I would like to keep a SQL Azure database table in sync with this database table. As far as I understand, my options are: Move everything onto Azure (but that involves a massive development overhead and risk) Have another Windows Service on the dedicated server which essentially looks at changed records since the last update and then manually update the SQL Azure table

    Read the article

  • I want to keep the values on textbox after onchange function

    - by user1908045
    hello i have problem with this code..I want to keep the values of the textboxes when the pageload and didnt write again the values. I have two drop down list. the First one is the country when the country selected then the page load and appear the city to select but afte the pageload the values on textbox is empty. I want to keep the values of textbox when the page load. This is the code <head> <script type="text/javascript"> function Load_id() { var Count = document.getElementById("Count").value; var Count_txt = "?Count=" location = Count_txt + Count } </script> <meta charset="UTF-8"> </head> <body> <div class="main"> <div class="headers"> <table> <tr><td rowspan="2"><img alt="unipi" src="/Images/logo.jpeg" height="75" width="52"></td> <td>University</td></tr> <tr><td>Data</td></tr> </table> </div> <div class="form"> <h3>Personal</h3><br/><br/><br/> <form id="Page1" name="Page1" action="Form1Sub.php" method="Post"> <table style="width:520px;text-align:left;"> <tr><td><label>Number:</label></td> <td><input type="text" required="required" id="AM" name="AM" value=""/></td> </tr> <tr><td><label>Name:</label></td> <td><input type="text" required="required" name="Name"/></td> </tr> <?php $host="localhost"; $username=""; $password=""; $dbName="Database"; $connection = mysql_connect($host, $username, $password) or die("Couldn't Connect to the Server"); $db = mysql_select_db($dbName, $connection) or die("cannot select DataBase"); $Count = $_GET['Count']; echo "<tr><td><label>Country</label></td>\n"; $country = mysql_query("select DISTINCT Country FROM lut_country_city "); echo " <td><select id=\"Count\" name=\"cat\" onChange=\"Load_id(this)\">\n"; echo " `<option>Select Country</option>\n"; while($nt=mysql_fetch_array($country)){ $selected = ($nt["Country"] == $Count)? "SELECTED":""; echo"<option value=\"".$nt['Country']."\"". $selected." >".$nt['Country']."</option>"; } echo " </select></td></tr>\n"; echo"<tr><td><label>City:</label></td>\n"; $q2 = mysql_query("Select id,City,Country FROM lut_country_city WHERE Country = '$Count'"); echo"<td><select name=\"SelectCity\">\n"; while($row = mysql_fetch_array($q2)) { echo"<option value=\"".$row['id']."\">".$row['City']."</option>"; } echo " </select></td></tr>\n"; ?> </table> <p> <button type="submit" id="Next">Next</button> </form> <form id="form1" action="index.php"> <button id="Back" type="submit">Back</button> </form> </p> </div> </div> </body> </html>

    Read the article

  • PostgreSQL: keep a certain number of records in a table

    - by Alexander Farber
    Hello, I have an SQL-table holding the last hands received by a player in card game. The hand is represented by an integer (32 bits == 32 cards): create table pref_hand ( id varchar(32) references pref_users, hand integer not NULL check (hand > 0), stamp timestamp default current_timestamp ); As the players are playing constantly and that data isn't important (just a gimmick to be displayed at player profile pages) and I don't want my database to grow too quickly, I'd like to keep only up to 10 records per player id. So I'm trying to declare this PL/PgSQL procedure: create or replace function pref_update_game(_id varchar, _hand integer) returns void as $BODY$ begin delete from pref_hand offset 10 where id=_id order by stamp; insert into pref_hand (id, hand) values (_id, _hand); end; $BODY$ language plpgsql; but unfortunately this fails with: ERROR: syntax error at or near "offset" because delete doesn't support offset. Does anybody please have a better idea here? Thank you! Alex

    Read the article

  • SSRS 2005 Keep textbox and textfield together when page break occurs

    - by EKet
    Problem I don't have a details row or anything. I have simply a body and I dragged on textboxes for labeling textfields from my dataset. The problem is when one of the fields has too much data for the current page, it "page-breaks" at the start of the field leaving the textbox (label for the field) behind on the previous page. What I've tried Put the data field and the textbox label a) inside a rectangle - didn't work b) inside a list and the list inside a rectangle - didn't work c) inside a list with keep together property set to TRUE or FALSE - didn't work Question How would I group the textbox and the textfield so that regardless of where the pagebreak happens it includes its label?

    Read the article

  • Ignoring (serious) errors to keep the program alive?

    - by SQuirreL bites
    One of the main things I wanted to achieve in my experimental programming language was: When errors occur (Syntax, Name, Type, etc.) keep the program running, no matter how serious or devastating it is. I know that this is probably very bad, but I just wanted something that doesn't kill itself on every error - I find it interesting what happens when a serious error occurs but the program continues. Does this "paradigm" have a name? I mean expect for How bad is it to do the above? Are there programs in use out there that just follow: "Hey, this is a fatal, unexpected error - but you know what? I don't care!"?

    Read the article

  • Keep a javascript variable after an ajax call

    - by Guillaume le Floch
    I'm new in javascript and jQuery. I'm using ajax calls to get data from my server. The fact is, I'm losing my javascript variables after the call .. Here is what I did : the variable is define outside any function and treat in an other function. var a = 0; function myfunction(url){ $.ajax({ url: url, timeout: 20000, success: function(data){ // Do some stuff // The a variable is now undefined }, error: function(){ // Do some stuff } }); } Everything is working fine, the only thing is that I need to keep my variables ... but it looks like it's gone .. Does anyone know why? Thanks

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >