Posts

android - Don't know how use wait() and notify() in Java -

this question has answer here: how use wait , notify in java? 12 answers i want make inside thread return did string, , i'd wait string other thins. i've been reading wait() , notify() dint it. can me? here create thread operations new thread( new runnable() { @override public void run() { synchronized(mensaje) { try { mensaje.wait(); mensaje = getfilesfromurl(value); } catch (interruptedexception e) { e.printstacktrace(); } } } }).start(); and here wait string mensaje changes if string not "" show button , text synchronized(mensaje) { if (mensaje.equals("")) { try { mensaje.wait(); } catch (interruptedexception e) { e.printstacktrace(); } } btnok.s...

java - Implement sound Interval Arithmetic -

how implement sound interval arithmetic in java? i need implement sound interval arithmetic java. let's take type double example, use iterval [ 0.09999....005 , 0.1000000...05 ] describe value range information of value " 0.1 ", because " 0.1 " cannot strictly represented ieee-754 standard, namely double type in java. when considering operation 0.1 * 0.1 , practical result may 0.01000...5 , or 0.00999..5 within different rounding modes. interval arithmetic result should [ lefthand , righthand ], , lefthand should less 0.01000...5 , righthand should more 0.00999..5 . when use type double implememnt arithmetic, meet 2 questions: when calculate left-hand of interval, want set rounding mode down, left-hand value less practical value. namely, need calculate number doule type less practical value , number double type more practical value. call interval arithmetical sound. i need function calculate maximum in 4 double numbers.namely, double max ( d1, ...

android - Define an attribute that extends a class in java -

i have following class: class foo { public void sayhello(){ system.out.println("hello"); } } and want class hold reference class extends foo (but can't foo). (erroneous syntax): class bar { private <e extends foo> e mfoo; } is possible? how can without declaring in class name this? class bar <e extends foo> { private e mfoo; } if can make foo abstract class might solve if main point e can't instance of foo. if foo isn't abstract still do public abstract class abstractfoo extends foo { } and declare e of type abstractfoo.

python - tkinter window title when using class to hold widgets -

i'm trying add window title tkinter application. .title('mytitle') seems work fine on simple examples, not i'm encapsulating widgets in class. here's simple example using "hello, again" tutorial www.pythonware.com/library/tkinter/introduction/ why not work? thanks! from tkinter import * class app: def __init__(self, master): frame = frame(master) frame.pack() self.button = button(frame, text="quit", fg="red", command=frame.quit) self.button.pack(side=left) self.hi_there = button(frame, text="hello", command=self.say_hi) self.hi_there.pack(side=left) def say_hi(self): print "hi there, everyone!" root = tk() app = app(root) root.title('blob') root.mainloop() as per marcin kowalczyk's comment, window size small show title. curiously, without widgets window expanded show title, hence assumption wasn't there. ...

c# - Generating big files in .NET -

i ask on 2 things .net executables: .net executable in pe format. mean address generated cil compiler beginning of file ( address+size_of_headers )? or these address used when executing image in memory? is possible generate (by cil compiler) executable size greater 4gb? if yes, compiler if has call method end of file or branch byte above 4gb limit? it's true have never seen c# executable greater 4gb, i'm curios. i think you're confusing how executing cil works how executing native code works. with cil, code in executable file not executed. (with desktop clr , without ngen) clr reads cil , generates actual executable code on fly (that's why part of clr called “just in time compiler”). cil opcodes call use tokens reference methods , other members. in generated native code, translated address of native code method. opcodes br contain offsets relative next cil instruction , can jump inside current method. on x86, compiled instructions jne , cont...

windows memory segmentation & Ollydbg -

a few questions windows memory segmentation. every process in windows got own virtual memory. mean each each process has own task (i mean own task descriptor or task gate) ? i opened simple exe ollydbg , saw each call intruction dll function taking me jumping table. jumping table had jumping instructions dlls 1 : jmp dword ptr ds:[402058] my question why uses data segment , not cs selector base address? if open memory map , find stored @ 402058 find containes resorces. if understand correctly addresses of dll function stored in ds ? i noticed memory map organized owner. shouldn't organized segments code in cs data in ds etc ? thank you 1. process has it's own virtual address space. not understand you're referring "task descriptor or task gate", windows operating system holds descriptor each process, called process control block , contains information process (such identification, access tokens, execution state, virtual memory mappin...

vim - Varying font size in gvim windows -

can make font size in nerdtree window smaller in other windows of gvim? generally need large font size of 15 i'd folder tree window of nerdtree 12 - possible set using code in _vimrc . have following simple setting: set guifont=consolas:h16:cansi slightly duplicated question , answered here: stackoverflow post stackoverflow post not possible bro. vim uses same font size windows. 1 (if not :d) limitation of vim.