Daily Archives

Articles indexed Thursday January 6 2011

Page 22/36 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • How to re-mount a different partition as /home?

    - by Android Eve
    When I installed Ubuntu 10.04, I installed it on a single 16GB partition which includes /, /boot, /home etc. I have another partition on the system (ext3). It is easily accessible from the GNOME desktop Places menu: I just click that Filesystem HDD icon on the Places menu and it is automatically mount as '/media/1326f40a-45df-4ec'. How do I make that partition re-mount as /home instead? (permanently, that is)

    Read the article

  • How do I set up multi seat?

    - by JJ Mcfly
    Hi I was hoping to have a 2 seat setup. One will be for my TV just going to run Boxee. The other is for my main Desktop. I've been looking for a good guide to help me navigate this, I'd like to use ubuntu 10.10. I am assuming it's just a case of getting a box + 2 graphics adaptors and 2 usb mice and keyboards, one of which will be bluetooth for the TV. I can't seem to find much documentation on this idea. Can anyone point me in the right direction? Also I am assuming that this is all possible with a standard ubuntu install, but with some additional configuration. Thank you in advance for any advice you can offer me JJ Mcfly

    Read the article

  • WPF binding: Doing a temperature converter app

    - by Bob
    Hi there, I'm doing a little app that basically has 2 text boxes. You'll enter Fahrenheit into TextBoxA and Celsius into TextBoxB. As the text changes in TextBoxA I want the equivalent Celsius value to be displayed in TextBoxB and vice versa. I can come up with a solution pretty easy for this but i'm trying to be a little clever. Is there a way to do it all in Xaml except for a Convert class that does the maths? So basically I want the TextChanged event of one textBox to pass in it's value into a Converter class that is evaluated and sent to the other TextBox and visa versa. Anyone know how I can achieve this ... and if it's possible at all?

    Read the article

  • jQuery ajaxSubmit ignored by IE8

    - by George Burrell
    Hi there, I am combing the jQuery validation plug-in with the jQuery Form Plugin to submit the form via AJAX. This works perfectly in Firefox & Chrome, but (as usual) Internet Explorer is being a pain. For reasons that are alluding me, IE is ignoring the ajaxSubmit, as a result it submits the form in the normal fashion. I've followed the validation plug-in's documentation when constructing my code: JS: $(document).ready(function() { var validator = $("#form_notify").validate({ messages: { email: { required: 'Please insert your email address. Without your email address we will not be able to contact you!', email:'Please enter a valid email address. Without a valid email address we will not be able to contact you!' } }, errorLabelContainer: "#error", success: "valid", submitHandler: function(form) {$(form).ajaxSubmit();} }); $('#email').blur(function() { if (validator.numberOfInvalids() 0) { $("#label").addClass("label_error"); return false; } else {$("#label").removeClass("label_error");} }); $('#form_notify').submit(function() { if (validator.numberOfInvalids() == 0) { $(this).fadeOut('fast', function() {$('#thank-you').fadeIn();}); return true; } return false; }); }); Form HTML: <form id="form_notify" class="cmxform" name="form_notify" action="optin.pl" method="get"> <fieldset> <div class="input"> <label id="label" for="email">Email Address:</label> <input type="text" id="email" name="email" value="" title="email address" class="{required:true, email:true}"/> <div class="clearfix"></div> </div> <input type="hidden" name="key" value="sub-745-9.224;1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0;;subscribe-224.htm"> <input type="hidden" name="followup" value="19"> <input type="submit" name="submit" id="submit-button" value="Notify Me"> <div id="error"></div> </fieldset> </form> I can't understand what is causing IE to act differently, any assistance would be greatly appreciated. I can provide more information if needed. Thanks in advance!

    Read the article

  • Allowing Xform controls for optional XML elements

    - by Cam
    Hi, In designing an XForm interface to an XML database (using eXist and XSLTForms), I'd like to include an input control for an optional element. The XML data records already exist and while some contain the optional element, others don't. To update a record, I'm using the existing XML record as the model instance. The problem is that the form control is not displayed when the optional element is not present, which is logical, but presents a problem when a user wants to add data to the optional element. To be more explicit, here's an example data record, data.xml: <a> <b>content</b> </a> with RNC schema: start = element a { element b { text }, element notes { text }? } XForms model: <xf:model> <xf:instance xmlns="" src="data.xml"/> <xf:submission id="save" method="post" action="update.xq" /> </xf:model> And control: <xf:input ref="/a/notes"> <xf:label>Notes (optional): </xf:label> </xf:input> The problem is that the 'Notes' input control is simply not displayed. An obvious solution is to add a trigger button to allow the user to insert the element if needed, but it is preferable to just have the input control appear, and be empty. My question is: is there some subtle combination of lesser-know attributes/binds/multiple instances/xpath expressions that will cause the control to always be displayed? Thanks

    Read the article

  • Using LINQ to search a byte array for all subarrays that start/stop with certain byte

    - by Joel B
    I'm dealing with a COM port application and we have a defined variable-length packet structure that I'm talking to a micro-controller with. The packet has delimiters for the start and stop bytes. The trouble is that sometimes the read buffer can contain extraneous characters. It seems like I'll always get the whole packet, just some extra chatter before/after the actual data. So I have a buffer that I append data to whenever new data is received from the COM port. What is the best way to search this buffer for any possible occurrences of my packet? For example: Say my packet delimiter is 0xFF and I have an array as such { 0x00, 0xFF, 0x02, 0xDA, 0xFF, 0x55, 0xFF, 0x04 } How can I create a function/LINQ-statment that returns all subarrays that start and end with the delimiter (almost like a sliding-correlator with wildcards)? The sample would return the following 3 arrays: {0xFF, 0x02, 0xDA, 0xFF}, {0xFF, 0x55, 0xFF}, and {0xFF, 0x02, 0xDA, 0xFF, 0x55, 0xFF}

    Read the article

  • CURL & web.py: transfer closed with outstanding read data remaining

    - by Richard J
    Hi Folks, I have written a web.py POST handler, thus: import web urls = ('/my', 'Test') class Test: def POST(self): return "Here is your content" app = web.application(urls, globals()) if __name__ == "__main__": app.run() When I interact with it using Curl from the command line I get different responses depending on whether I post it any data or not: curl -i -X POST http://localhost:8080/my HTTP/1.1 200 OK Transfer-Encoding: chunked Date: Thu, 06 Jan 2011 16:42:41 GMT Server: CherryPy/3.1.2 WSGI Server Here is your content (Posting of no data to the server gives me back the "Here is your content" string) curl -i -X POST --data-binary "@example.zip" http://localhost:8080/my HTTP/1.1 100 Content-Length: 0 Content-Type: text/plain HTTP/1.1 200 OK Transfer-Encoding: chunked Date: Thu, 06 Jan 2011 16:43:47 GMT Server: CherryPy/3.1.2 WSGI Server curl: (18) transfer closed with outstanding read data remaining (Posting example.zip to the server results in this error) I've scoured the web.py documentation (what there is of it), and can't find any hints as to what might be going on here. Possibly something to do with 100 continue? I tried writing a python client which might help clarify: h1 = httplib.HTTPConnection('localhost:8080') h1.request("POST", "http://localhost:8080/my", body, headers) print h1.getresponse() body = the contents of the example.zip, and headers = empty dictionary. This request eventually timed out without printing anything, which I think exonerates curl from being the issue, so I believe something is going on in web.py which isn't quite right (or at least not sufficiently clear) Any web.py experts got some tips? Cheers, Richard

    Read the article

  • How do I get rid of the space between <img> elements in a row in a html page?

    - by Aperture
    I'm displaying 3 <img> in a row like this: <div style="width: 950px"> <img src='/UploadedImages/86.jpg' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" /> <img src='/UploadedImages/85.jpg' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" /> <img src='/UploadedImages/84.gif' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" /> </div> As you can see I have thin black borders around the images. My problem is that there are white spaces about 5px wide between the borders of neighbouring images and I have set the margin to be 0px but it does not work. So what is happening here?

    Read the article

  • Using Qtcreator (with Qwt), really basic stuff

    - by Dago
    I'm trying to make a Qt program using Qtcreator and Qwt for plotting. I've never used Qtcreator before. I've created a mainwindow and added a Qwtplot widget there (object name: qwtPlot). The widget shows up in the program when I compile and run it. But theres no mention of the qwtPlot object anywhere in the (autogenerated) code so I assume it is being added at compile time from the .ui xml file (or something). My question is that... how do I modify/change the qwtPlot object? Or where should I place the code. I'm having a hard time articulating my question but the question basically is "How do I do anything with the qwtPlot widget which is created (graphically) with Qtcreator?". I've checked some tutorials but in the tutorials they add the widgets manually in the code, but I'd like to use Qtcreator (because my UI will be fairly complicated). This whole Qtcreator is pretty confusing...

    Read the article

  • How to perform multiple find and replace in TextMate besides macro?

    - by T1000
    I have several regular expressions to find and replace text in documents in TextMate. I would like to be able to have them run in a batch. I made a macro and it worked, but any tiny modifications to the macro means re-recording the macro. And I can't seem to modify the regex within the TextMate interface. It's read-only for some reason. Can I make it into a command? Does anyone know how? I tried to read the TextMate help about commands, but it wasn't much help. It seems I need prior knowledge of shell scripts or some sort (which I have none). Any advise in the direction would be great. Thanx in advance.

    Read the article

  • Copy List of Structures to Excel Range

    - by KDP
    Does anyone know how to copy a VB.Net list of structures to an Excel range? It's not hard to do with an array, but I can't get a list of structures to work. Example: Structure MyStruct Dim MyField1 as String Dim MyField2 as Integer End Structure Dim MyList As New List(Of MyStruct) ...populate list of structures... Dim rng as Excel.Range = MySheet.Range("A1","B9") rng.??? = MyList '*** This is where I get stuck. ***

    Read the article

  • PHP cURL loading delay

    - by lasquarte
    Hello. My problem is, I need to cURL-load a page that uses Ajax-based search, to get results of that search. And I need to organize a delay between curl_exec() and value returning. In other words, I need to execute curl_exec() for no less than 5 seconds. sleep() seems to stop curl execution and does not work. Will greatly appreciate any hint or clue UPD I don't know how, but on this page http://vkontakte.ru/gsearch.php?section=video&q=sample&name=1, but it requires an account to access curl DOES capture the search made by ajax. But if page tooks too long to load, Ajax returns "action was too fast" error. So I just need to prolong curl execution. Sorry if being unclear.

    Read the article

  • Neural network input data, cartesian plane x/y coordinates, correlate with Handwriting.

    - by Sam
    I very curious about making a handwriting recognition application in a web browser. Users draw a letter, ajax sends the data to the server, neural network finds the closest match, and returns results. So if you draw an a, the first result should be an a, then o, then e, something like that. I'm don't know much about neural networks. What kinda data would I need to pass to the NN. Could it be an array of the x/y coordinates where the user has drawn on a pad. Or what type of data is the neural network expecting or would produce the best results for handwriting?

    Read the article

  • find a duplicate series in SQL

    - by SomeMiscGuy
    I have a table with 3 columns containing a variable number of records based off of the first column which is a foreign key. I am trying to determine if I can detect when there is a duplicate across multiple rows for an entire series declare @finddupseries table ( portid int, asset_id int, allocation float ) ; INSERT INTO @finddupseries SELECT 250, 6, 0.05 UNION ALL SELECT 250, 66, 0.8 UNION ALL SELECT 250, 2, 0.105 UNION ALL SELECT 250, 4, 0.0225 UNION ALL SELECT 250, 5, 0.0225 UNION ALL SELECT 251, 13, 0.6 UNION ALL SELECT 251, 2, 0.3 UNION ALL SELECT 251, 5, 0.1 UNION ALL SELECT 252, 13, 0.8 UNION ALL SELECT 252, 2, 0.15 UNION ALL SELECT 252, 5, 0.05 UNION ALL SELECT 253, 13, 0.4 UNION ALL SELECT 253, 2, 0.45 UNION ALL SELECT 253, 5, 0.15 UNION ALL SELECT 254, 6, 0.05 UNION ALL SELECT 254, 66, 0.8 UNION ALL SELECT 254, 2, 0.105 UNION ALL SELECT 254, 4, 0.0225 UNION ALL SELECT 254, 5, 0.0225 select * from @finddupseries The records for portid 250 and 254 match. Is there any way I can write a query to detect this? edit: yes, the entire series must match. Also, if there was a way to determine which one it DID match would be helpful as the actual table has around 10k records. thanks!

    Read the article

  • Creation of Objects: Constructors or Static Factory Methods

    - by Rachel
    I am going through Effective Java and some of my things which I consider as standard are not suggested by the book, for instance creation of object, I was under the impression that constructors are the best way of doing it and books says we should make use of static factory methods, I am not able to few some advantages and so disadvantages and so am asking this question, here are the benefits of using it. Advantages: One advantage of static factory methods is that, unlike constructors, they have names. A second advantage of static factory methods is that, unlike constructors, they are not required to create a new object each time they’re invoked. A third advantage of static factory methods is that, unlike constructors, they can return an object of any subtype of their return type. A fourth advantage of static factory methods is that they reduce the verbosity of creating parameterized type instances. I am not able to understand this advantage and would appreciate if someone can explain this point Disadvantages: The main disadvantage of providing only static factory methods is that classes without public or protected constructors cannot be subclassed. A second disadvantage of static factory methods is that they are not readily distinguishable from other static methods.I am not getting this point and so would really appreciate some explanation. Reference: Effective Java, Joshua Bloch, Edition 2, pg: 5-10 Also, How to decide to use whether to go for Constructor or Static Factory Method for Object Creation ?

    Read the article

  • Instance of method leaking, iPhone

    - by Wolfert
    The following method shows up as leaking while performing a memory-leaks test with Instruments: - (NSDictionary*) initSigTrkLstWithNiv:(int)pm_SigTrkNiv SigTrkSig:(int)pm_SigTrkSig SigResIdt:(int)pm_SigResIdt SigResVal:(int)pm_SigResVal { NSArray *objectArray; NSArray *keyArray; if (self = [super init]) { self.SigTrkNiv = [NSNumber numberWithInt:pm_SigTrkNiv]; self.SigTrkSig = [NSNumber numberWithInt:pm_SigTrkSig]; self.SigResIdt = [NSNumber numberWithInt:pm_SigResIdt]; self.SigResVal = [NSNumber numberWithInt:pm_SigResVal]; objectArray = [NSArray arrayWithObjects:SigTrkNiv,SigTrkSig,SigResIdt,SigResVal, nil]; keyArray = [NSArray arrayWithObjects:@"SigTrkNiv", @"SigTrkSig", @"SigResIdt", @"SigResVal", nil]; self = [NSDictionary dictionaryWithObjects:objectArray forKeys:keyArray]; } return self; } code that invokes the instance: NSDictionary *lv_SigTrkLst = [[SigTrkLst alloc]initSigTrkLstWithNiv:[[tempDict objectForKey:@"SigTrkNiv"] intValue] SigTrkSig:[[tempDict objectForKey:@"SigTrkSig"] intValue] SigResIdt:[[tempDict objectForKey:@"SigResIdt"] intValue] SigResVal:[[tempDict objectForKey:@"SigResVal"] intValue]]; [[QBDataContainer sharedDataContainer].SigTrkLstArray addObject:lv_SigTrkLst]; [lv_SigTrkLst release]; Instruments informs that 'SigTrkLst' is leaking. Even though I have released the instance? (I know that adding it to the array increments the retainCount by 1 but releasing it twice removes it from the array?)

    Read the article

  • Why is JSON outputting out of order?

    - by dcp3450
    I'm am trying to get a list of weather information for 8 locations. I'm using a weather API that accepts longitude and latitude and spits back json output with the weather info for that location. I feed the coords in order 0-7 but when json processes the data it comes back in a seemingly random order. I assume it's because some process faster than others and json is outputing what it gets back as it gets it. The output is correct, only the order is wrong. var loc = null; var body = ""; var campuses = new Array(8); campuses[0] = "34.47242,-84.42489,1"; campuses[1] = "33.81488,-84.62048,2"; campuses[2] = "34.27502,-84.46976,3"; campuses[3] = "33.92987,-84.55065,4"; campuses[4] = "34.03433,-84.46723,5"; campuses[5] = "34.08362,-84.67115,6"; campuses[6] = "33.91124,-84.82634,7"; campuses[7] = "34.10409,-84.51804,8"; function getWeather(campusArray) { body += '<p class="topTitle">Campus Weather</p>'; var cSplit = new Array(); cSplit = campusArray.split(','); var loc = "http://www.worldweatheronline.com/feed/weather.ashx?q="+cSplit[0]+","+cSplit[1]+"&format=json&num_of_days=2&key=0a05fff921162948110401&callback=?"; $('#content').html('asdf'); $.getJSON(loc,function(js) { var data = js.data; var humidity = data.current_condition[0].humidity; var tempF = data.current_condition[0].temp_F; var iconDESC = data.current_condition[0].weatherDesc[0].value; var iconURL = data.current_condition[0].weatherIconUrl[0].value; var windDir = data.current_condition[0].winddir16Point; var windSpeed = data.current_condition[0].windspeedMiles; var tempMaxF = data.weather[0].tempMaxF; var tempMinF = data.weather[0].tempMinF; body += '<p class="title">'+cSplit[2]+'</p>'+ '<span class="body">'+tempF+ ' '+windSpeed+ '<img src="'+iconURL+'" /></span>'; $('#content').html(body); }); } getWeather(campuses[0]); getWeather(campuses[1]); getWeather(campuses[2]); getWeather(campuses[3]); getWeather(campuses[4]); getWeather(campuses[5]); getWeather(campuses[6]); getWeather(campuses[7]); I have also tried it as $.ajax var loc = null; var body = ""; var campuses = new Array(8); campuses[0] = "34.47242,-84.42489,1"; campuses[1] = "33.81488,-84.62048,2"; campuses[2] = "34.27502,-84.46976,3"; campuses[3] = "33.92987,-84.55065,4"; campuses[4] = "34.03433,-84.46723,5"; campuses[5] = "34.08362,-84.67115,6"; campuses[6] = "33.91124,-84.82634,7"; campuses[7] = "34.10409,-84.51804,8"; function getWeather(campusArray) { body += '<p class="topTitle">Campus Weather</p>'; var cSplit = new Array(); cSplit = campusArray.split(','); var loc = "http://www.worldweatheronline.com/feed/weather.ashx?q="+cSplit[0]+","+cSplit[1]+"&format=json&num_of_days=2&key=0a05fff921162948110401&callback=?"; $.ajax({ url: loc, async: true, dataType: "json", success: function(js) { var data = js.data; var humidity = data.current_condition[0].humidity; var tempF = data.current_condition[0].temp_F; var iconDESC = data.current_condition[0].weatherDesc[0].value; var iconURL = data.current_condition[0].weatherIconUrl[0].value; var windDir = data.current_condition[0].winddir16Point; var windSpeed = data.current_condition[0].windspeedMiles; var tempMaxF = data.weather[0].tempMaxF; var tempMinF = data.weather[0].tempMinF; body += '<p class="title">'+cSplit[2]+'</p>'+ '<span class="body">'+tempF+ ' '+windSpeed+ '<img src="'+iconURL+'" /></span>'; $('#content').html(body); } }); } getWeather(campuses[0]); getWeather(campuses[1]); getWeather(campuses[2]); getWeather(campuses[3]); getWeather(campuses[4]); getWeather(campuses[5]); getWeather(campuses[6]); getWeather(campuses[7]); EDIT: example of json output: { "data": { "current_condition": [ {"cloudcover": "100", "humidity": "93", "observation_time": "04:04 PM", "precipMM": "0.0", "pressure": "1009", "temp_C": "2", "temp_F": "36", "visibility": "8", "weatherCode": "116", "weatherDesc": [ {"value": "Mist" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0006_mist.png" } ], "winddir16Point": "WNW", "winddirDegree": "290", "windspeedKmph": "7", "windspeedMiles": "4" } ], "request": [ {"query": "Lat 34.47 and Lon -84.42", "type": "LatLon" } ], "weather": [ {"date": "2011-01-06", "precipMM": "9.3", "tempMaxC": "7", "tempMaxF": "45", "tempMinC": "2", "tempMinF": "35", "weatherCode": "113", "weatherDesc": [ {"value": "Sunny" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ], "winddir16Point": "WNW", "winddirDegree": "293", "winddirection": "WNW", "windspeedKmph": "20", "windspeedMiles": "13" }, {"date": "2011-01-07", "precipMM": "0.0", "tempMaxC": "6", "tempMaxF": "44", "tempMinC": "0", "tempMinF": "31", "weatherCode": "116", "weatherDesc": [ {"value": "Partly Cloudy" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png" } ], "winddir16Point": "WNW", "winddirDegree": "286", "winddirection": "WNW", "windspeedKmph": "25", "windspeedMiles": "16" } ] }}

    Read the article

  • NDK do not find the standard C++ libraries

    - by Marcos Vasconcelos
    Hi, I'm trying to compile a native program for android. But when runnning the ndk-build command I got the following result. /home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:26:21: error: stdexcept: No such file or directory /home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:27:18: error: limits: No such file or directory stdexcept and limits are part of the std C++ lib. This is my Android.mk LOCAL_PATH := $(call my-dir) MY_PATH := $(LOCAL_PATH) include $(call all-subdir-makefiles) LOCAL_PATH := $(MY_PATH) include $(CLEAR_VARS) LOCAL_LDLIBS := -llog LOCAL_MODULE := rmsdk LOCAL_SRC_FILES := curlnetprovider.cpp RMServices.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all LOCAL_STATIC_LIBRARIES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlib include $(BUILD_SHARED_LIBRARY) I should explicit tell that it's a C++ source?

    Read the article

  • Turning off ASP.Net WebForms authentication for one sub-directory

    - by Keith
    I have a large enterprise application containing both WebForms and MVC pages. It has existing authentication and authorisation settings that I don't want to change. The WebForms authentication is configured in the web.config: <authentication mode="Forms"> <forms blah... blah... blah /> </authentication> <authorization> <deny users="?" /> </authorization> Fairly standard so far. I have a REST service that is part of this big application and I want to use HTTP authentication instead for this one service. So, when a user attempts to get JSON data from the REST service it returns an HTTP 401 status and a WWW-Authenticate header. If they respond with a correctly formed HTTP Authorization response it lets them in. The problem is that WebForms overrides this at a low level - if you return 401 (Unauthorised) it overrides that with a 302 (redirection to login page). That's fine in the browser but useless for a REST service. I want to turn off the authentication setting in the web.config: <location path="rest"> <system.web> <authentication mode="None" /> <authorization><allow users="?" /></authorization> </system.web> </location> The authorisation bit works fine, but when I try to change the authentication I get an exception: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. I'm configuring this at application level though - it's in the root web.config How do I override the authentication so that all of the rest of the site uses WebForms authentication and this one directory uses none? This is similar to another question: 401 response code for json requests with ASP.NET MVC, but I'm not looking for the same solution - I don't want to just remove the WebForms authentication and add new custom code globally, there's far to much risk and work involved. I want to change just the one directory in configuration.

    Read the article

  • How to get from JRuby a correctly typed ruby implementation of a Java interface?

    - by Guss
    I'm trying to use JRuby (through the JSR233 interface included in JRuby 1.5) from a Java application to load a ruby implementation of a Java interface. My sample implementation looks like this: Interface: package some.package; import java.util.List; public interface ScriptDemoIf { int fibonacci(int d); List<String> filterLength(List<String> source, int maxlen); } Ruby Implementation: require 'java' include Java class ScriptDemo java_implements some.package.ScriptDemoIf java_signature 'int fibonacci(int d)' def fibonacci(d) d < 2 ? d : fibonacci(d-1) + fibonacci(d-2) end java_signature 'List<String> filterLength(List<String> source, int maxlen)' def filterLength(source, maxlen) source.find_all { |str| str.length <= maxlen } end end Class loader: public ScriptDemoIf load(String filename) throws ScriptException { ScriptEngine engine = new ScriptEngineManager().getEngineByName("jruby"); FileReader script = new FileReader(filename); try { engine.eval(new FileReader(script)); } catch (FileNotFoundException e) { throw new ScriptException("Failed to load " + filename); } return (ScriptDemoIf) m_engine.eval("ScriptDemo.new"); } (Obviously the loader is a bit more generic in real life - it doesn't assume that the implementation class name is "ScriptDemo" - this is just for simplicity). Problem - I get a class cast exception in the last line of the loader - the engine.eval() return a RubyObject type which doesn't cast down nicely to my interface. From stuff I read all over the web I was under the impression that the whole point of use java_implements in the Ruby section was for the interface implementations to be compiled in properly. What am I doing wrong?

    Read the article

  • Releasing Autopool crashes on iOS 4.0 (and only on 4.0)

    - by samsam
    Hi there. I'm wondering what could cause this. I have several methods in my code that i call using performSelectorInBackground. Within each of these methods i have an Autoreleasepool that is being alloced/initialized at the beginning and released at the end of the method. this perfectly works on iOS 3.1.3 / 3.2 / 4.2 / 4.2.1 but it fataly crashes on iOS 4.0 with a EXC_BAD_ACCESS Exception that happens after calling [myPool release]. After I noticed this strange behaviour I was thinking about rewriting portions of my code and to make my app "less parallel" in case that the client os is 4.0. After I did that, the next point where the app crashed was within the ReachabilityCallback-Method from Apples Reachability "Framework". well, now I'm not quite sure what to do. The things i do within my threaded methods is pretty simple xml parsing (no cocoa calls or stuff that would affect the UI). After each method finishes it posts a notification which the coordinating-thread listens to and once all the parallelized methods have finished, the coordinating thread calls viewcontrollers etc... I have absolutely no clue what could cause this weird behaviour. Especially because Apples Code fails as well. any help is greatly appreciated! thanks, sam

    Read the article

  • Speaking in Sweden in April

    - by Fabrice Marguerie
    As this is my first post in 2011, I wish you all the best for this new year. I don't know for you, but it will be a year of changes for me. I'll tell you more about that when the time comes. For the time being, I just wanted to announce my next speaking engagement: I'll be presenting at SDC2011, the Scandinavian Developer Conference. This event will take place on April 4 and 5 in Göteborg, Sweden. My session will be based on my article about memory leaks: How to detect and avoid memory and resources leaks in .NET applicationsDuring this session we will analyze the most common leak sources in .NET applications and we will see how to detect them in practice. We will demonstrate with live examples several tools that can help you to troubleshoot your applications. The goal of this session is to help you fix and avoid leaks in your .NET applications, whether they are built with Windows Forms, WPF, Silverlight, ASP.NET, or as console or Windows services. You will also get advices on how to improve your applications so they become less greedy. I hope to see you there if you're around in April :-)

    Read the article

  • Four disks - RAID 10 or two mirrored pairs?

    - by ewwhite
    I have this discussion with developers quite often. The context is an application running in Linux that has a medium amount of disk I/O. The servers are HP ProLiant DL3x0 G6 with four disks of equal size @ 15k rpm, backed with a P410 controller and 512MB of battery or flash-based cache. There are two schools of thought here, and I wanted some feedback... 1). I'm of the mind that it makes sense to create an array containing all four disks set up in a RAID 10 (1+0) and partition as necessary. This gives the greatest headroom for growth, has the benefit of leveraging the higher spindle count and better fault-tolerance without degradation. 2). The developers think that it's better to have multiple RAID 1 pairs. One for the OS and one for the application data, citing that the spindle separation would reduce resource contention. However, this limits throughput by halving the number of drives and in this case, the OS doesn't really do much other than regular system logging. Additionally, the fact that we have the battery RAID cache and substantial RAM seems to negate the impact of disk latency... What are your thoughts?

    Read the article

  • sub application and virtual directory file permissions

    - by Zeus
    I have a website setup in IIS7, exampledomain.com. Under the application exampledomain.com lives a sub application cms. In a rather convoluted way, we have content in our cms system in this sub-app, under cms\content\{generatedfoldername}. So to access an image in this content, the full URL would be http://www.exampledomain.com/cms/cms/content/{generatedfoldername}/image.jpg, (yes, cms twice...) and this works just fine. Now, we have a virtual directory under the parent website, called stuff which points at the content of the cms. So I should be able to get to the image using the url http://www.exampledomain.com/stuff/{generatedfoldername}/image.jpg. Unfortunately this gives a server 500 error "There is a problem with the resource you are looking for, and it cannot be displayed." Whilst you do have to log into the cms system to access any of the admin pages within, I don't think the image files are protected by login, or else the first example URL wouldn't work, right? Also it's a server 500 error, rather than a 403. I'm sure I must be missing something obvious here- will the virtual directory be using the permissions defined in the parent application, or the subapplication to which it is pointing? Or is there some other permissions I may have missed? Sorry, that was a bit long, thanks for reading all the way down here! (I also must point out that I'm pretty new to the server management stuff.) edit: also, we have <location path="." inheritInChildApplications="false"> specified in the webconfig of the parent app, so it's hopefully not the issue described in this config file hierarchy article.

    Read the article

  • MySql service stops under 2008 r2 x64

    - by volody
    I have installed MySql 5.5 server under windows 2008r2 x64 Apparently I can see that MySql service stops even if is configured to start automatically What can I do to find out why this is happening? MySql database is used as backend of ASP.Net web site Is it possible that web site was not active for a while and system stop mysql service? Update: It was mysql-5.5.7-rc-winx64. I could be an issue with this version (release candidate). Now I am trying to install mysql-5.5.8-winx64 And I have an issue with configuring MySql to work using name pipes I did uncheck use of TCP/IP protocol and configuration wizard just hangs Update: I have found workaround. It is required to configure MySql to use TCP/IP first, then reconfigure to use named pipes It looks like this link also has some information about the possible problems How should I diagnose ERROR 1045 during MySQL installation?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >