Daily Archives

Articles indexed Wednesday April 28 2010

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

  • Custom Validation on jquery validate plugin, need to count element in a multiple select

    - by 0plus1
    I have a multiple select, and I need to force the user to choose maximum two options, nothing more. I'm trying this: jQuery.validator.addMethod("morethantwo", function(value, element) { var foo = []; $(element+' :selected').each(function(i, selected){ foo[i] = $(selected).text(); alert(foo[i]); }); return true; },"Max two options." ); The problem is that I get a: uncaught exception: Syntax error, unrecognized expression: [object HTMLSelectElement] error. While if I do this: $(element).each(function(i, selected){ foo[i] = $(selected).text(); alert(foo[i]); }); It works but I get all the options in the select. Why is that? Is this the correct road to walk? Are there better ways to do this kind of check? Thank you very much!

    Read the article

  • C++ Beginner Delete Question

    - by Pooch
    Hi all, This is my first year learning C++ so bear with me. I am attempting to dynamically allocate memory to the heap and then delete the allocated memory. Below is the code that is giving me a hard time: // String.cpp #include "String.h" String::String() {} String::String(char* source) { this->Size = this->GetSize(source); this->CharArray = new char[this->Size + 1]; int i = 0; for (; i < this->Size; i++) this->CharArray[i] = source[i]; this->CharArray[i] = '\0'; } int String::GetSize(const char * source) { int i = 0; for (; source[i] != '\0'; i++); return i; } String::~String() { delete[] this->CharArray; } Here is the error I get when the compiler tries to delete the CharArray: 0xC0000005: Access violation reading location 0xccccccc0. And here is the last call on the stack: msvcr100d.dll!operator delete(void * pUserData) Line 52 + 0x3 bytes C++ I am fairly certain the error exists within this piece of code but will provide you with any other information needed. Oh yeah, using VS 2010 for XP. Thanks for any and all help!

    Read the article

  • Using ETS Select To Form An Intersection

    - by Ruhi
    i have the following ets structure: SomeTable = ets:new(sometable, [bag]). ets:insert(SomeTable, [ {set1,item1}, {set1,item2}, {set1,item3}, {set2,item1}, {set2,item2}, {set2,item4}]). i want to get intersection of set1 and set2 using ets:select and fun2ms, result will be [item1, item2]. i spent hours and hours trying to accomplist it with ets:select and fun2ms with no success. can you help me out using ets:select and fun2ms? thanks for all answers! ps: i know about sets module, but i have to use ets and this exact data structure.

    Read the article

  • ruby 1.9 ri problem

    - by Yousui
    hi all, i'm using windows xp sp2, and installed ruby through ruby 1.9 one click installer. then when i try to using ri, i get the following response, can anyone help me with my problem? great thanks. C:\Documents and Settings\eyang>ruby --version ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] C:\Documents and Settings\eyang>ri --version ri 2.2.2 C:\Documents and Settings\eyang>ri String Updating class cache with 0 classes... Nothing known about String C:\Documents and Settings\eyang>ri Updating class cache with 0 classes... No ri data found If you've installed Ruby yourself, you need to generate documentation using: make install-doc from the same place you ran `make` to build ruby. If you installed Ruby from a packaging system, then you may need to install an additional package, or ask the packager to enable ri generation. C:\Documents and Settings\eyang> by the way, when i try to use gem, i got the following error messages too, anyone can explain it ? great thanks. C:\Documents and Settings\eyang>gem --version 1.3.5 C:\Documents and Settings\eyang>gem query --remote *** REMOTE GEMS *** ERROR: While executing gem ... (Errno::ENOMEM) Not enough space - <STDOUT> C:\Documents and Settings\eyang>

    Read the article

  • Apache server randomly stopped working yesterday. How can I fix it?

    - by Clueless
    I use Apache version 2.2.11 through WampServer to host a website. Every time during the last week I tried to connect to localhost it went through and everything was fine. Now all of a sudden I get errors. I didn't change the configuration or anything as far as I know, it just stopped working for no apparent reason. As I said before, it's been working fine. Any way I can get it back up and working again?

    Read the article

  • Efficient way to calculate byte length of a character, depending on the encoding

    - by BalusC
    What's the most efficient way to calculate the byte length of a character, taking the character encoding into account? In UTF-8 for example the characters have a variable byte length, so each character needs to be determined individually. As far now I've come up with this: char c = getItSomehow(); String encoding = "UTF-8"; int length = new String(new char[] { c }).getBytes(encoding).length; But this is clumsy and inefficient in a loop since a new String needs to be created everytime. I can't find other and more efficient ways in the Java API. I imagine that this can be done with bitwise operations like bit shifting, but that's my weak point and I'm unsure how to take the encoding into account here :) If you question the need for this, check this topic.

    Read the article

  • Static/Dynamic vs Strong/Weak

    - by Dan Revell
    I see these terms banded around all over the place in programming and I have a vague notion of what they mean. A search shows me that such things have been asked all over stack overflow in fact. As far as I'm aware Static/Dynamic typing in languages is subtly different to Strong/Weak typing but what that difference is eludes me. Different sources seem to use different different meanings or even use the terms interchangeably. I can't find somewhere that talks about both and actually spells out the difference. What would be nice is if someone could please spell this out clearly here for me and the rest of the world.

    Read the article

  • Best practice way to handle variable content margin?

    - by Aithne
    Ok, so a quick site that I am throwing together for a friend has about 20 static pages. Each one with a small amount of content. the div Container contains, well, the div Content, and the div Content contains, obviously, the content that changes on each page. Now, depending on the length of the content, I want a different margin at the top. The less content, then the larger the margin. Simply an aesthetic choice. For example, if the content almost fills the static sized container, there is less padding, but a 1 line page of content might be 1/3 of the way down the static container. Centering the content in the div wont do, as that creates too large of a margin. Whats the best way to handle this? A new class for each content with a different margin? A new Id, so that it is in its own special div positioned or margined differently? Inline css on each page to override the standard css for div Content? A differnt spacer div inside Container before Content on each page? Some sort of scripting along the lines of margin of Content = (ContainerHeight - ContentHeight) / 3? Whats the acceptable way of doing this? I don't want to get into bad habits.

    Read the article

  • svchost.exe crash on wake up

    - by Serge
    Lately whenever I wake up my laptop from sleep I get a series of errors (generated by a host process failing) I haven't been able to figure out why this happens but I know which host process fails and was wondering if someone had some insight on why this keeps occuring 99% of the time when my laptop wakes up. here's the host process error Faulting application svchost.exe_SysMain, version 6.0.6001.18000, time stamp 0x47919291, faulting module ntdll.dll, version 6.0.6002.18005, time stamp 0x49e0421d, exception code 0xc0000006, fault offset 0x000000000005a02d, process id 0x1738, application start time 0x01cae656279b1010. and here are some services that fail because of that host The Windows Audio Endpoint Builder service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service. The Wired AutoConfig service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 0 milliseconds: Restart the service. The ReadyBoost service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service. The Human Interface Device Access service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 120000 milliseconds: Restart the service. The Network Connections service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 100 milliseconds: Restart the service. The Program Compatibility Assistant Service service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service. The Superfetch service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service. Anyways I think you get the point, there are a few more. It got really annoying to wait for those services to restart so I created a batch file that does it automatically whenever the wlan stops I'm using Vista x64 on a Studio XPS 1640

    Read the article

  • How can I get 32-bit Direct3D working on my 64-bit Windows 7 system?

    - by Daniel Stutzbach
    I recently upgraded a Dell Inspiron 6400 to Windows 7 Ultimate 64-bit. I have a 32-bit 3D application that refuses to run, giving an error of "Failed to initialise [sic] Direct3D device". The dxdiag tool tells me: DirectDraw Acceleration: Enabled Direct3D Acceleration: Not Available However, the 64-bit version of dxdiag tells me: DirectDraw Acceleration: Enabled Direct3D: Enabled I have installed and re-installed the latest graphics drivers, as well as the DirectX 9 redistributable, but it stills fails in the same way. dxdiag reports the chipset name as the "Mobile Intel(R) 945 Express Chipset Family" with the the Chip Type as "Intel(R) GMA 950". The main driver is igdumd64.dll, version 8.15.10.1930. How can I get 32-bit Direct3D working?

    Read the article

  • What does the Microsoft.WebApplication.targets import do in VS 2010 web application projects?

    - by Simon
    Visual Studio 2010 seems to insist on having this import in web application projects <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> What does this import give us and is it really required? On a side note if you remove this import with a text editor Visual studio will re-add it. The reason i am asking is when the project is compiled on a build server that target does nor exists because visual studio is not installed.

    Read the article

  • How to Change TabPage Position in C#.NET?

    - by user327387
    I have six tabs on my Windows application. I need to put tab #6 after tab #2, how can i do it? I couldn't drag the tab to the location i want! The 5 tabs are full of controls that took long time to name and design. Any idea how to move last tab and place it after 3rd tab?

    Read the article

  • Copying 6000 tables and data from sqlserver to oracle ==> fastest method?

    - by nazer555
    i need to copy the tables and data (about 5 yrs data, 6200 tables) stored in sqlserver, i am using datastage and odbc connection to connect and datstage automatically creates the table with data, but its taking 2-3 hours per table as tables are very large(0.5 gig, 300+columns and about 400k rows). How can i achieve this the fastes as at this rate i am able to only copy 5 tables per day but within 30 days i need move over these 6000 tables.

    Read the article

  • Some basic UML questions

    - by devoured elysium
    What does it mean when you have something as the following picture? Each Customer has none, one or more Orders while each Order has only one Customer? And in relationship to the following one: What does the black diamond mean in this context? How is that black diamond called? Thanks

    Read the article

  • Java: why does extending need an empty constructor?

    - by HH
    I have classes SearchToUser and getFilesToWord. GetFilesToWord must inherit SearchToUser fields. Extending works if an empty construction in SearchToUser-class, otherwise: cannot find symbol symbol : constructor SearchToUser() location: class SearchToUser public class GetFilesToWord extends SearchToUser{ ^ 1 error make: *** [all] Error 1 I cannot understand why the empty constructor is required for extending.

    Read the article

  • groovy closure parameters

    - by Don
    Hi, The following example of using the sendMail method provided by the grails mail plugin appears in this book. sendMail { to "[email protected]" subject "Registration Complete" body view:"/foo/bar", model:[user:new User()] } I understand that the code within {} is a closure that is passed to sendMail as a parameter. I also understand that to, subject and body are method calls. I'm trying to figure out what the code that implements the sendMail method would look like, and my best guess is something like this: MailService { String subject String recipient String view def model sendMail(closure) { closure.call() // Code to send the mail now that all the // various properties have been set } to(recipient) { this.recipient = recipient } subject(subject) { this.subject = subject; } body(view, model) { this.view = view this.model = model } } Is this reasonable, or am I missing something? In particular, are the methods invokedwithin the closure (to, subject, body), necessarily members of the same class as sendMail? Thanks, Don

    Read the article

  • Fatal IO error 0 (Success) on X server

    - by Ori Pessach
    What does the error "Fatal IO error 0 (Success) on X server" mean? The error is produced when an X client tries to call XvCreateImage(), and it results in the client terminating. X.0.log shows the following version information: X.Org X Server 1.6.4 Release Date: 2009-9-27 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.24-23-server i686 Ubuntu Current Operating System: Linux ori-laptop 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 2009 i686 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.31-17-generic root=UUID=df637de9-47ed-4453-9393-67e2e2ffaa2f ro quiet splas

    Read the article

  • How to provide custom connection string for Logging Application Block instead of using the one in .c

    - by Rory
    I'm modifying an existing winforms application to use the Logging Application Block. For historical reasons this app gets its main database connection string from the registry, and I'd like the Logging Application Block to use the same details for logging to the database. How can I do this? The approaches i can think of are: 1) Create a new TraceListener and implement the same sort of functionality as in FormattedDatabaseTraceListener. If I take this approach, should I inherit from CustomTraceListener, and if so how do I pass an attribute of the formatter to use? 2) Create a new ConfigurationSource that provides different details when asked for the database connection. All other requests would be passed through to a FileConfigurationSource, but when asked for the database connection details the object would read the appropriate bits from the registry instead. but it's not obvious which is more appropriate, or how to go about doing it. Any suggestions? I'm using EntLib 3.1. thanks, -Rory

    Read the article

  • Helper functions & prototype methods to replace heavy frameworks?

    - by Rob
    All frameworks aside, what are some of the common helper functions/prototype methods you use on a daily basis? Please note I am not arguing against frameworks. I've simply found that the majority of what I do on a daily basis can, most often, be done with a few dozen Array, String and Element.prototype methods. With the addition of a few helper functions like $ (getElementsById) and $$$ (getElementsByClass), I am able to satisfy some of the core benefits, however basic, of a much heavier framework. If you were to collect a small library of basic methods and functions to replace the core functionality of some of the popular frameworks, what would they be?

    Read the article

  • How likely can my data be recovered after Windows CHKDSK performed on a degraded RAID 5 array?

    - by chrisling106
    Hello there, We have a RAID 5 setup with 3 SATA disks, #2 went down as reported on the pre-POST screen. Unfortunately, for some reason out of my control, the system was rebooted with a degraded RAID :-O Windows XP (64-bit) loaded, CHKDSK ran automatically and done its recovery! From that point onwards, the following error prompts every time even in Safe Mode: lsass.exe - The endpoint format is invalid I took those 3 disks to the data recovery expert and need to wait at least 2-4 days for results. There are 2 VMs on multiple files stored in this RAID 5 array, and there's no backup! Sorry, I just inherited the system from an ex-staff who has left the company 2 months before I joined. How likely the data can be recovered?

    Read the article

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