Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 80/584 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Using an EJB inside a JAX-RS resource class in RestEasy?

    - by Laird Nelson
    I would like to have the following kind of resource class work when deployed under RestEasy in JBoss 6: @Path("Something") public class Foo { @EJB private SomeService service @GET public Object frobnicate() { assert service != null; // JBoss blows up here return result; } } Two questions: It is a limitation of RestEasy, not of the Java EE specification, right, that RestEasy can't inject anything annotated with @EJB? What have people done to work around this limitation? My developers are about to surge forward with hard-coded JNDI lookups (e.g. context.lookup(someHardCodedNameHere)) because no one can find a workaround to this specification violation at the present time. I really want to avoid this. Lastly, I've looked at using CDI, but the story here isn't much better as RestEasy and CDI still aren't talking to each other. Thanks in advance for any pointers.

    Read the article

  • Delphi How to wait for socket answer inside procedure?

    - by Astronavigator
    For some specific needs i need to create procedure that waits for socket request (or answer) in dll: TForm1 = class(TForm) ServerSocket1: TServerSocket; ...... procedure MyWaitProc; stdcall; begin Go := false; while not Go do begin // Wating... // Application.ProcessMessages; // Works with this line end; end; procedure TForm1.ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); begin MessageBoxA(0, PAnsiChar('Received: '+Socket.ReceiveText), '', MB_OK); Go := true; end; exports MyWaitProc; When I call Application.ProcessMessages everything works fine: application waits for request and then continues. But in my case calling Application.ProcessMessages causes to unlocking main form on host application (not dll's one). When I don't call Application.ProcessMessages application just hangs couse it cannot handle message... So, how to create such a procedure that's wating for socket answer ? Maybe there a way to wait for socket answer without using Application.ProcessMessages ? EDIT I also tried to use TIdTCPServer, for some reasons, the result is the same. TForm1 = class(TForm) IdTCPServer1: TIdTCPServer; ..... procedure MyWaitProc; stdcall; begin Go := false; while not Go do begin // Waiting ... // Application.ProcessMessages; end; end; procedure TForm1.IdTCPServer1Execute(AContext: TIdContext); var s: string; begin s := AContext.Connection.Socket.ReadString(1); AllText := AllText + s; Go := True; end;

    Read the article

  • How to specify a route member inside a block in Rails?

    - by yuval
    The following code: map.resources :users, :has_many => :items Could be written like this in a block: map.resources :users do |user| user.resources :items end How could I write the following code in a block? map.resources :users, :member => { :start => :post } Also, where could I find documentation on writing routes in blocks? The Routes Documentation does not seem to show it. Thank you!

    Read the article

  • How is it possible to get the forms mouseposition when clicking inside a control?

    - by ikky
    Hi. I have a panel and have added a PictureBox to it. I have added mouse_click listeners to both the panel and the picturebox. When they are clicked i create a messagebox which tells me the mouse position. Problem: When i click the panel, i get the mouse position i want. When i click the pictureBox, i get the current position in that picturebox. What i want: I want both of the controls to get the current mouseposition on the form. I can also go with getting the current mouseposition of the panel, since it is overlaying the form. Does anybody know how i can do this? I've googled around for this, but can't seem to find anything about it. Thank you in advance.

    Read the article

  • C# Is it possible to interrupt a specific thread inside a ThreadPool?

    - by Lirik
    Suppose that I've queued a work item in a ThreadPool, but the work item blocks if there is no data to process (reading from a BlockingQueue). If the queue is empty and there will be no more work going into the queue, then I must call the Thread.Interrupt method if I want to interrupt the blocking task, but how does one do the same thing with a ThreadPool? The code might look like this: void Run() { try { while(true) { blockingQueue.Dequeue(); doSomething(); } } finally { countDownLatch.Signal(); } } I'm aware that the best thing to do in this situation is use a regular Thread, but I'm wondering if there is a ThreadPool equivalent way to interrupt a work item.

    Read the article

  • How to access a control placed inside data template of listbox?

    - by Subhen
    Hi I have the following code: <ListBox x:Name="foldersListBox" Grid.Column="0" MouseLeftButtonUp="foldersListBox_MouseLeftButtonUp" BorderThickness="0" Height="AUTO" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <DataTemplate> <Border BorderBrush="LightGray" BorderThickness="2" CornerRadius="4"> <Image x:Name="folderImage" Width="70" Height="70" Margin="3" /> </Border> </DataTemplate> </ListBox> Now when I am trying to access folderImage from code behind. I can use the loaded event and typecast the sender as Image type , but I dont want that way. Help plz. Thanks, Subhen

    Read the article

  • Can I add an additional eula/tos inside my app on top of the iphone app store agreement

    - by nickthedude
    I have an app that allows users to generate and publish content. I would like to possibly be able to use the content they publish/create to make derivative works, ie books etc (similar to what icanhazcheeseburger has done.) If I were to put an opt in alert to ask the user whether or not they would like to be a part of this, would this violate the iphone sdk? I know this is not programming question so I'm not sure if this is a fair question, but I thought I heard something like you can't add a eula you have to abide by whatever apple dictates in their app store agreement. Also if you have suggestions on different ways to approach getting users to agree to this I'm all ears, but yes that is kind of subjective. Thanks folks, Nick

    Read the article

  • How can call a jQuery function when it is inside the formview (asp.net control)?

    - by ricky roy
    Hi, All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this? Thanks Waiting for your reply here is my code <asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand"> <ItemTemplate> <asp:HiddenField ID="hidProductID" Value='<%#Eval("ProductID") %>' runat="server" /> <asp:HiddenField ID="hidCustomerID" Value='<%#Eval("CustomerID") %>' runat="server" /> <a href='<%=WinToSave.SettingsConstants.SiteURL%>WintoSave/AuctionProduct.aspx?id=<%#Eval("ProductID") %>'> <%#Eval("ProductName")%> </a> <br /> <img src='<%#Eval("ImagePath")%>' alt="Image No available" /> <br /> <asp:Label ID="lblTime" runat="server" Text='<%#Convert.ToDateTime(Eval("ModifiedOn")).ToString("hh:mm:ss") %>'></asp:Label> <span id='Countdown_<%#Eval("ProductID") %>' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%>','Countdown_<%#Eval("ProductID") %>');"></span> <br /> <asp:Label ID="lblFinalPrice" runat="server" Text='<%#Convert.ToDouble(Eval("FinalPrice")).ToString("#.00")%>'></asp:Label> <br /> <asp:Label ID="lblFullName" runat="server" Text='<%#Eval("FullName") %>'></asp:Label> <br /> <asp:Button ID="btnAddbid" Text="Bid" CommandName="AddBid" CommandArgument='<%#Eval("ID")%>' runat="server" /> </ItemTemplate> </asp:FormView> and following is my jquery code function GetTimeOnLoad(shortly,DivID) { var dt = new Date(shortly); alert(dt); alert(shortly); alert(DivID); var ProductDivID = "#" +DivID; alert(ProductDivID); $(ProductDivID).countdown({ until: dt, onExpiry: liftOff, onTick: watchCountdown, format: 'HMS', layout: '{hnn}{sep}{mnn}{sep}{snn}' }); } function liftOff(){}; function watchCountdown(){}; In above code I Used ' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%','Countdown_<%#Eval("ProductID") %');" but is not working

    Read the article

  • Graphics glitch when drawing to a Cairo context obtained from a gtk.DrawingArea inside a gtk.Viewport.

    - by user410023
    I am trying to redraw the part of the DrawingArea that is visible in the Viewport in the expose-event handler. However, it seems that I am doing something wrong with the coordinates that are passed to the event handler because there is garbage at the edge of the Viewport when scrolling. Can anyone tell what I am doing wrong? Here is a small example: import pygtk pygtk.require("2.0") import gtk from numpy import array from math import pi class Circle(object): def init(self, position = [0., 0.], radius = 0., edge = (0., 0., 0.), fill = None): self.position = position self.radius = radius self.edge = edge self.fill = fill def draw(self, ctx): rect = array(ctx.clip_extents()) rect[2] -= rect[0] rect[3] -= rect[1] center = rect[2:4] / 2 ctx.arc(center[0], center[1], self.radius, 0., 2. * pi) if self.fill != None: ctx.set_source_rgb(*self.fill) ctx.fill_preserve() ctx.set_source_rgb(*self.edge) ctx.stroke() class Scene(object): class Proxy(object): directory = {} def init(self, target, layers = set()): self.target = target self.layers = layers Scene.Proxy.directory[target] = self def __init__(self, viewport): self.objects = {} self.layers = [set()] self.viewport = viewport self.signals = {} def draw(self, ctx): x = self.viewport.get_hadjustment().value y = self.viewport.get_vadjustment().value ctx.set_source_rgb(1., 1., 1.) ctx.paint() ctx.translate(x, y) for obj in self: obj.draw(ctx) def add(self, item, layer = 0): item = Scene.Proxy(item, layers = set((layer,))) assert(hasattr(item.target, "draw")) assert(isinstance(layer, int)) item.layers.add(layer) while not layer < len(self.layers): self.layers.append(set()) self.layers[layer].add(item) if not item in self.objects: self.objects[item] = set() self.objects[item].add(layer) def remove(self, item, layers = None): item = Scene.Proxy.directory[item] if layers == None: layers = self.objects[item] for layer in layers: layer.remove(item) item.layers.remove(layer) if len(item.layers) == 0: self.objects.remove(item) def __iter__(self): for layer in self.layers: for item in layer: yield item.target class App(object): def init(self): signals = { "canvas_exposed": self.update_canvas, "gtk_main_quit": gtk.main_quit } self.builder = gtk.Builder() self.builder.add_from_file("graphics_glitch.glade") self.window = self.builder.get_object("window") self.viewport = self.builder.get_object("viewport") self.canvas = self.builder.get_object("canvas") self.scene = Scene(self.viewport) signals.update(self.scene.signals) self.builder.connect_signals(signals) self.window.show() def update_canvas(self, widget, event): ctx = self.canvas.window.cairo_create() self.scene.draw(ctx) ctx.clip() if name == "main": app = App() scene = app.scene scene.add(Circle((0., 0.), 10.)) gtk.main() And the Glade file "graphics_glitch.glade": <?xml version="1.0"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window"> <property name="width_request">200</property> <property name="height_request">200</property> <property name="visible">True</property> <signal name="destroy" handler="gtk_main_quit"/> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hadjustment">h_adjust</property> <property name="vadjustment">v_adjust</property> <property name="hscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property> <child> <object class="GtkViewport" id="viewport"> <property name="visible">True</property> <property name="resize_mode">queue</property> <child> <object class="GtkDrawingArea" id="canvas"> <property name="width_request">640</property> <property name="height_request">480</property> <property name="visible">True</property> <signal name="expose_event" handler="canvas_exposed"/> </object> </child> </object> </child> </object> </child> </object> <object class="GtkAdjustment" id="h_adjust"> <property name="lower">-1000</property> <property name="upper">1000</property> <property name="step_increment">1</property> <property name="page_increment">25</property> <property name="page_size">25</property> </object> <object class="GtkAdjustment" id="v_adjust"> <property name="lower">-1000</property> <property name="upper">1000</property> <property name="step_increment">1</property> <property name="page_increment">25</property> <property name="page_size">25</property> </object> </interface> Thanks! --Dan

    Read the article

  • Storage servers architectural solution for backup. What is the best way? (pics inside)

    - by Kirzilla
    Hello, What is the best architecture for storage servers array? Needs... a) easy way to add one more server to array b) we don't have single backup server c) we need to have one backup for each "web" part of each server Group #1 : is cross-server-backuping scheme; the main disadvantage that we can't add one more server, we should add 2 servers in one time. Group #2 : is a Group #1, but with three and more servers. It also have a disadvantage - to add one more server we should move existing backup to it. Any suggestions? Thank you. Thank you.

    Read the article

  • Java: 2-assignments-2-initializations inside for-loop not allowed?

    - by HH
    $ javac MatchTest.java MatchTest.java:7: ')' expected for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) ^ MatchTest.java:7: ';' expected for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) ^ MatchTest.java:7: ';' expected for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) ^ MatchTest.java:7: not a statement for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) ^ MatchTest.java:7: illegal start of expression for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) ^ 5 errors $ cat MatchTest.java import java.util.*; import java.io.*; public class MatchTest { public static void main(String[] args){ String text = "hello0123456789hello0123456789hello1234567890hello3423243423232"; for((int i=-1 && String match="hello"); (i=text.indexOf(match)+1);) System.out.println(i); } }

    Read the article

  • Can I force Apache 2.2 connection close from inside a C module?

    - by Amos Shapira
    Hello, We'd like to have a more fine-grained control on the connections we serve in a C++ Apache 2.2 module (on CentOS 5). One of the connections needs to stay alive for a few multiple requests, so we set "KeepAlive" to "On" and set a short keep-alive period. But for every such connection we have a few more connections from the browser which we don't need to leave behind and instead want to force them to close after a single request. Some of these connections are on different ports (so we can distinguish them by port, since KeepAlive can be set per virtual host) and some request a different URL (so we can tell from the path and parameters that we don't want to leave them behind). Also for the one we do want to keep alive, we know that after a certain request we'd like to close it too. But so far the only way we found to "cancel" the keep-alive is to send a polite "Connection: close" header to the client. If the client is not well behaved, or malicious, then they can keep it open and waste our resources. Is there a way to tell Apache to close the connection from the server side? The documentation advises against just plain close(2) call on the socket since Apache needs to do some clean up before that's done. But is there some API or a trick to "override" the static "KeepAlive On" configuration dynamically (and convince Apache to call close(2))? Thanks.

    Read the article

  • How to get the real type of a value inside string?

    - by CuSS
    I was searching here on StackOverflow about converting string to the real value and i didn't found. I need a function like "gettype" that does something like the result above, but i can't do it all :s gettypefromstring("1.234"); //returns (doble)1,234; gettypefromstring("1234"); //returns (int)1234; gettypefromstring("a"); //returns (char)a; gettypefromstring("true"); //returns (bool)true; gettypefromstring("khtdf"); //returns (string)"khtdf"; Thanks to all :)

    Read the article

  • How does SQL Server treat statements inside stored procedures with respect to transactions?

    - by Sleepless
    Hi All! Say I have a stored procedure consisting of several seperate SELECT, INSERT, UPDATE and DELETE statements. There is no explicit BEGIN TRANS / COMMIT TRANS / ROLLBACK TRANS logic. How will SQL Server handle this stored procedure transaction-wise? Will there be an implicit connection for each statement? Or will there be one transaction for the stored procedure? Also, how could I have found this out on my own using T-SQL and / or SQL Server Management Studio? Thanks!

    Read the article

  • memory of drawables, is it better to have resources inside APK, outside APK or is it the same for me

    - by Daniel Benedykt
    Hi I have an application that draws a lot of graphics and change them. Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder. But I started to get outOfMemory exceptions. The question is: Does android handle memory different if I load a graphic from APK than if I load it from 'disk'? code using APK: topView.setBackgroundResource(R.drawable.bg); code if image is outside APK: Drawable d = Drawable.createFromPath(pathName); topView.setBackgroundDrawable(d); Thanks Daniel

    Read the article

  • Children inside <a href> trigger mouseout. How to prevent that?

    - by stagas
    I have this: <a href="javascript:void(0);"> <div> <span>some content</span> <span>some content</span> </div> </a> The problem is hovering the mouse over from one <span> to another triggers an instant mouseout and mouseover again even though they have no padding or margin between them. Even on the browser's status bar the link flickers for an instant. How can this be prevented?

    Read the article

  • If I do "jquery sortable" on a contenteditable item(s), I then can't focus mouse anywhere inside con

    - by Matej
    Strangely this is broken only in Firefox and Opera (IE, Chrome and Safari works as it should). Any suggestion for a quick fix? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $('#sortable').sortable(); }); </script> </head> <body> <span id="sortable"> <p contenteditable="true">One apple</p> <p>Two pears</p> <p>Three oranges</p> </span> </body> </html>

    Read the article

  • How to I pass parameters to Ruby/Python scripts from inside PHP?

    - by Roger
    Hi, everybody. I need to turn HTML into equivalent Markdown-structured text. From what I could discover, I have only two good choices: Python: Aaron Swartz's html2text.py Ruby: Singpolyma's html2markdown.rb As I am programming in PHP, I need to pass the HTML code, call the Ruby/Python Script and receive the output back. I started creating a simple test just to know if my server was configured to run both languages. PHP code: echo exec('./hi.rb'); Ruby code: #!/usr/bin/ruby puts "Hello World!" It worked fine and I am ready to go to the next step. Unfortunately, all I know is that the function is Ruby works like this: HTML2Markdown.new('<h1>HTMLcode</h1>').to_s I don't know how to make PHP pass the string (with the HTML code) to Ruby nor how to make the ruby script receive the variable and pass it back to PHP (after have parsed it into Markdown). Believe it or not: I know less of Python. A folk made a similar question here ("how to call ruby script from php?") but with no practical information to my case. Any help would be a joy - thanks. Rogério Madureira. atipico.com.br

    Read the article

  • How to determine position (x,y) relative to the page of every character inside spans through javascript?

    - by Fernando
    This is as simple as I can get. I will have several spans randomly positioned on the screen through something like: $(".hidden:first").css('-webkit-transform','rotate('+((0.5-Math.random())*40)+'deg)'); $(".hidden:first").animate({ left: '+=' + (((screen.width-800-224)/2) + Math.random()*800), top: '+=' + (50+Math.random()*600) } [...] and later on I would like to iterate through every char of every of those elements (that are randomly position and have random rotation), and I would need to discover the (x,y) position of every character on the screen so I can colorize it, forming certain draws according to certain functions. Is this easily achievable? I am really inexperienced at javascript. Thanks. Fernando.

    Read the article

  • Email from an app, but not use a a pop up controller, just text inside a text box.

    - by Sam Jarman
    Hey is there any way to send whats in a text view (im trying to make a suggestion box) to my email address? example user types in the box " I think you should add twitter support" then that is sent in the background to my email address [email protected] then a message is popped up on the screen saying "suggestion sent" just an example of what i mean Any ideas, tutorial links would be greatly appreciated guys Thanks

    Read the article

  • Why does LINQ-to-SQL Paging fail inside a function?

    - by ssg
    Here I have an arbitrary IEnumerable<T>. And I'd like to page it using a generic helper function instead of writing Skip/Take pairs every time. Here is my function: IEnumerable<T> GetPagedResults<T>(IEnumerable<T> query, int pageIndex, int pageSize) { return query.Skip((pageIndex - 1) * pageSize).Take(pageSize); } And my code is: result = GetPagedResults(query, 1, 10).ToList(); This produces a SELECT statement without TOP 10 keyword. But this code below produces the SELECT with it: result = query.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); What am I doing wrong in the function?

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >