Search Results

Search found 861 results on 35 pages for 'wrapping'.

Page 1/35 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Text Wrapping in SSRS

    - by anna
    Hi, How do I accomplish text wrapping of table fields in SSRS Report, and proper landscaping when rendering the report to PDF format Thanks in advance Anna

    Read the article

  • IE6 HTML control wrapping

    - by astonius
    Is there any way to prevent wrapping across controls in IE6? For example, I have a label and a single select box. The select box width is dynamic (depending on the content). I want the label to always be to the left of the select box. Right now the problem I am having is the select box drops below the label. I have tried using the <nobr> tag as well as CSS word-wrap rules, but because this isn't text the wrapping rules do not apply. The only way I have found for sure to make it work is to place them in a two-column table, but I do not like this solution. Is there any other way?

    Read the article

  • Blackberry ListField Text Wrapping - only two lines.

    - by Diego Tori
    Within my ListField, I want to be able to take any given long String, and just be able to wrap the first line within the width of the screen, and just take the remaining string and display it below and ellipsis the rest. Right now, this is what I'm using to detect wrapping within my draw paint call: int totalWidth = 0; int charWidth = 0; int lastIndex = 0; int spaceIndex = 0; int lineIndex = 0; String firstLine = ""; String secondLine = ""; boolean isSecondLine = false; for (int i = 0; i < longString.length(); i++){ charWidth = Font.getDefault().getAdvance(String.valueOf(longString.charAt(i))); //System.out.println("char width: " + charWidth); if(longString.charAt(i) == ' ') spaceIndex = i; if((charWidth + totalWidth) > (this.getWidth()-32)){ //g.drawText(longString.substring(lastIndex, spaceIndex), xpos, y +_padding, DrawStyle.LEFT, w - xpos); lineIndex++; System.out.println("current lines to draw: " + lineIndex); /*if (lineIndex = 2){ int idx = i; System.out.println("first line " + longString.substring(lastIndex, spaceIndex)); System.out.println("second line " + longString.substring(spaceIndex+1, longString.length())); }*/ //firstLine = longString.substring(lastIndex, spaceIndex); firstLine = longString.substring(0, spaceIndex); //System.out.println("first new line: " +firstLine); //isSecondLine=true; //xpos = 0; //y += Font.getDefault().getHeight(); i = spaceIndex + 1; lastIndex = i; System.out.println("Rest of string: " + longString.substring(lastIndex, longString.length())); charWidth = 0; totalWidth = 0; } totalWidth += charWidth; System.out.println("total width: " + totalWidth); //g.drawText(longString.substring(lastIndex, i+1), xpos, y + (_padding*3)+4, DrawStyle.ELLIPSIS, w - xpos); //secondLine = longString.substring(lastIndex, i+1); secondLine = longString.substring(lastIndex, longString.length()); //isSecondLine = true; } Now this does a great job of actually wrapping any given string (assuming the y values were properly offsetted and it only drew the text after the string width exceeded the screen width, as well as the remaining string afterwards), however, every time I try to get the first two lines, it always ends up returning the last two lines of the string if it goes beyond two lines. Is there a better way to do this sort of thing, since I am fresh out of ideas?

    Read the article

  • Patterns for wrapping a command line tool in another language

    - by Tom Duckering
    I'm currently writing some Java to wrap around an extensive command line tool. It feels like I'm writing a lot of similar code. I'm wondering if there are any established patterns for wrapping command line tools - passing arguments and handling output and so on. Specific examples in Java would obviously be great, but any general suggestions or pointers are welcome too.

    Read the article

  • Wrapping a pure virtual method with multiple arguments with Boost.Python

    - by fallino
    Hello, I followed the "official" tutorial and others but still don't manage to expose this pure virtual method (getPeptide) : ms_mascotresults.hpp class ms_mascotresults { public: ms_mascotresults(ms_mascotresfile &resfile, const unsigned int flags, double minProbability, int maxHitsToReport, const char * unigeneIndexFile, const char * singleHit = 0); ... virtual ms_peptide getPeptide(const int q, const int p) const = 0; } ms_mascotresults.cpp #include <boost/python.hpp> using namespace boost::python; #include "msparser.hpp" // which includes "ms_mascotresults.hpp" using namespace matrix_science; #include <iostream> #include <sstream> struct ms_mascotresults_wrapper : ms_mascotresults, wrapper<ms_mascotresults> { ms_peptide getPeptide(const int q, const int p) { this->get_override("getPeptide")(q); this->get_override("getPeptide")(p); } }; BOOST_PYTHON_MODULE(ms_mascotresults) { class_<ms_mascotresults_wrapper, boost::noncopyable>("ms_mascotresults") .def("getPeptide", pure_virtual(&ms_mascotresults::getPeptide) ) ; } Here are the bjam's errors : /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:66: error: cannot declare field ‘boost::python::objects::value_holder<ms_mascotresults_wrapper>::m_held’ to be of abstract type ‘ms_mascotresults_wrapper’ ms_mascotresults.cpp:12: note: because the following virtual functions are pure within ‘ms_mascotresults_wrapper’: ... include/ms_mascotresults.hpp:334: note: virtual matrix_science::ms_peptide matrix_science::ms_mascotresults::getPeptide(int, int) const ms_mascotresults.cpp: In constructor ‘ms_mascotresults_wrapper::ms_mascotresults_wrapper()’: ms_mascotresults.cpp:12: error: no matching function for call to ‘matrix_science::ms_mascotresults::ms_mascotresults()’ include/ms_mascotresults.hpp:284: note: candidates are: matrix_science::ms_mascotresults::ms_mascotresults(matrix_science::ms_mascotresfile&, unsigned int, double, int, const char*, const char*) include/ms_mascotresults.hpp:109: note: matrix_science::ms_mascotresults::ms_mascotresults(const matrix_science::ms_mascotresults&) ... /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp: In constructor ‘boost::python::objects::value_holder<Value>::value_holder(PyObject*) [with Value = ms_mascotresults_wrapper]’: /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:137: note: synthesized method ‘ms_mascotresults_wrapper::ms_mascotresults_wrapper()’ first required here /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:137: error: cannot allocate an object of abstract type ‘ms_mascotresults_wrapper’ ms_mascotresults.cpp:12: note: since type ‘ms_mascotresults_wrapper’ has pure virtual functions So I tried to change the constructor's signature by : BOOST_PYTHON_MODULE(ms_mascotresults) { //class_<ms_mascotresults_wrapper, boost::noncopyable>("ms_mascotresults") class_<ms_mascotresults_wrapper, boost::noncopyable>("ms_mascotresults", init<ms_mascotresfile &, const unsigned int, double, int, const char *,const char *>()) .def("getPeptide", pure_virtual(&ms_mascotresults::getPeptide) ) Giving these errors : /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:66: error: cannot declare field ‘boost::python::objects::value_holder<ms_mascotresults_wrapper>::m_held’ to be of abstract type ‘ms_mascotresults_wrapper’ ms_mascotresults.cpp:12: note: because the following virtual functions are pure within ‘ms_mascotresults_wrapper’: include/ms_mascotresults.hpp:334: note: virtual matrix_science::ms_peptide matrix_science::ms_mascotresults::getPeptide(int, int) const ... ms_mascotresults.cpp:24: instantiated from here /usr/local/boost_1_42_0/boost/python/object/value_holder.hpp:137: error: no matching function for call to ‘ms_mascotresults_wrapper::ms_mascotresults_wrapper(matrix_science::ms_mascotresfile&, const unsigned int&, const double&, const int&, const char* const&, const char* const&)’ ms_mascotresults.cpp:12: note: candidates are: ms_mascotresults_wrapper::ms_mascotresults_wrapper(const ms_mascotresults_wrapper&) ms_mascotresults.cpp:12: note: ms_mascotresults_wrapper::ms_mascotresults_wrapper() If I comment the virtual function getPeptide in the .hpp, it builds perfectly with this constructor : class_<ms_mascotresults>("ms_mascotresults", init<ms_mascotresfile &, const unsigned int, double, int, const char *,const char *>() ) So I'm a bit lost...

    Read the article

  • How to prevent the floating layout wrapping when firefox zoom is reduced

    - by Dmitri Zhuchkov
    Given the following HTML. It display two columns: #left, #right. Both are fixed width and have 1px borders. Width and borders equal the size of upper container: #wrap. When I zoom out Firefox 3.5.2 by pressing Ctrl+- columns get wrapped (demo). How to prevent this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test</title> <style type="text/css"> div {float:left} #wrap {width:960px} #left, #right {width:478px;border:1px solid} </style> </head> <body> <div id="wrap"> <div id="left"> left </div> <div id="right"> right </div> </div> </body> </html>

    Read the article

  • ReSharper wrapping test result stacktraces?

    - by lance
    ReSharper 4.5's test runner will run MSTest tests out of the box, and that's what I'm doing. When a test fails, I click on the test to see the stacktrace and the failure reason. The pane I'm clicking in to do this is the "Unit Test Sessions" pane. The lower half of this pane (or the right half, if you have it configured that way) shows the reason and stacktrace for the failure. This section/pane does not word wrap, so I have to use the mouse to scroll left and right all the time. How can I make this reason/stacktrace pane word wrap?

    Read the article

  • wxPthon problems with Wrapping StaticText

    - by Scott B
    Hello. I am having an issue with wxPython. A simplified version of the code is posted below (white space, comments, etc removed to reduce size - but the general format to my program is kept roughly the same). When I run the script, the static text correctly wraps as it should, but the other items in the panel do not move down (they act as if the statictext is only one line and thus not everything is visible). If I manually resize the window/frame, even just a tiny amount, everything gets corrected and displays as it is should. I took screen shots to show this behavior, but I just created this account and thus don't have the required 10 reputation points to be allowed to post pictures. Why does it not display correctly to begin with? I've tried all sorts of combination's of GetParent().Refresh() or Update() and GetTopLevelParent().Update() or Refresh(). I've tried everything I can think of but cannot get it to display correctly without manually resizing the frame/window. Once re-sized, it works exactly as I want it to. Information: Windows XP Python 2.5.2 wxPython 2.8.11.0 (msw-unicode) Any suggestions? Thanks! Code: #! /usr/bin/python import wx class StaticWrapText(wx.PyControl): def __init__(self, parent, id=wx.ID_ANY, label='', pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER, validator=wx.DefaultValidator, name='StaticWrapText'): wx.PyControl.__init__(self, parent, id, pos, size, style, validator, name) self.statictext = wx.StaticText(self, wx.ID_ANY, label, style=style) self.wraplabel = label #self.wrap() def wrap(self): self.Freeze() self.statictext.SetLabel(self.wraplabel) self.statictext.Wrap(self.GetSize().width) self.Thaw() def DoGetBestSize(self): self.wrap() #print self.statictext.GetSize() self.SetSize(self.statictext.GetSize()) return self.GetSize() class TestPanel(wx.Panel): def __init__(self, *args, **kwargs): # Init the base class wx.Panel.__init__(self, *args, **kwargs) self.createControls() def createControls(self): # --- Panel2 ------------------------------------------------------------- self.Panel2 = wx.Panel(self, -1) msg1 = 'Below is a List of Files to be Processed' staticBox = wx.StaticBox(self.Panel2, label=msg1) Panel2_box1_v1 = wx.StaticBoxSizer(staticBox, wx.VERTICAL) Panel2_box2_h1 = wx.BoxSizer(wx.HORIZONTAL) Panel2_box3_v1 = wx.BoxSizer(wx.VERTICAL) self.wxL_Inputs = wx.ListBox(self.Panel2, wx.ID_ANY, style=wx.LB_EXTENDED) sz = dict(size=(120,-1)) wxB_AddFile = wx.Button(self.Panel2, label='Add File', **sz) wxB_DeleteFile = wx.Button(self.Panel2, label='Delete Selected', **sz) wxB_ClearFiles = wx.Button(self.Panel2, label='Clear All', **sz) Panel2_box3_v1.Add(wxB_AddFile, 0, wx.TOP, 0) Panel2_box3_v1.Add(wxB_DeleteFile, 0, wx.TOP, 0) Panel2_box3_v1.Add(wxB_ClearFiles, 0, wx.TOP, 0) Panel2_box2_h1.Add(self.wxL_Inputs, 1, wx.ALL|wx.EXPAND, 2) Panel2_box2_h1.Add(Panel2_box3_v1, 0, wx.ALL|wx.EXPAND, 2) msg = 'This is a long line of text used to test the autowrapping ' msg += 'static text message. ' msg += 'This is a long line of text used to test the autowrapping ' msg += 'static text message. ' msg += 'This is a long line of text used to test the autowrapping ' msg += 'static text message. ' msg += 'This is a long line of text used to test the autowrapping ' msg += 'static text message. ' staticMsg = StaticWrapText(self.Panel2, label=msg) Panel2_box1_v1.Add(staticMsg, 0, wx.ALL|wx.EXPAND, 2) Panel2_box1_v1.Add(Panel2_box2_h1, 1, wx.ALL|wx.EXPAND, 0) self.Panel2.SetSizer(Panel2_box1_v1) # --- Combine Everything ------------------------------------------------- final_vbox = wx.BoxSizer(wx.VERTICAL) final_vbox.Add(self.Panel2, 1, wx.ALL|wx.EXPAND, 2) self.SetSizerAndFit(final_vbox) class TestFrame(wx.Frame): def __init__(self, *args, **kwargs): # Init the base class wx.Frame.__init__(self, *args, **kwargs) panel = TestPanel(self) self.SetClientSize(wx.Size(500,500)) self.Center() class wxFileCleanupApp(wx.App): def __init__(self, *args, **kwargs): # Init the base class wx.App.__init__(self, *args, **kwargs) def OnInit(self): # Create the frame, center it, and show it frame = TestFrame(None, title='Test Frame') frame.Show() return True if __name__ == '__main__': app = wxFileCleanupApp() app.MainLoop() EDIT: See my post below for a solution that works!

    Read the article

  • Programmatic Text Wrapping in TextView

    - by Andrew
    I'm working on a custom widget for my application to replicate the look of a Preference button for layouts. The issue is the 'summary' text wont wrap when it hits the right wall of the view. One of the goals I'm trying to keep is that this widget is completely made from java with no xml attributes. here's what the widget looks like at the moment: http://dl.dropbox.com/u/56017670/Screenshot_2012-09-05-17-22-45.png notice that the middle two don't wrap the text but the text obviously runs right off the edge of the widget below is the code I'm using to create the text view. public void setSummary(String summary) { if (!TextUtils.isEmpty(summary)) { if (mSummaryView == null) { mSummaryView = new TextView(mContext); mSummaryView.setTextSize(14); mSummaryView.setTextColor(mContext.getResources().getColor( android.R.color.tertiary_text_dark)); addView(mSummaryView); } mSummaryView.setText(summary); mSummaryView.setVisibility(View.VISIBLE); } else { if (mSummaryView != null) { mSummaryView.setVisibility(View.GONE); } } mSummaryText = summary; } and here is the code I'm using to layout mSummaryView mSummaryView.layout( mPreferencePadding + mIconWidth, centerVertical + (mCombinedTextHeight / 2) - mSummaryHeight, width - mPreferencePadding, centerVertical + (mCombinedTextHeight / 2)); I've tried to add mSummaryView.setSingleLine(false); along with quite a few other tricks but they all ended in the same way.

    Read the article

  • Approach to data wrapping

    - by Mikhail
    I'm developing in PHP and MySQL. The information about the currently logged in user is stored in many different tables. The information that I need on each page, I preload. However if something is needed from a rarely accessed table - then I do $newdata = $db->Query('SELECT * FROM rare_table WHERE user_id='.$user->id); I would like to simplify the above to a point where I don't have to specify that the query should be limited to this particular user. An ideal function call would be: $newdata = $user->Query('SELECT * FROM rare_table'); Obviously I'd have to parse the SQL and add a WHERE clause. Or add to the already existing clause. Questions: are there tools to do this? How can I develop this? Is this even a good idea?

    Read the article

  • Lazy HTML attributes wrapping in Internet Explorer

    - by AGS777
    Having encountered this Internet Explorer (all versions) behavior several times previously, I eventually decided to share this most probably useless knowledge. Excuse my lengthy explanations because I am going to show the behavior along with a very simple case when one can come across it inadvertently. Let's say I want to implement some simple templating solution in JavaScript. I wrote an HTML template with an intention to bind data to it on the client side: Please note, that name of the “sys-template” class is just a coincidence. I do not use any ASP.NET AJAX code in this simple example. As you can see we need to replace placeholders (property name wrapped with curly braces) with actual data. Also, as you can see, many of the placeholders are situated within attribute values and it is where the danger lies. I am going to use <a /> element HTML as a template and replace each placeholder pattern with respective properties’ values with a little bit of jQuery like this: You can find complete code along with the contextFormat() method definition at the end of the post. Let’s assume that value for the name property (that we want to put in the title attribute) of the first data item is “first tooltip”. So it consists of two words. When the replacement occurred, title attribute should contain the “first tooltip” text which we are going to see as a tooltip for the <a /> element. But let’s run the sample code in Internet Explorer and check it out. What you’ll see is that only the first word of the supposed “title” attribute’s content is shown. So, were is the rest of my attribute and what happened? The answer is obvious once you see the result of jQuery(“.sys-template”).html() line for the given HTML markup. In IE you’ll get the following <A id={id} class={cssClass} title={name} href="{source}" myAttr="{attr}">Link to {source}</A> See any difference between this HTML and the one shown earlier? No? Then look carefully. While the original HTML of the <a /> element is well-formed and all the attributes are correctly quoted, when you take the same HTML back in Internet Explorer (it doesn’t matter whether you use html() method from jQuery library or IE’s innerHTML directly), you lose attributes’ quotes for some of the attributes. Then, after replacement, we’ll get following HTML for our first data item. I marked the attribute value in question with italic: <A id=1 class=first title=first tooltip href="first.html" myAttr="firstAttr">Link to first.html</A> Now you can easily imagine for yourself what happens when this HTML is inserted into the document and why we do not see the second (and any subsequent words if any) of our title attribute in the tooltip. There are still two important things to note. The first one (and it actually the reason why I named the post “lazy wrapping” is that if value of the HTML attribute does contains spaces in the original HTML, then it WILL be wrapped with quotation marks. For example, if I wrote following on my page (note the trailing space for the title attribute value) <a href="{source}" title="{name}  " id="{id}" myAttr="{attr}" class="{cssClass}">Link to {source}</a> then I would have my placeholder quoted correctly and the result of the replacement would render as expected: The second important thing to note is that there are exceptions for the lazy attributes wrapping rule in IE. As you can see href attribute value did not contain spaces exactly as all the other attributes with placeholders, but it was still returned correctly quoted Custom attribute myAttr is also quoted correctly when returned back from document, though its placeholder value does not contain spaces either. Now, on account of the highly unlikely probability that you found this information useful and need a solution to the problem the aforementioned behavior introduces for Internet Explorer browser, I can suggest a simple workaround – manually quote the mischievous attributes prior the placeholder pattern is replaced. Using the code of contextFormat() method shown below, you would need to add following line right before the return statement: result = result.replace(/=({([^}]+)})/g, '="$1"'); Below please find original sample code:

    Read the article

  • Implementing a wrapping wire (like the Worms Ninja Rope) in a 2D physics engine

    - by Andrew Russell
    I've been trying out some rope-physics recently, and I've found that the "standard" solution - making a rope from a series of objects strung together with springs or joints - is unsatisfying. Especially when rope swinging is relevant to gameplay. I don't really care about a rope's ability to wrap up or sag (this can be faked for visuals anyway). For gameplay, what is important is the ability for the rope to wrap around the environment and then subsequently unwrap. It doesn't even have to behave like rope - a "wire" made up of straight line segments would do. Here's an illustration: This is very similar to the "Ninja Rope" from the game Worms. Because I'm using a 2D physics engine - my environment is made up of 2D convex polygons. (Specifically I am using SAT in Farseer.) So my question is this: How would you implement the "wrapping" effect? It seems pretty obvious that the wire will be made up of a series of line segments that "split" and "join". And the final (active) segment of that line, where the moving object attaches, will be a fixed-length joint. But what is the maths / algorithm involved for determining when and where the active line segment needs to be split? And when it needs to be joined with the previous segment? (Previously this question also asked about doing this for a dynamic environment - I've decided to split that off into other questions.)

    Read the article

  • Android threads trouble wrapping my head around design

    - by semajhan
    I am having trouble wrapping my head around game design. On the android platform, I have an activity and set its content view with a custom surface view. The custom surface view acts as my panel and I create instances of all classes and do all the drawing and calculation in there. Question: Should I instead create the instances of other classes in my activity? Now I create a custom thread class that handles the game loop. Question: How do I use this one class in all my activities? Or do I have to create a separate instance of the extended thread class each time? In my previous game, I had multiple levels that had to create an instance of the thread class and in the thread class I had to set constructor methods for each separate level and in the loop use a switch statement to check which level it needs to render and update. Sorry if that sounds confusing. I just want to know if the method I am using is inefficient (which it probably is) and how to go about designing it the correct way. I have read many tutorials out there and I am still having lots of trouble with this particular topic. Maybe a link to a some tutorials that explain this? Thanks.

    Read the article

  • Constructs for wrapping a hardware state machine

    - by Henry Gomersall
    I am using a piece of hardware with a well defined C API. The hardware is stateful, with the relevant API calls needing to be in the correct order for the hardware to work properly. The API calls themselves will always return, passing back a flag that advises whether the call was successful, or if not, why not. The hardware will not be left in some ill defined state. In effect, the API calls advise indirectly of the current state of the hardware if the state is not correct to perform a given operation. It seems to be a pretty common hardware API style. My question is this: Is there a well established design pattern for wrapping such a hardware state machine in a high level language, such that consistency is maintained? My development is in Python. I ideally wish the hardware state machine to be abstracted to a much simpler state machine and wrapped in an object that represents the hardware. I'm not sure what should happen if an attempt is made to create multiple objects representing the same piece of hardware. I apologies for the slight vagueness, I'm not very knowledgeable in this area and so am fishing for assistance of the description as well!

    Read the article

  • Android threads trouble wrapping my head around design

    - by semajhan
    I am having trouble wrapping my head around game design. On the android platform, I have an activity and set its content view with a custom surface view. The custom surface view acts as my panel and I create instances of all classes and do all the drawing and calculation in there. Question: Should I instead create the instances of other classes in my activity? Now I create a custom thread class that handles the game loop. Question: How do I use this one class in all my activities? Or do I have to create a separate thread each time? In my previous game, I had multiple levels that had to create an instance of the thread class and in the thread class I had to set constructor methods for each separate level and in the loop use a switch statement to check which level it needs to render and update. Sorry if that sounds confusing. I just want to know if the method I am using is inefficient (which it probably is) and how to go about designing it the correct way. I have read many tutorials out there and I am still having lots of trouble with this particular topic. Maybe a link to a some tutorials that explain this? Thanks.

    Read the article

  • Wrapping REST based Web Service

    - by PaulPerry
    I am designing a system that will be running online under Microsoft Windows Azure. One component is a REST based web service which will really be a wrapper (using proxy pattern) which calls the REST web services of a business partner, which has to do with BLOB storage (note: we are not using azure storage). The majority of the functionality will be taking a request, calling our partner web service, receiving the request and then passing that back to the client. There are a number of reasons for doing this, but one of the big ones is that we are going to support three clients: our desktop application (win and mac), mobile apps (iOS), and a web front end. Having a single API which we then send to our partner protects us if that partner ever changes. I want our service to support both JSON and XML for the data transfer format, JSON for web and probably XML for the desktop and mobile (we already have an XML parser in those products). Our partner also supports both of these formats. I was planning on using ASP.NET MVC 4 with the Web API. As I design this, the thing that concerns me is the static type checking of C#. What if the partner adds or removes elements from the data? We can probably defensively code for that, but I still feel some concern. Also, we have to do a fair amount of tedious coding, to setup our API and then to turn around and call our partner’s API. There probably is not much choice on it though. But, in the back of my mind I wonder if maybe a more dynamic language would be a better choice. I want to reach out and see if anybody has had to do this before, what technology solutions they have used to (I am not attached to this one, these days Azure can host other technologies), and if anybody who has done something like this can point out any issues that came up. Thanks! Researching the issue seems to only find solutions which focus on connecting a SOAP web service over a proxy server, and not what I am referring to here. Note: Cross posted (by suggestion) from http://stackoverflow.com/questions/11906802/wrapping-rest-based-web-service Thank you!

    Read the article

  • Wrapping ASP.NET Client Callbacks

    - by Ricardo Peres
    Client Callbacks are probably the less known (and I dare say, less loved) of all the AJAX options in ASP.NET, which also include the UpdatePanel, Page Methods and Web Services. The reason for that, I believe, is it’s relative complexity: Get a reference to a JavaScript function; Dynamically register function that calls the above reference; Have a JavaScript handler call the registered function. However, it has some the nice advantage of being self-contained, that is, doesn’t need additional files, such as web services, JavaScript libraries, etc, or static methods declared on a page, or any kind of attributes. So, here’s what I want to do: Have a DOM element which exposes a method that is executed server side, passing it a string and returning a string; Have a server-side event that handles the client-side call; Have two client-side user-supplied callback functions for handling the success and error results. I’m going to develop a custom control without user interface that does the registration of the client JavaScript method as well as a server-side event that can be hooked by some handler on a page. My markup will look like this: 1: <script type="text/javascript"> 1:  2:  3: function onCallbackSuccess(result, context) 4: { 5: } 6:  7: function onCallbackError(error, context) 8: { 9: } 10:  </script> 2: <my:CallbackControl runat="server" ID="callback" SendAllData="true" OnCallback="OnCallback"/> The control itself looks like this: 1: public class CallbackControl : Control, ICallbackEventHandler 2: { 3: #region Public constructor 4: public CallbackControl() 5: { 6: this.SendAllData = false; 7: this.Async = true; 8: } 9: #endregion 10:  11: #region Public properties and events 12: public event EventHandler<CallbackEventArgs> Callback; 13:  14: [DefaultValue(true)] 15: public Boolean Async 16: { 17: get; 18: set; 19: } 20:  21: [DefaultValue(false)] 22: public Boolean SendAllData 23: { 24: get; 25: set; 26: } 27:  28: #endregion 29:  30: #region Protected override methods 31:  32: protected override void Render(HtmlTextWriter writer) 33: { 34: writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); 35: writer.RenderBeginTag(HtmlTextWriterTag.Span); 36:  37: base.Render(writer); 38:  39: writer.RenderEndTag(); 40: } 41:  42: protected override void OnInit(EventArgs e) 43: { 44: String reference = this.Page.ClientScript.GetCallbackEventReference(this, "arg", "onCallbackSuccess", "context", "onCallbackError", this.Async); 45: String script = String.Concat("\ndocument.getElementById('", this.ClientID, "').callback = function(arg, context, onCallbackSuccess, onCallbackError){", ((this.SendAllData == true) ? "__theFormPostCollection.length = 0; __theFormPostData = ''; WebForm_InitCallback(); " : String.Empty), reference, ";};\n"); 46:  47: this.Page.ClientScript.RegisterStartupScript(this.GetType(), String.Concat("callback", this.ClientID), script, true); 48:  49: base.OnInit(e); 50: } 51:  52: #endregion 53:  54: #region Protected virtual methods 55: protected virtual void OnCallback(CallbackEventArgs args) 56: { 57: EventHandler<CallbackEventArgs> handler = this.Callback; 58:  59: if (handler != null) 60: { 61: handler(this, args); 62: } 63: } 64:  65: #endregion 66:  67: #region ICallbackEventHandler Members 68:  69: String ICallbackEventHandler.GetCallbackResult() 70: { 71: CallbackEventArgs args = new CallbackEventArgs(this.Context.Items["Data"] as String); 72:  73: this.OnCallback(args); 74:  75: return (args.Result); 76: } 77:  78: void ICallbackEventHandler.RaiseCallbackEvent(String eventArgument) 79: { 80: this.Context.Items["Data"] = eventArgument; 81: } 82:  83: #endregion 84: } And the event argument class: 1: [Serializable] 2: public class CallbackEventArgs : EventArgs 3: { 4: public CallbackEventArgs(String argument) 5: { 6: this.Argument = argument; 7: this.Result = String.Empty; 8: } 9:  10: public String Argument 11: { 12: get; 13: private set; 14: } 15:  16: public String Result 17: { 18: get; 19: set; 20: } 21: } You will notice two properties on the CallbackControl: Async: indicates if the call should be made asynchronously or synchronously (the default); SendAllData: indicates if the callback call will include the view and control state of all of the controls on the page, so that, on the server side, they will have their properties set when the Callback event is fired. The CallbackEventArgs class exposes two properties: Argument: the read-only argument passed to the client-side function; Result: the result to return to the client-side callback function, set from the Callback event handler. An example of an handler for the Callback event would be: 1: protected void OnCallback(Object sender, CallbackEventArgs e) 2: { 3: e.Result = String.Join(String.Empty, e.Argument.Reverse()); 4: } Finally, in order to fire the Callback event from the client, you only need this: 1: <input type="text" id="input"/> 2: <input type="button" value="Get Result" onclick="document.getElementById('callback').callback(callback(document.getElementById('input').value, 'context', onCallbackSuccess, onCallbackError))"/> The syntax of the callback function is: arg: some string argument; context: some context that will be passed to the callback functions (success or failure); callbackSuccessFunction: some function that will be called when the callback succeeds; callbackFailureFunction: some function that will be called if the callback fails for some reason. Give it a try and see if it helps!

    Read the article

  • 2D XNA C#: Texture2D Wrapping Issue

    - by Kieran
    Working in C#/XNA for a Windows game: I'm using Texture2D to draw sprites. All of my sprites are 16 x 32. The sprites move around the screen as you would expect, by changing the top X/Y position of them when they're being drawn by the spritebatch. Most of the time when I run the game, the sprites appear like this: and when moved, they move as I expect, as one element. Infrequently they appear like this: and when moved it's like there are two sprites with a gap in between them - it's hard to describe. It only seems to happen sometimes - is there something I'm missing? I'd really like to know why this is happening. [Edit:] Adding Draw code as requested: This is the main draw routine - it first draws the sprite to a RenderTarget then blows it up by a scale of 4: protected override void Draw(GameTime gameTime) { // Draw to render target GraphicsDevice.SetRenderTarget(renderTarget); GraphicsDevice.Clear(Color.CornflowerBlue); Texture2D imSprite = null; spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointWrap, null, null); ManSprite.Draw(spriteBatch); base.Draw(gameTime); spriteBatch.End(); // Draw render target to screen GraphicsDevice.SetRenderTarget(null); imageFrame = (Texture2D)renderTarget; GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.DarkSlateBlue, 1.0f, 0); spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointClamp, null, null); spriteBatch.Draw(imageFrame, new Vector2(0, 0), null, Color.White, 0, new Vector2(0, 0), IM_SCALE, SpriteEffects.None, 0); spriteBatch.End(); } This is the draw routine for the Sprite class: public virtual void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Texture, new Vector2(PositionX, PositionY), null, Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0.3f); }

    Read the article

  • Wrapping up an Exciting Mobile World Congress

    - by Jacob Lehrbaum
    Its been a busy week here in Barcelona, with noticeably more energy at the show than in 2010. This year, we decided to move the Java booth to the App Planet and really engage with the increasing number of developers that are attending the event. Our booth featured 10 demos and a series of nearly 25 workshops featuring a variety of topics ranging from information about Java Verified, to the use of web technologies with Java ME, to sessions hosted by Operators such as Orange and Telefonica (see image to the left).One of the more popular topics in our booth was the use of Java in the Smart Grid. In our booth we were showing off some of the work of the Hydra Consortium whose goal it is to leverage the emerging smart grid infrastructure to securely enable the delivery of personal health data (weight, blood pressure, etc) from the home to your doctor. If you'd like to learn more about this innovative project, you can watch a video that was filmed at the event featuring Charles Palmer of Onzo. If you'd like to learn more about Java in the Smart Grid, check out our on-demand webinar

    Read the article

  • What is the best wrapping strategy ?

    - by Riduidel
    Hi, I'm planning to integrate an external tool (ffmpeg in my particular case, but it could be anything, in fact, as lolng as its tasks are long running ones). This tool has a lot of command-line parameters. For now, I've done to simple things with it, already requiring me a good bunch of class writing, to embed all the information it can return to me. I now face the even more complex task of having to send it a bunch of parameters and to handle possible errors. So, what is a best way for that ? Create classes containing all possible options Relying upon a reverse equivalent of commons-cli / CliBuilder / OptionParser Directly write all options from user input Obiwan Kenobi powers (or anything I don't even know about) Please notice I do it in an uncommon language (for the sake of me, don't ask me what it is, as it looks like a desperate and sterile union between CoffeeScript and lua), as a consequence, there can be no framework doing what I want in the language I use.

    Read the article

  • Image captions and wrapping [migrated]

    - by Charles
    What's the best way to add a caption below an image? The image and its caption will be floated right, and the text on the caption needs to wrap -- a 200x200px image shouldn't have a caption of width 800px. I would strongly prefer a solution that allows me to update images (with different widths) without changing the CSS or markup. For reasons beyond my control the image itself will also be floated right, but this should not be too problematic.

    Read the article

  • Server Bash Line Wrapping Over Text & In Wrong Place

    - by Pez Cuckow
    This is quite a hard problem to explain, when connecting to one of my servers using the bash shell, under any user the line wrapping is broken and has all sorts of problems. Once of which I detail in screenshots below: Other problems I experience include nano getting very confused about which line and or letter I am on, as shown by typing the same message into nano: These problems only occur when connecting as I previously mentioned to one of my servers which runs CentOs. Do you know why this is occurring and what I can do to fix it? On other servers the message works fine! Thanks for your time, Output of requested commands: Server that doesn't work properly: Working server: Could it perhaps be the custom prompt on the non working server? In .bashrc PS1='\e[1;32m\u@\h\e[m:\e[1;34m\w\e[m$ ' Commenting this out appeared to resolve the problem. Google says line wrapping errors can occur if you don't conform to these rules use the \[ escape to begin a sequence of non-printing characters, and the \] escape to signal the end of such a sequence I am not sure where this would fit in on my prompt?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >