Daily Archives

Articles indexed Saturday April 3 2010

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

  • Give WPF design mode default objects

    - by Janko R
    In my application I have <Rectangle.Margin> <MultiBinding Converter="{StaticResource XYPosToThicknessConverter}"> <Binding Path="XPos"/> <Binding Path="YPos"/> </MultiBinding> </Rectangle.Margin> The Data Context is set during runtime. The application works, but the design window in VS does not show a preview but System.InvalidCastException. That’s why I added a default object in the XYPosToThicknessConverter which is ugly. class XYPosToThicknessConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // stupid check to give the design window its default object. if (!(values[0] is IConvertible)) return new System.Windows.Thickness(3, 3, 0, 0); // useful code and exception throwing starts here // ... } } My Questions: What does VS/the process that builds the design window pass to XYPosToThicknessConverter and what is way to find it out by myself. How do I change my XAML code, so that the design window gets its default object and is this the best way to handle this problem? I’m using VS2010RC with Net4.0

    Read the article

  • fmod VS2008 unresolved externals in dependant project

    - by Tom J Nowell
    Im currently trying to use the latest stable fmod ex in my project. I have a main executable in a project called engine4, and a project named DX9Platform in the solution as well which ti depends on. All the fmod code is in this DX9Platform project, which generates a lib file. DX9Platform includes fmodex_vc.lib and builds fine. However buildign Engien4 results in unresolved external symbol messages referencing files that use fmod in the DX9Platform project I have tried adding fmodex_vc.lib to the Engine4 project, with no success, how do I fix this? Heres the linker output: 3>------ Build started: Project: Engine4, Configuration: Release Direct3D9 Win32 ------ 3>Linking... 3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol _FMOD_System_Create 3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::createSound(char const *,unsigned int,struct FMOD_CREATESOUNDEXINFO *,class FMOD::Sound * *)" (?createSound@System@FMOD@@QAE?AW4FMOD_RESULT@@PBDIPAUFMOD_CREATESOUNDEXINFO@@PAPAVSound@2@@Z) 3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::getVersion(unsigned int *)" (?getVersion@System@FMOD@@QAE?AW4FMOD_RESULT@@PAI@Z) 3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::init(int,unsigned int,void *)" (?init@System@FMOD@@QAE?AW4FMOD_RESULT@@HIPAX@Z) 3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::playSound(enum FMOD_CHANNELINDEX,class FMOD::Sound *,bool,class FMOD::Channel * *)" (?playSound@System@FMOD@@QAE?AW4FMOD_RESULT@@W4FMOD_CHANNELINDEX@@PAVSound@2@_NPAPAVChannel@2@@Z) 3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::getPaused(bool *)" (?getPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@PA_N@Z) 3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::setPaused(bool)" (?setPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@_N@Z) 3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: virtual class IAudioObject * __thiscall CFModAudioObject::LoadFile(char const *)" (?LoadFile@CFModAudioObject@@UAEPAVIAudioObject@@PBD@Z) 3>D:\media\desktop\engine4\Engine4\Output\Release Direct3D9\Engine4.exe : fatal error LNK1120: 8 unresolved externals 3>Build log was saved at "file://d:\media\desktop\engine4\Engine4\Engine4\intermediate\Release Direct3D9\BuildLog.htm" 3>Engine4 - 9 error(s), 0 warning(s) ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

    Read the article

  • InnerHTML IE 8 doesn't work properly? Resetting form.

    - by Craig Whitley
    Yeah this works in FF and Chrome, but for some reason wont work in IE 8. I'm using a radio button to clear a section of a form.. that section is a select box, but I don't want to leave the area empty - instead I want to reset it to what it was when the page loaded. At the moment IE8 is just leaving me with an empty small select box. Html: <select id="city_select" disabled="true" name="location_id" onchange="show_search_button();"><option selected>Select your city</option> </select> Javascript: document.getElementById('city_select').innerHTML = "<option selected>Select your city</option>"; I've also tried using location_id instead of city_select in the javascript but to no avail.. innerText and innerContent dont work either.. though the inner.HTML works in IE8 for an earlier function, but that isnt trying to innerHTML into a form. Does anybody know why this works in Chrome and FF but not IE8? and is there a solution to this? Any help appreciated thanks!

    Read the article

  • Windows Forms Event Log

    - by blu
    I am writing to the event log from my Windows Forms application running on Windows 7 and am getting this message in the event log: The description for Event ID X from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: Exception Details the message resource is present but the message is not found in the string/message table My logging code is: public void Log(Exception exc) { EventLog.WriteEntry( "Application", exc.ToString(), EventLogEntryType.Error, 100); } My logging on Windows Forms is usually to a DB, but in this case decided to use the event log. I usually use the event log in ASP.NET applications, but those are on XP Pro locally and Windows Server 2003 on the web boxes. Is this a Windows 7 thing or a Windows Forms thing, and what should I do to fix this? Thanks.

    Read the article

  • Problems with rails and saving to the database.

    - by Grantismo
    I've been having some difficulty in understanding the source of a problem. Below is a listing of the model classes. Essentially the goal is to have the ability to add sentences to the end of the story, or to add stories to an existing sentence_block. Right now, I'm only attempting to allow users to add sentences, and automatically create a new sentence_block for the new sentence. class Story < ActiveRecord::Base has_many :sentence_blocks, :dependent => :destroy has_many :sentences, :through => :sentence_blocks accepts_nested_attributes_for :sentence_blocks end class SentenceBlock < ActiveRecord::Base belongs_to :story has_many :sentences, :dependent => :destroy end class Sentence < ActiveRecord::Base belongs_to :sentence_block def story @sentence_block = SentenceBlock.find(self.sentence_block_id) Story.find(@sentence_block.story_id) end end The problem is occurring when using the show method of the Story. The Story method is as follows, and the associated show method for a sentence is also included. Sentence.show def show @sentence = Sentence.find(params[:id]) respond_to do |format| format.html {redirect_to(@sentence.story)} format.xml { render :xml => @sentence } end end Story.show def show @story = Story.find(params[:id]) @sentence_block = @story.sentence_blocks.build @new_sentence = @sentence_block.sentences.build(params[:sentence]) respond_to do |format| if @new_sentence.content != nil and @new_sentence.sentence_block_id != nil and @sentence_block.save and @new_sentence.save flash[:notice] = 'Sentence was successfully added.' format.html # new.html.erb format.xml { render :xml => @story } else @sentence_block.destroy format.html format.xml { render :xml => @story } end end end I'm getting a "couldn't find Sentence_block without and id" error. So I'm assuming that for some reason the sentence_block isn't getting saved to the database. Can anyone help me with my understanding of the behavior and why I'm getting the error? I'm trying to ensure that every time the view depicts show for a story, an unnecessary sentence_block and sentence isn't created, unless someone submits the form, I'm not really sure how to accomplish this. Any help would be appreciated.

    Read the article

  • SFML SetFramerateLimit Not Limiting Frame Rate

    - by Person
    Compiler: Visual C++ OS: Windows 7 Enterprise For some reason, Window::SetFramerateLimit isn't limiting the frame rate in the app I'm working on, but it works fine for others. The framerate is capped to 60, but mine jumps around at 100-99 and then goes down to 50 sometimes. It actually causes serious issues. For example, if I create many objects on screen, I'll see a heavy performance hit, whereas others report no change. Any ideas regarding why this is happening? If you need more information, I'd be happy to oblige. Thanks. P.S. I have strong reasons to believe that it is not simply a case of "their hardware is just more powerful than yours."

    Read the article

  • Help -- trying to build Apache ODE source code with Buildr

    - by Moon13
    Hi, i am trying to build APACHE ODE source code with Buildr using Ruby. I installed ruby and installed Buildr with it, but when i run the command rake package on the root of APACHE ODE source code it gives me this error C:\workspace2\APACHE_ODE_1.Xrake package --trace (in C:/workspace2/APACHE_ODE_1.X) rake aborted! uninitialized constant Gem::Requirement::OP_RE The gems i have installed C:\workspace2\APACHE_ODE_1.Xgem list * LOCAL GEMS * Antwrap (0.7.0) archive-tar-minitar (0.5.2) builder (2.1.2) buildr (1.3.5) highline (1.5.1) hoe (2.3.3) net-sftp (2.0.2) net-ssh (2.0.15) rake (0.8.7) rjb (1.1.6) rspec (1.2.8) rubyforge (1.0.5) rubygems-update (1.3.6) rubyzip (0.9.1) xml-simple (1.0.12)

    Read the article

  • Conflict between two Javascripts (MailChimp validation etc. scripts & jQuery hSlides.js)

    - by Brian
    I have two scripts running on the same page, one is the jQuery.hSlides.js script http://www.jesuscarrera.info/demos/hslides/ and the other is a custom script that is used for MailChimp list signup integration. The hSlides panel can be seen in effect here: http://theatricalbellydance.com. I've turned off the MailChimp script because it was conflicting with the hSlides script, causing it not to to fail completely (as seen here http://theatricalbellydance.com/home2/). Can someone tell me what could be done to the hSlides script to stop the conflict with the MailChimp script? The MailChimp Script var fnames = new Array(); var ftypes = new Array(); fnames[0] = 'EMAIL'; ftypes[0] = 'email'; fnames[3] = 'MMERGE3'; ftypes[3] = 'text'; fnames[1] = 'FNAME'; ftypes[1] = 'text'; fnames[2] = 'LNAME'; ftypes[2] = 'text'; fnames[4] = 'MMERGE4'; ftypes[4] = 'address'; fnames[6] = 'MMERGE6'; ftypes[6] = 'number'; fnames[9] = 'MMERGE9'; ftypes[9] = 'text'; fnames[5] = 'MMERGE5'; ftypes[5] = 'text'; fnames[7] = 'MMERGE7'; ftypes[7] = 'text'; fnames[8] = 'MMERGE8'; ftypes[8] = 'text'; fnames[10] = 'MMERGE10'; ftypes[10] = 'text'; fnames[11] = 'MMERGE11'; ftypes[11] = 'text'; fnames[12] = 'MMERGE12'; ftypes[12] = 'text'; var err_style = ''; try { err_style = mc_custom_error_style; } catch (e) { err_style = 'margin: 1em 0 0 0; padding: 1em 0.5em 0.5em 0.5em; background: rgb(255, 238, 238) none repeat scroll 0% 0%; font-weight: bold; float: left; z-index: 1; width: 80%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(255, 0, 0);'; } var mce_jQuery = jQuery.noConflict(); mce_jQuery(document).ready(function ($) { var options = { errorClass: 'mce_inline_error', errorElement: 'div', errorStyle: err_style, onkeyup: function () {}, onfocusout: function () {}, onblur: function () {} }; var mce_validator = mce_jQuery("#mc-embedded-subscribe-form").validate(options); options = { url: 'http://theatricalbellydance.us1.list-manage.com/subscribe/post-json?u=1d127e7630ced825cb1a8b5a9&id=9f12d2a6bb&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8", beforeSubmit: function () { mce_jQuery('#mce_tmp_error_msg').remove(); mce_jQuery('.datefield', '#mc_embed_signup').each(function () { var txt = 'filled'; var fields = new Array(); var i = 0; mce_jQuery(':text', this).each(function () { fields[i] = this; i++; }); mce_jQuery(':hidden', this).each(function () { if (fields[0].value == 'MM' && fields[1].value == 'DD' && fields[2].value == 'YYYY') { this.value = ''; } else if (fields[0].value == '' && fields[1].value == '' && fields[2].value == '') { this.value = ''; } else { this.value = fields[0].value + '/' + fields[1].value + '/' + fields[2].value; } }); }); return mce_validator.form(); }, success: mce_success_cb }; mce_jQuery('#mc-embedded-subscribe-form').ajaxForm(options); }); function mce_success_cb(resp) { mce_jQuery('#mce-success-response').hide(); mce_jQuery('#mce-error-response').hide(); if (resp.result == "success") { mce_jQuery('#mce-' + resp.result + '-response').show(); mce_jQuery('#mce-' + resp.result + '-response').html(resp.msg); mce_jQuery('#mc-embedded-subscribe-form').each(function () { this.reset(); }); } else { var index = -1; var msg; try { var parts = resp.msg.split(' - ', 2); if (parts[1] == undefined) { msg = resp.msg; } else { i = parseInt(parts[0]); if (i.toString() == parts[0]) { index = parts[0]; msg = parts[1]; } else { index = -1; msg = resp.msg; } } } catch (e) { index = -1; msg = resp.msg; } try { if (index == -1) { mce_jQuery('#mce-' + resp.result + '-response').show(); mce_jQuery('#mce-' + resp.result + '-response').html(msg); } else { err_id = 'mce_tmp_error_msg'; html = '<div id="' + err_id + '" style="' + err_style + '"> ' + msg + '</div>'; var input_id = '#mc_embed_signup'; var f = mce_jQuery(input_id); if (ftypes[index] == 'address') { input_id = '#mce-' + fnames[index] + '-addr1'; f = mce_jQuery(input_id).parent().parent().get(0); } else if (ftypes[index] == 'date') { input_id = '#mce-' + fnames[index] + '-month'; f = mce_jQuery(input_id).parent().parent().get(0); } else { input_id = '#mce-' + fnames[index]; f = mce_jQuery().parent(input_id).get(0); } if (f) { mce_jQuery(f).append(html); mce_jQuery(input_id).focus(); } else { mce_jQuery('#mce-' + resp.result + '-response').show(); mce_jQuery('#mce-' + resp.result + '-response').html(msg); } } } catch (e) { mce_jQuery('#mce-' + resp.result + '-response').show(); mce_jQuery('#mce-' + resp.result + '-response').html(msg); } } } The hslides script: /* * hSlides (1.0) // 2008.02.25 // <http://plugins.jquery.com/project/hslides> * * REQUIRES jQuery 1.2.3+ <http://jquery.com/> * * Copyright (c) 2008 TrafficBroker <http://www.trafficbroker.co.uk> * Licensed under GPL and MIT licenses * * hSlides is an horizontal accordion navigation, sliding the panels around to reveal one of interest. * * Sample Configuration: * // this is the minimum configuration needed * $('#accordion').hSlides({ * totalWidth: 730, * totalHeight: 140, * minPanelWidth: 87, * maxPanelWidth: 425 * }); * * Config Options: * // Required configuration * totalWidth: Total width of the accordion // default: 0 * totalHeight: Total height of the accordion // default: 0 * minPanelWidth: Minimum width of the panel (closed) // default: 0 * maxPanelWidth: Maximum width of the panel (opened) // default: 0 * // Optional configuration * midPanelWidth: Middle width of the panel (centered) // default: 0 * speed: Speed for the animation // default: 500 * easing: Easing effect for the animation. Other than 'swing' or 'linear' must be provided by plugin // default: 'swing' * sensitivity: Sensitivity threshold (must be 1 or higher) // default: 3 * interval: Milliseconds for onMouseOver polling interval // default: 100 * timeout: Milliseconds delay before onMouseOut // default: 300 * eventHandler: Event to open panels: click or hover. For the hover option requires hoverIntent plugin <http://cherne.net/brian/resources/jquery.hoverIntent.html> // default: 'click' * panelSelector: HTML element storing the panels // default: 'li' * activeClass: CSS class for the active panel // default: none * panelPositioning: Accordion panelPositioning: top -> first panel on the bottom and next on the top, other value -> first panel on the top and next to the bottom // default: 'top' * // Callback funtctions. Inside them, we can refer the panel with $(this). * onEnter: Funtion raised when the panel is activated. // default: none * onLeave: Funtion raised when the panel is deactivated. // default: none * * We can override the defaults with: * $.fn.hSlides.defaults.easing = 'easeOutCubic'; * * @param settings An object with configuration options * @author Jesus Carrera <[email protected]> */ (function($) { $.fn.hSlides = function(settings) { // override default configuration settings = $.extend({}, $.fn.hSlides.defaults, settings); // for each accordion return this.each(function(){ var wrapper = this; var panelLeft = 0; var panels = $(settings.panelSelector, wrapper); var panelPositioning = 1; if (settings.panelPositioning != 'top'){ panelLeft = ($(settings.panelSelector, wrapper).length - 1) * settings.minPanelWidth; panels = $(settings.panelSelector, wrapper).reverse(); panelPositioning = -1; } // necessary styles for the wrapper $(this).css('position', 'relative').css('overflow', 'hidden').css('width', settings.totalWidth).css('height', settings.totalHeight); // set the initial position of the panels var zIndex = 0; panels.each(function(){ // necessary styles for the panels $(this).css('position', 'absolute').css('left', panelLeft).css('zIndex', zIndex).css('height', settings.totalHeight).css('width', settings.maxPanelWidth); zIndex ++; // if this panel is the activated by default, set it as active and move the next (to show this one) if ($(this).hasClass(settings.activeClass)){ $.data($(this)[0], 'active', true); if (settings.panelPositioning != 'top'){ panelLeft = ($(settings.panelSelector, wrapper).index(this) + 1) * settings.minPanelWidth - settings.maxPanelWidth; }else{ panelLeft = panelLeft + settings.maxPanelWidth; } }else{ // check if we are centering and some panel is active // this is why we can't add/remove the active class in the callbacks: positioning the panels if we have one active if (settings.midPanelWidth && $(settings.panelSelector, wrapper).hasClass(settings.activeClass) == false){ panelLeft = panelLeft + settings.midPanelWidth * panelPositioning; }else{ panelLeft = panelLeft + settings.minPanelWidth * panelPositioning; } } }); // iterates through the panels setting the active and changing the position var movePanels = function(){ // index of the new active panel var activeIndex = $(settings.panelSelector, wrapper).index(this); // iterate all panels panels.each(function(){ // deactivate if is the active if ( $.data($(this)[0], 'active') == true ){ $.data($(this)[0], 'active', false); $(this).removeClass(settings.activeClass).each(settings.onLeave); } // set position of current panel var currentIndex = $(settings.panelSelector, wrapper).index(this); panelLeft = settings.minPanelWidth * currentIndex; // if the panel is next to the active, we need to add the opened width if ( (currentIndex * panelPositioning) > (activeIndex * panelPositioning)){ panelLeft = panelLeft + (settings.maxPanelWidth - settings.minPanelWidth) * panelPositioning; } // animate $(this).animate({left: panelLeft}, settings.speed, settings.easing); }); // activate the new active panel $.data($(this)[0], 'active', true); $(this).addClass(settings.activeClass).each(settings.onEnter); }; // center the panels if configured var centerPanels = function(){ var panelLeft = 0; if (settings.panelPositioning != 'top'){ panelLeft = ($(settings.panelSelector, wrapper).length - 1) * settings.minPanelWidth; } panels.each(function(){ $(this).removeClass(settings.activeClass).animate({left: panelLeft}, settings.speed, settings.easing); if ($.data($(this)[0], 'active') == true){ $.data($(this)[0], 'active', false); $(this).each(settings.onLeave); } panelLeft = panelLeft + settings.midPanelWidth * panelPositioning ; }); }; // event handling if(settings.eventHandler == 'click'){ $(settings.panelSelector, wrapper).click(movePanels); }else{ var configHoverPanel = { sensitivity: settings.sensitivity, interval: settings.interval, over: movePanels, timeout: settings.timeout, out: function() {} } var configHoverWrapper = { sensitivity: settings.sensitivity, interval: settings.interval, over: function() {}, timeout: settings.timeout, out: centerPanels } $(settings.panelSelector, wrapper).hoverIntent(configHoverPanel); if (settings.midPanelWidth != 0){ $(wrapper).hoverIntent(configHoverWrapper); } } }); }; // invert the order of the jQuery elements $.fn.reverse = function(){ return this.pushStack(this.get().reverse(), arguments); }; // default settings $.fn.hSlides.defaults = { totalWidth: 0, totalHeight: 0, minPanelWidth: 0, maxPanelWidth: 0, midPanelWidth: 0, speed: 500, easing: 'swing', sensitivity: 3, interval: 100, timeout: 300, eventHandler: 'click', panelSelector: 'li', activeClass: false, panelPositioning: 'top', onEnter: function() {}, onLeave: function() {} }; })(jQuery);

    Read the article

  • Problem with libcurl cookie engine

    - by Seb Rose
    [Cross-posted from lib-curl mailing list] I have a single threaded app (MSVC C++ 2005) build against a static LIBCURL 7.19.4 A test application connects to an in house server & performs a bespoke authentication process that includes posting a couple of forms, and when this succeeds creates a new resource (POST) and then updates the resource (PUT) using If-Match. I only use a single connection to libcurl (i.e. only one CURL*) The cookie engine is enabled from the start using curl_easy_setopt(CURLOPT_COOKIEFILE, "") The cookie cache is cleared at the end of the authentication process using curl_easy_setopt(CURLOPT_COOKIELIST, "SESS"). This is required by the authentication process. The next call, which completes a successful authentication, results in a couple of security cookies being returned from the server - they have no expiry date set. The server (and I) expect the security cookies to then be sent with all subsequent requests to the server. The problem is that sometimes they are sent and sometimes they aren't. I'm not a CURL expert, so I'm probably doing something wrong, but I can't figure out what. Running the test app in a loop results shows a random distribution of correct cookie handling. As a workaround I've disabled the cookie engine and am doing basic manual cookie handling. Like this it works as expected, but I'd prefer to use the library if possible. Does anyone have any ideas? Thanks Seb

    Read the article

  • Interchanging presentModalViewController and pushViewController

    - by Neffster
    I am using a sample ViewController that is displayed in the sample program as a presentModalViewController. However, I want to use pushViewController on the UIViewController instead. The problem is that when I switch to pushViewController, the ViewController no displays properly. Functions in the ViewController are called, but I don't see anything. I change back to presentModalViewController and everything works. The question is what do I need to do to make pushViewController work? FCVC *fcVC; NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"fcVC" owner:self options:nil]; fcVC = [array objectAtIndex:0]; A. [self presentModalViewController:fcVC animated:YES]; // "WORKS" or B. [self.navigationController pushViewController:fcVC animated:YES]; // "Doesn't work

    Read the article

  • Debugging error "The Type 'xx' is defined in an assembly that is not referenced"

    - by Abel
    The full error is as follows: The type 'System.Windows.Forms.Control' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. and it points at the very first statement (an Debug.Assert line) in the very first class in a library project that doesn't need System.Windows.Forms (or so I thought). I know how to solve it: add the mentioned reference. But how do I find out what library is causing this error, or better, what part of the code triggers using the WinForms library? Normally, you can add libraries that reference others, but you only need to add references to these others when they're actually used. EDIT: Alternative solution This or similar problems can also be resolved using the Binding Log Viewer Fuslogvw.exe from Microsoft's Framework Tools. It shows all attempts and successes of assemblies your application binds to.

    Read the article

  • I need a RegEx to validate not "NONE"

    - by Justin808
    I have a text field and am looking to have if be valid for all values other than "NONE" without the quotes. I know a comparison would be easy but the system I am using only validates via RegEx expressions. What would the RegEx expression be for it?

    Read the article

  • MySQLNonTransientConnectionException in jdbc program at run time

    - by Sunil Kumar Sahoo
    Hi I have created jdbc mysql connection. my program works fine for simple execution of query. But if i run the same program for more than 10 hour and execute query then i receives the following mysql exception. I have not used close() method anywhere. i created database connection and opened it forever and always execute query. there is no where that i explicitly mentioned timeout for connection. i am unable to identify the problem com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sample code for database connection: String driver = PropertyReader.getDriver(); String url = dbURLPath; Class.forName(driver); connectToServerDB = DriverManager.getConnection(url); connectToServerDB.setAutoCommit(false);

    Read the article

  • Can't install do_mysql gem?

    - by maccy1
    I'm trying to install the do_mysql on my Snow Leopord system Macbook Pro 13", but I keep getting this error: n216-160:~ myself$ sudo gem1.9 install do_mysql Password: Building native extensions. This could take a while... ERROR: Error installing do_mysql: ERROR: Failed to build gem native extension. /opt/local/bin/ruby1.9 extconf.rb checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/opt/local/bin/ruby1.9 --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib Gem files will remain installed in /opt/local/lib/ruby1.9/gems/1.9.1/gems/do_mysql-0.10.0 for inspection. Results logged to /opt/local/lib/ruby1.9/gems/1.9.1/gems/do_mysql-0.10.0/ext/do_mysql_ext/gem_make.out n216-160:~ myself$ I have no idea why. I also reinstalled my verison of MySQL with the MySQL 5.4.3 beta, 64-bit as others suggested but no dice. Does anyone have any idea what is wrong?

    Read the article

  • Git pre-receive hook

    - by Ralphz
    Hi When you enable pre-receive hook for git repository: It takes no arguments, but for each ref to be updated it receives on standard input a line of the format: < old-value SP < new-value SP < ref-name LF where < old-value is the old object name stored in the ref, < new-value is the new object name to be stored in the ref and is the full name of the ref. When creating a new ref, < old-value is 40 0. Does anyone can explain me how do I examine all the files that will be changed in the repository if i allow this commit? I'd like to run that files through some scripts to check syntax and so on. Thanks.

    Read the article

  • Is Multicast broken for Android 2.0.1 (currently on the DROID) or am I missing something?

    - by Gubatron
    This code works perfectly in Ubuntu, in Windows and MacOSX, it also works fine with a Nexus-One currently running firmware 2.1.1. I start sending and listening multicast datagrams, and all the computers and the Nexus-One will see each other perfectly. Then I run the same code on a Droid (Firmware 2.0.1), and everybody will get the packets sent by the Droid, but the droid will listen only to it's own packets. This is the run() method of a thread that's constantly listening on a Multicast group for incoming packets sent to that group. I'm running my tests on a local network where I have multicast support enabled in the router. My goal is to have devices meet each other as they come on line by broadcasting packages to a multicast group. public void run() { byte[] buffer = new byte[65535]; DatagramPacket dp = new DatagramPacket(buffer, buffer.length); try{ MulticastSocket ms = new MulticastSocket(_port); ms.setNetworkInterface(_ni); //non loopback network interface passed ms.joinGroup(_ia); //the multicast address, currently 224.0.1.16 Log.v(TAG,"Joined Group " + _ia); while (true) { ms.receive(dp); String s = new String(dp.getData(),0,dp.getLength()); Log.v(TAG,"Received Package on "+ _ni.getName() +": " + s); Message m = new Message(); Bundle b = new Bundle(); b.putString("event", "Listener ("+_ni.getName()+"): \"" + s + "\""); m.setData(b); dispatchMessage(m); //send to ui thread } } catch (SocketException se) { System.err.println(se); } catch (IOException ie) { System.err.println(ie); } } Over here, is the code that sends the Multicast Datagram out of every valid network interface available (that's not the loopback interface). public void sendPing() { MulticastSocket ms = null; try { ms = new MulticastSocket(_port); ms.setTimeToLive(TTL_GLOBAL); List<NetworkInterface> interfaces = getMulticastNonLoopbackNetworkInterfaces(); for (NetworkInterface iface : interfaces) { //skip loopback if (iface.getName().equals("lo")) continue; ms.setNetworkInterface(iface); _buffer = ("FW-"+ _name +" PING ("+iface.getName()+":"+iface.getInetAddresses().nextElement()+")").getBytes(); DatagramPacket dp = new DatagramPacket(_buffer, _buffer.length,_ia,_port); ms.send(dp); Log.v(TAG,"Announcer: Sent packet - " + new String(_buffer) + " from " + iface.getDisplayName()); } } catch (IOException e) { e.printStackTrace(); } catch (Exception e2) { e2.printStackTrace(); } } Update (April 2nd 2010) I found a way to have the Droid's network interface to communicate using Multicast! _wifiMulticastLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).createMulticastLock("multicastLockNameHere"); _wifiMulticastLock.acquire(); Then when you're done... if (_wifiMulticastLock != null && _wifiMulticastLock.isHeld()) _wifiMulticastLock.release(); After I did this, the Droid started sending and receiving UDP Datagrams on a Multicast group. gubatron

    Read the article

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