Search Results

Search found 239 results on 10 pages for 'torben jonas'.

Page 8/10 | < Previous Page | 4 5 6 7 8 9 10  | Next Page >

  • How do I comment out a block in XML?

    - by Jonas
    How do I comment out a block of tags in XML? I.e. How can I comment out <staticText> and everything inside it, in the code below? <detail> <band height="20"> <staticText> <reportElement x="180" y="0" width="200" height="20"/> <text><![CDATA[Hello World!]]></text> </staticText> </band> </detail> I could use <!-- staticText--> but that's just for single tags (as what I know), like // in Java and C. I would like something more like how /** comment **/ can be used in Java and C, so I can comment out longer blocks of XML code.

    Read the article

  • How to set attribs in GWT?

    - by Jonas Byström
    I'm not getting any effect out of DOM.setElementAttribute, am I doing something wrong? class MyListBox extends com.google.gwt.user.client.ui.ListBox { .... protected void setHoverAutoWidth() { addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { DOM.setElementAttribute(getElement(), "width", "auto"); } }, MouseOverEvent.getType()); addDomHandler(new BlurHandler(){ public void onBlur(BlurEvent event) { DOM.setElementAttribute(getElement(), "width", "100px"); } }, BlurEvent.getType()); } } (I know there are less hacky ways to change the width than to set the style attribute directly, but I don't care about css right now.) Edit: Oops, just realized that width does not change the style width, just adds a width attribute to the tag (which explains why nothing happens). Any suggestions on how to modify the style are still welcome!

    Read the article

  • How to get back to auto-completion after misspelling of a methodname in Eclipse?

    - by Jonas
    When I am coding Java in Eclipse I like the auto-completion feature. With that I mean the popup with method-names that comes when you start typing in a method name for an object. Or maybe it's called something different, i.e. method-suggestions? But the popup is hidden if I misspells a method name, and it doesn't come back if I delete the misspelled part of the method name. Is there any way to get back the popup after a misspelling without starting to type in the hole methodname again?

    Read the article

  • Why does File.Exists return false?

    - by Jonas Stawski
    I'm querying all images on the Android device as such: string[] columns = { MediaStore.Images.Media.InterfaceConsts.Data, MediaStore.Images.Media.InterfaceConsts.Id }; string orderBy = MediaStore.Images.Media.InterfaceConsts.Id; var imagecursor = ManagedQuery(MediaStore.Images.Media.ExternalContentUri, columns, null, null, orderBy); for (int i = 0; i < this.Count; i++) { imagecursor.MoveToPosition(i); Paths[i]= imagecursor.GetString(dataColumnIndex); Console.WriteLine(Paths[i]); Console.WriteLine(System.IO.File.Exists(Paths[i])); } The problem is that the output shows that some files don't exist. Here's a sample output: /storage/sdcard0/Download/On-Yom-Kippur-Jews-choose-different-shoes-VSETQJ6-x-large.jpg False /storage/sdcard0/Download/397277_10151250943161341_876027377_n.jpg False /storage/sdcard0/Download/Roxy_Cottontail_&_Melo-X_Present..._Some_Bunny_Love's_You.jpg False /storage/sdcard0/Download/album-The-Rolling-Stones-Some-Girls.jpg True /storage/sdcard0/Download/some-people-ust-dont-appreciate-fashion[1].jpg True /storage/sdcard0/Download/express.gif True ... /storage/sdcard0/Download/some-joys-are-expressed-better-in-silence.JPG False How is this possible? I downloaded these images myself from the internet! They should exist in disk.

    Read the article

  • Recursive powerof-function, see if you can solve it

    - by Jonas B
    First of all, this is not schoolwork - just my curiousity as I for some reason can't get my head around it and solve it. I come up with these stupid things all the time and it annoys the hell out of me when I cant solve them. Code example is in C# but solution doesn't have to be in any particular programming-language. long powerofnum(short num, long powerof) { return powerofnum2(num, powerof, powerof); } long powerofnum2(short num, long powerof, long holder) { if (num == 1) return powerof; else { return powerof = powerofnum2(num - 1, holder * powerof, holder); } } As you can see I have two methods. I call for powerofnum(value, powerofvalue) which then calls the next method with the powerofvalue also in a third parameter as a placeholder so it remembers the original powerof value through the recursion. What I want to accomplish is to do this with only one method. I know I could just declare a variable in the first method with the powerof value to remember it and then iterate from 0 to value of num. But as this is a theoretical question I want it done recursively. I could also in the first method just take a third parameter called whatever to store the value just like I do in the second method that is called by the first, but that looks really stupid. Why should you have to write what seems like the same parameter twice? Rules explained in short: no iteration scope-specific variables only only one method Anyhow, I'd appreciate a clean solution. Good luck :)

    Read the article

  • How can I do printing in Java with layouts instead of low level coordinates?

    - by Jonas
    I need to to some printing from my Java Swing application. I have tried to use Java Tutorials, but everything is very low level, and time-consuming. I have to specify the coordinates for every line that I want to print. It it also very lowlevel to use text, because I have to use FontMetrics and calculate what space all text fills up. Is there any easier way to to printing in Java? I would like to design the documents with something like layout managers instead. Any good library or API?

    Read the article

  • What webservers have support for HTML5 WebSocket?

    - by Jonas
    I would like to experiment with HTML5 WebSockets, and I am looking for a mature webserver with support for websockets. Is there a list of webservers that support websockets? What popular webservers has support for websockets? The server programming language doesn't matter, I know, Java, PHP, Erlang, Python and more... Just want to do some small experiments. I have looked at a few that doesn't support websockets (yet), i.e. Nginx, Apache and Mochiweb.

    Read the article

  • Ant path/pathelement not expanding properties correctly

    - by Jonas Byström
    My property gwt.sdk expands just fine everywhere else, but not inside a path/pathelement: <target name="setup.gwtenv"> <property environment="env"/> <condition property="gwt.sdk" value="${env.GWT_SDK}"> <isset property="env.GWT_SDK" /> </condition> <property name="gwt.sdk" value="/usr/local/gwt" /> <!-- Default value. --> </target> <path id="project.class.path"> <pathelement location="${gwt.sdk}/gwt-user.jar"/> </path> <target name="libs" depends="setup.gwtenv" description="Copy libs to WEB-INF/lib"> </target> <target name="javac" depends="libs" description="Compile java source"> <javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source"> <classpath refid="project.class.path"/> </javac> </target> For instance, placing an echo of ${gwt.sdk} just above works, but not inside "project.class.path". Is it a bug, or do I have to do something that I'm not? Edit: I tried moving the property out from target setup.gwtenv into "global space", that helped circumvent the problem.

    Read the article

  • Efficiency of the .NET garbage collector

    - by Jonas B
    OK here's the deal. There are some people who put their lives in the hands of .NET's garbage collector and some who simply wont trust it. I am one of those who partially trusts it, as long as it's not extremely performance critical (I know I know.. performance critical + .net not the favored combination), in which case I prefer to manually dispose of my objects and resources. What I am asking is if there are any facts as to how efficient or inefficient performance-wise the garbage collector really is? Please don't share any personal opinions or likely-assumptions-based-on-experience, I want unbiased facts. I also don't want any pro/con discussions because it won't answer the question. Thanks

    Read the article

  • How to customize Json serialization using Scala and Play Framework?

    - by Jonas
    I would like to serialize some Scala case classes to Json. E.g my case class looks like: case class Item ( id: Int, name: String, price: BigDecimal, created: java.util.Date) and I would like to serialize it to Json like this: {"id":3, "name": "apple", "price": 8.00, "created": 123424434} so I need a custom serilization for BigDecimal and for Date. Where I want the data in milliseconds since 1 jan 1970. When using Scala and Play Framework, I can return Json using Json(myObject), but how do I customize the serialization? Or is there any recommended Scala library?

    Read the article

  • How can I manage a FIFO-queue in an database with SQL?

    - by Jonas
    I have two tables in my database, one for In and one for Out. They have two columns, Quantity and Price. How can I write a SQL-query that selects the correct price? In example: If I have 3 items in for 75 and then 3 items in for 80. Then I have two out for 75, and the third out should be for 75 (X) and the fourth out should be for 80 (Y). How can I write the price query for X and Y? They should use the price from the third and forth row. In example, is there any way to SELECT the third row in the In-table? I can not use auto_increment as identifier for i.e. "third" row, because the tables will contain post for other items too. The rows will not be deleted, they will be saved for accountability reasons. SELECT Price FROM In WHERE ...? NEW database design: +----+ | In | +----+------+-------+ | Supply_ID | Price | +-----------+-------+ | 1 | 75 | | 1 | 75 | | 1 | 75 | | 2 | 80 | | 2 | 80 | +-----------+-------+ +-----+ | Out | +-----+-------+-------+ | Delivery_ID | Price | +-------------+-------+ | 1 | 75 | | 1 | 75 | | 2 | X | <- ? | 3 | Y | <- ? +-------------+-------+ OLD database design: +----+ | In | +----+------+----------+-------+ | Supply_ID | Quantity | Price | +-----------+----------+-------+ | 1 | 3 | 75 | | 2 | 3 | 80 | +-----------+----------+-------+ +-----+ | Out | +-----+-------+----------+-------+ | Delivery_ID | Quantity | Price | +-------------+----------+-------+ | 1 | 2 | 75 | | 2 | 1 | X | <- ? | 3 | 1 | Y | <- ? +-------------+----------+-------+

    Read the article

  • Get label height for fixed width

    - by Jonas
    Is there any way I can get the height of a label, if it hypothetically had a certain width? I've been trying with control.GetPreferredSize(size) like so: Dim wantedWidth as Integer = 100 dim ctrlSize as Size = label.GetPreferredSize(new Size(wantedWidth, 0)) because I thought that setting height = 0, would indicate a free height, but the height I get is way too small. I also tried to estimate the height of the label, using Graphics.MeasureString to calculate the equivalent area of the Label dim prefWidth as Integer = 100 dim estSize as SizeF = g.MeasureString(label.Text, label.Font) dim estHeight as Integer = (Integer)(estSize.Width * estSize.Height / prefWidth) but that yields the same result. Any ideas? I'm on .NET 2.0, unfortunately.

    Read the article

  • How can I bind a LinkedList as ItemSource to ListView in WPF XAML?

    - by Jonas
    I'm learning WPF and would like to have a collection similar to a LinkedList, to where I can add and remove strings. And I want to have a ListView that listen to that collection with databinding. How can I do bind a simple list collection to a ListView in XAML? My idea (not working) is something like this: <Window ...> <Window.Resources> <LinkedList x:Key="myList"></LinkedList> <Window.Resources> <Grid> <ListView Height="100" HorizontalAlignment="Left" Margin="88,134,0,0" Name="listView1" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Source={StaticResource myList}}"/> </Grid> </Window>

    Read the article

  • How can manage a FIFO-queue in an database with SQL?

    - by Jonas
    I have two tables in my database, one for In and one for Out. They have two columns, Quantity and Price. How can I write a SQL-query that selects the correct price? In example: If I have 3 items in for 75 and then 3 items in for 80. Then I have two out for 75, and the third out should be for 75 (X) and the fourth out should be for 80 (Y). How can I write the price query for X and Y? They should use the price from the third and forth row. In example, is there any way to SELECT the third row in the In-table? I can not use auto_increment as identifier for i.e. "third" row, because the tables will contain post for other items too. The rows will not be deleted, they will be saved for accountability reasons. SELECT Price FROM In WHERE ...? NEW database design: +----+ | In | +----+------+-------+ | Supply_ID | Price | +-----------+-------+ | 1 | 75 | | 1 | 75 | | 1 | 75 | | 2 | 80 | | 2 | 80 | +-----------+-------+ +-----+ | Out | +-----+-------+-------+ | Delivery_ID | Price | +-------------+-------+ | 1 | 75 | | 1 | 75 | | 2 | X | <- ? | 3 | Y | <- ? +-------------+-------+ OLD database design: +----+ | In | +----+------+----------+-------+ | Supply_ID | Quantity | Price | +-----------+----------+-------+ | 1 | 3 | 75 | | 2 | 3 | 80 | +-----------+----------+-------+ +-----+ | Out | +-----+-------+----------+-------+ | Delivery_ID | Quantity | Price | +-------------+----------+-------+ | 1 | 2 | 75 | | 2 | 1 | X | <- ? | 3 | 1 | Y | <- ? +-------------+----------+-------+

    Read the article

  • How to launch a Windows process as 64-bit from 32-bit code?

    - by Jonas
    To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this trick: ShellExecute(hWnd, "runas" /* display UAC prompt on Vista */, windir + "\\Reg", "add HKLM\\Software\\Company\\KeyName /v valueName /t REG_MULTI_TZ /d ValueData", NULL, SW_HIDE); This solution works fine, besides that our application is a 32-bit one, and it runs the REG.EXE command as it would be a 32-bit app using the WOW compatibility layer! :( If REG.EXE is ran from the command line, it's properly ran in 64-bit mode. This matters, because if it's ran as a 32-bit app, the registry keys will end up in the wrong place due to registry reflection. So is there any way to launch a 64-bit app programmatically from a 32-bit app and not have it run using the WOW64 subsystem like its parent 32-bit process (i.e. a "*" suffix in the Task Manager)?

    Read the article

  • How to make my Java Swing application a Client-Server application?

    - by Jonas
    I have made a Java Swing application. Now I would like to make it a Client-Server application. All clients should be notified when data on the server is changed, so I'm not looking for a Web Service. The Client-Server application will be run on a single LAN, it's a business application. The Server will contain a database, JavaDB. What technology and library is easiest to start with? Should I implement it from scratch using Sockets, or should I use Java RMI, or maybe JMS? Or are there other alternatives that are easier to start with? And is there any server library that I should use? Is Jetty an alternative?

    Read the article

  • "Unable to get system library for project" after I upgraded to Android SDK 2.3 and ADT 8.0

    - by Jonas
    Today I upgraded to Android SDK 2.3 and I also upgraded the Eclipse Plugin Androi Developer Tools 8.0 (from 0.9.9). I also upgraded my Java Development Kit to 1.6_22. Now in Eclipse I get many errors in all my Android projects. The error messages are like: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files. How can I fix this so I can use my Android projects again? In the Build Path for these projects, I don't have any references to an android.jar but a message: Unable to get system library for project

    Read the article

  • How can I customize the title bar on JFrame?

    - by Jonas
    I would like to have a customized title bar in my Java Swing desktop application. What is the best way to do that? I can use a "Swing-title bar" by using the following code in the constructor for my JFrame: this.setUndecorated(true); this.getRootPane().setWindowDecorationStyle(JRootPane.FRAME); But how do I customize it? Is there any UI delegates that I can override or do I have to implement my own title bar from scratch? I want something like Lawson Smart Office: Or like Trend Micro Internet Security:

    Read the article

  • What does size really mean in geom_point?

    - by Jonas Stein
    In both plots the points look different, but why? mya <- data.frame(a=1:100) ggplot() + geom_path(data=mya, aes(x=a, y=a, colour=2, size=seq(0.1,10,0.1))) + geom_point(data=mya, aes(x=a, y=a, colour=1, size=1)) + theme_bw() + theme(text=element_text(size=11)) ggplot() + geom_path(data=mya, aes(x=a, y=a, colour=2, size=1)) + geom_point(data=mya, aes(x=a, y=a, colour=1, size=1)) + theme_bw() + theme(text=element_text(size=11))

    Read the article

< Previous Page | 4 5 6 7 8 9 10  | Next Page >