Daily Archives

Articles indexed Saturday May 15 2010

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

  • Dymanic if statement evaluation problem with string comparison

    - by Mani
    I tried the example given in http://forums.sun.com/thread.jspa?threadID=780576&tstart=67605 to create if statement dynamically. But it is not working fine. Instead of using "age" variable as integer, i have used string in the below example. I am getting "fail" as answer instead of "success". Can anyone help me? / To change this template, choose Tools | Templates and open the template in the editor. / import java.lang.reflect.*; import bsh.Interpreter; public class Main { public static String d; public static void main(String args[]) { try { String age = "30"; String cond = "age==30"; Interpreter i = new Interpreter(); i.set("age", age); System.out.println(" sss" + i.get("age")); if((Boolean)i.eval(cond)) { System.out.println("success"); } else { System.out.println("fail"); } } catch (Throwable e) { System.err.println(e); } } } Thanks, Mani

    Read the article

  • Latex: Convert "Comment" into "Marginal Note"

    - by diegos
    Hi, using LyX I'm trying to convert the "comments" into "marginal notes". I tried several things but without luck. The best shot was like this: \makeatletter \@ifundefined{comment}{}{% \renewenvironment{comment}[1]% {\begingroup\marginpar{\bgroup#1\egroup}}% {\endgroup}} \makeatother or like this: \@ifundefined{comment}{}{% \renewenvironment{comment}% {\marginpar{}% {}}% But what I get is only the first character of the text converted. Like in this image: IMAGE MARGINAL NOTE I searched a lot trying to find how to solve this but without luck. I found the explanation of what is happening: Unexpected Output Only one character is in the new font You thought you changed font over a selection of text, but only the first character has come out in the new font. You have most probably used a command instead of a declaration. The command should take the text as its argument. If you don't group the text, only the first character will be passed as the argument. What I don't know and wasn't able to find is how to group the text. Hope someone could help me :-) Many thanks. Best Regards, Diego (diegostex)

    Read the article

  • How do I Fix SQL Server error: Order by items must appear in the select list if Select distinct is s

    - by Paula DiTallo 2007-2009 All Rights Reserved
    There's more than one reason why you may receive this error, but the most common reason is that your order by statement column list doesn't correlate with the values specified in your column list when you happen to be using DISTINCT. This is usually easy to spot and resolve. A more obscure reason may be that you are using a function around one of the selected columns --but omitting to use the same function around the same selected column name in the order by statement. Here's an example:   select distinct upper(columnA)   from [evaluate].[testTable]    order by columnA  asc   This statement will cause the "Order by items must appear in the select list if SELECT DISTINCT is specified."  error to appear not because distinct was used, but because the order by statement did not utilize the upper() fundtion around colunnA.  To correct this error, do this: select distinct upper(columnA)   from [evaluate].[testTable]    order by upper(columnA) asc

    Read the article

  • Need disc image help pronto!

    - by data
    I recently got a job as a junior network administrator. Last week the senior admins did their yearly reinstall of server 2003, exchange, drivers etc on the main server. I've been asked to back up the disc so that next year they can just copy over the pre-made image. What tools can i use to achieve both the creation of the entire servers HDD image and loading it back on (id like to test it in the sandbox.) To impress them, a program that is free is preferable. And maybe a tool that can do it all from booting the program off of a USB drive.

    Read the article

  • Is it Worth Opting For the Free SEO Trial by an SEO Company?

    There are a lot of things that work in your favor when you opt for the month of free service that they provide because you at least get a base to start from. If you look carefully, unlike most other companies, the free SEO trial from a SEO company is a non-committal trial which means that if you are not happy with the results after a month you can surely back off.

    Read the article

  • Have something loaded only when JList item is visibile

    - by elvencode
    Hello, i'm implementing a Jlist populated with a lot of elements. Each element corresponds to a image so i'd like to show a resized preview of them inside each row of the list. I've implemented a custom ImageCellRenderer extending the Jlabel and on getListCellRendererComponent i create the thumbnail if there'snt any for that element. Each row corresponds to a Page class where i store the path of the image and the icon applied to the JLabel. Each Page object is put inside a DefaultListModel to populate the JList. The render code is something like this: public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Page page = (Page) value; if (page.getImgIcon() == null) { System.out.println(String.format("Creating thumbnail of %s", page.getImgFilename())); ImageIcon icon = new ImageIcon(page.getImgFilename()); int thumb_width = icon.getIconWidth() > icon.getIconHeight() ? 128 : ((icon.getIconWidth() * 128) / icon.getIconHeight()); int thumb_height = icon.getIconHeight() > icon.getIconWidth() ? 128 : ((icon.getIconHeight() * 128) / icon.getIconWidth()); icon.setImage(getScaledImage(icon.getImage(), thumb_width, thumb_height)); page.setImgIcon(icon); } setIcon(page.getImgIcon()); } I was thinking that only a certain item is visibile in the List the cell renderer is called but i'm seeing that all the thumnails are created when i add the Page object to the list model. I've tried to load the items and after set the model in the JList or set the model first and after starting appending the items but the results are the same. Is there any way to load the data only when necessary or do i need to create a custom control like a JScrollPanel with stacked items inside where i check myself the visibility of each elements? Thanks

    Read the article

  • BULK INSERT problem in mysql

    - by kartiku
    Hi, I get an error with the following sql command for bulk insert....any help would be appreciated. BULK INSERT libra.faculty FROM 'd\:faculty.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ); Here's the error message ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BULK INSERT libra.faculty FROM 'd:\faculty.csv' WITH ( FIELDTERMINATOR = ',', RO' at line 1

    Read the article

  • What stereotypes about developers are there?

    - by lkessler
    I was filling out a Delphi Developer Survey and two questions were asking about developer stereotypes: Which stereotype about developers do you think is most true? Which stereotype about developers do you think is least true? That was a hard one for me to answer. I couldn't even think of very many developer stereotypes to choose from. What do you think are the most common ones?

    Read the article

  • Sharing view logic in Django

    - by Jeremy B.
    I've begun diving into Django again and I'm having trouble finding the parallel to some common concepts from my life in C#. While using .NET MVC I very often find myself creating a base controller which will provide a base action implementation to take care of the type of stuff I want to do on every request, like retrieving user information, getting localization values. Where I'm finding myself confused is how to do this in Django. I am getting more familiar with the MVT concept but I can't seem to find how to solve this scenario. I've looked at class based views and the generic views yet they didn't seem to work how I expected. What am I missing? How can i create default logic that each view will be instructed to run but not have to write it in each view method?

    Read the article

  • Process of carrying out a BER Test

    - by data
    I am subscribed to an ISP supplying a 3meg ADSL line. Lately (for the last 4 weeks) speeds have dropped from the usual average downstream speed of ~250kbps to just 0.14Mbps (according to speedtest.net) and employees are complaining about lack of access to the server. I have been calling customer support and logging calls for the last 3 weeks, but they have been unable to determine the source of the problem other than carrying out a few bitstream tests and checking the DHCP renewal times. I am going to call back and suggest carrying out a BER test. What type of equipment is needed to carry out this test? I have access to a wide range of Cisco networking equipment. Other: We don't need a leased line as there are less than ten employees.

    Read the article

  • How do I switch between Navigation Controllers?

    - by RexOnRoids
    Situation: I have an Xcode project based on the "Navigation-Based-Application" template. So that means I have a SINGLE UINavigationController that manages a UIViewController. What I want To Do: What I want to do is add one more UINavigationController to my project -- and be able to switch back and forth between them. (I want to do this to make space for some seperate unrelated content so that it does not have a back button pointing back to the root view controller.) Question: How do I add one more UINavigationController to my project and switch between the two UINavigationControllers?

    Read the article

  • Comment reply procedure using jquery and php?

    - by Prashant
    I have Commenting system in my app. For a single video entry anyone can post a comment and someone else can post reply to that comment and replies, cannot have thier further reples, similar to StackOverflow is doing (1 Answer, and thier 1 or more replies). I want the similar functionality what SO has, Let's I have the following HTML <div class="comment" id="comment-908"> First comment </div> <div class="reply"> <div id="reply-909> reply 1 </div> <div id="reply-910> reply 2 </div> <div id="reply-911> reply 3 </div> </div> <form id="reply-form"> <textarea id="replycomment" name="replycomment"></textarea> <input type="submit" name="submit-reply" value="add reply" /> </form> Now above HTML is a sample which I have created, When someone will click on "add reply" button then I am using jquery to post there reply. Now I want to know that there will be multiple comment and multiple add reply forms. So who clicks on which button and for which comment someone wants to post a reply, how will i know that? The above HTML is not in correct way, please suggest me the correct HTML flow which I can use and how to work with jquery? now I want to know when soe

    Read the article

  • How to prevent my C# winforms application from stealing focus when I set the visible properly to tru

    - by Fopedush
    I've got a C# winforms application that runs in the background, listening for hotkeys to be pressed. When a hotkey is pressed, my form makes a brief appearance. The form is always running, but set to hidden until I receive a hotkey event, at which time I set the visible property to true. The code looks like this: void hook_volumeDown(object sender, KeyPressedEventArgs e) { this.Visible = true; } It should be noted that the topmost property of this form is set to true. The really odd part is, after my C# app has stolen focus from another application, it will never do it again. For example: I launch my app, then launch some fullscreep app like Team Fortress 2. Then I press my hotkey. Team Fortress 2 minimizes, and I see my form. Then, however, I can restore TF2, and press my hotkey again all I want (with the desired effect), and TF2 will remain focused. At any rate, I'm looking for a way to fix this. I've found a lot of questions here covering similar problems, but all of them are related to creating/launching a new form, not making an existing one visible (unless I missed something). I could rework the application to create a new form every time I need one, but that would entail creating yet another form to be invisible all the time just to wait for hotkey events, so I'd rather leave it as it is. Any ideas?

    Read the article

  • Why does a newly created EF-entity throw an ID is null exception when trying to save?

    - by Richard
    I´m trying out entity framework included in VS2010 but ´ve hit a problem with my database/model generated from the graphical interface. When I do: user = dataset.UserSet.CreateObject(); user.Id = Guid.NewGuid(); dataset.UserSet.AddObject(user); dataset.SaveChanges(); {"Cannot insert the value NULL into column 'Id', table 'BarSoc2.dbo.UserSet'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated."} The table i´m inserting into looks like so: -- Creating table 'UserSet' CREATE TABLE [dbo].[UserSet] ( [Id] uniqueidentifier NOT NULL, [Name] nvarchar(max) NOT NULL, [Username] nvarchar(max) NOT NULL, [Password] nvarchar(max) NOT NULL ); GO -- Creating primary key on [Id] in table 'UserSet' ALTER TABLE [dbo].[UserSet] ADD CONSTRAINT [PK_UserSet] PRIMARY KEY CLUSTERED ([Id] ASC); GO Am I creating the object in the wrong way or doing something else basic wrong?

    Read the article

  • Rails - Cant get http_accept_language gem to work in my rails project

    - by adam
    I'm internationalizing my app and I've installed the http_accept_language gem on my system I've placed config.gem 'http_accept_language' into my environment.rb file but every time I try to run this code in my controller request.user_preferred_languages it complains of no method error. There are no other instructions on the readme on github... am I missing something? EDIT - Problem solved. after a good nights sleep I came back and realised I hadnt restarted the server. I hate it when that happens.

    Read the article

  • Analyze a BSOD (irql_less_than_or_equal)

    - by Bruno Reis
    Hello. About 2 months ago I bought a new system and built it at home: Mother board: XFX X58i Processor: Core i7 920, using the stock cooler Memory: 3x2GB Corsair DDR3 1600 Video card: NVIDIA GTS 250 (1GB) Hard disk: 2x WD 500GB, 7200rpm I have 2 screens plugged into the video card, and the system is connected to a 550W PSU. Nothing is overclocked. After building the system, I stressed it a lot with Prime95 and rthdribl to check its stability. All my tests were perfect. So I reinstalled Win 7 x64 Professional and started using it normally. The first week (2010-03-15) I got the infamous irql_less_than_or_equal BSOD. Ten days after (2010-03-24) I got another one. Then on 2010-04-09, 2010-05-04. Since 2 days ago it became worse: I got one bluescreen per day! (2010-05-12, 2010-05-13, 2010-05-14). I installed BlueScreenView to try to obtain some information, but I'm not able to extract any useful information apart from the bug check string (irql_less_than_or_equal), and that it was caused by ntoskrnl.exe (the first three at ntoskrnl.exe+71f00, the last 4 at ntoskrnl.exe+70600 -- which I suspect could be the same thing, as Microsoft could have patched this file in the mean time, so the address of the function causing it changed). Then I stressed my memory sticks with memtest, they worked perfectly. After booting, I've stressed my GPU with FurMark and RTHDRIBL, everything was fine. Then I stressed the CPU with 4 instances of Prime95 while monitoring the temperature -- that never exceeded 85oC with the case closed --, everything fine. Finally I've stressed the whole system with HeavyLoad for a looooong time, everything worked just fine. So, I have stressed most of the components of the system, but couldn't get any useful information from it. Do you have any hint on what else can I do to find the culprit? Thanks Bruno

    Read the article

  • How do you comment html templates in Php (in a practical way) ?

    - by faB
    Is there a simple solution to do the equivalent of Java's comments: <%-- this is a comment inside a template, it does not appear in the output HTML --%> Even if you use short php tags, you still have to wrap the comments with comment syntax, on top of the php tags: <? /* this is a comment of the html template */ ?> I'm considering doing some kind of filter on the output templates, to remove all html comments, or better yet, custom comments like the Java syntax above, but how would you do that in the most efficient way? You'd have to run a regexp right? The reason for my question is simply that in a MVC framrwork, using components, and re-usable html templates (think YUI), I need to document clearly those templates, in a readable way..

    Read the article

  • Dynamic if statement evaluation problem with string comparison

    - by Mani
    I tried the example given in this thread to create if statement dynamically using BeanShell. But it is not working fine. Instead of using "age" variable as integer, i have used string in the below example. I am getting "fail" as answer instead of "success". Can anyone help me? /* To change this template, choose Tools | Templates and open the template in the editor. */ import java.lang.reflect.*; import bsh.Interpreter; public class Main { public static String d; public static void main(String args[]) { try { String age = "30"; String cond = "age==30"; Interpreter i = new Interpreter(); i.set("age", age); System.out.println(" sss" + i.get("age")); if((Boolean)i.eval(cond)) { System.out.println("success"); } else { System.out.println("fail"); } } catch (Throwable e) { System.err.println(e); } } } Thanks, Mani

    Read the article

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