Search Results

Search found 5653 results on 227 pages for 'zero cool'.

Page 30/227 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • How do I make a module in PLT Scheme?

    - by kunjaan
    I tried doing this: #lang scheme (module duck scheme/base (provide num-eggs quack) (define num-eggs 2) (define (quack n) (unless (zero? n) (printf "quack\n") (quack (sub1 n))))) But I get this error: module: illegal use (not at top-level) in: (module duck scheme/base (provide num-eggs quack) (define num-eggs 2) (define (quack n) (unless (zero? n) (printf "quack\n") (quack (sub1 n))))) what is the correct way?

    Read the article

  • SSRS stop report generation on 0 records

    - by AmiT
    Hi All, I am creating a report from ssrs, and storing at local shared folder(MyReports) in excel format using data-driven subscription. It generates a report on scheduled time. But, I don't wanna create a report with zero records. How to stop SSRS to generate a report if no. of records is zero. Pls F1 me ... !

    Read the article

  • Calling a groovy script form Javascript

    - by RenegadeAndy
    Hey! I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at that point also. Thanks Andy

    Read the article

  • Calling a groovy script from Javascript

    - by RenegadeAndy
    Hey! I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at that point also. Thanks Andy

    Read the article

  • c# uploading file - error

    - by user228058
    I have a webpage where the user can upload an excel file. I'm trying 2 different files - one works without a problem, and the other one gives me this error: Error: Length cannot be less than zero. Parameter name: length I know that sometimes this occurs when the file size is zero, but that is not the case here. Can anyon shed light on this issue? Please let me know if you need more info.

    Read the article

  • How can I create specialized builders for semantic layout in rails?

    - by Paul Alexander
    This is how I'd like to write markup in say index.html.erb <%= page_for "Super Cool Page" do |p| %> <%= p.header do %> Ruby is Cool <% end %> <%= p.body do %> Witty discourse on Ruby. <% end %> <% if page.has_sidebar? %> <%= p.sidebar do %> <ul><li>Option 1</li></ul> <% end %> <% end %> <% end %> Which would output <div class="page"> <header><h1>Super Cool Page</h1></header> <section> Witty discourse on Ruby. </section> </div> and when page.has_sidebar? is true <div class="page"> <header><h1>Super Cool Page</h1></header> <asside><ul><li>Option 1</li></ul></asside> <section> Witty discourse on Ruby. </section> </div> I've taken a look at the FormHelper class in rails for guidance, but it seems like I'd have to duplicate a lot of work which I'm trying to avoid. I'm really just trying to figure out where to hang the classes/modules/methods in the framework and whit kind of object |p| should be. My first inclination was to create a PageBuilder class that implements header, body and sidebar methods. But I got stuck on the rendering pipeline to get everything output just right. Is there a gem that already provides this type of semantic generation? If not I'd love any insight on how to set this up.

    Read the article

  • Calling a groovy script or Java from Javascript

    - by RenegadeAndy
    Hey! I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at that point also. Thanks Andy

    Read the article

  • Unmanaged Code calling leads to heavy memory leak!!

    - by konnychen
    Maybe I need change the title as "Unmanaged Code calling leads to heavy memory leak!" The leak is around 30M/hour I think maybe I need complete my code here because the memory leak maybe not from a static string whereas my real code derive this string from external device (see new code attached). so I handle also unmanaged code. Could it be possible the leak comes from unmanaged code? But I freed the resouce by Marshal.FreeCoTaskMem(pos); oThread2 = new Thread(new ThreadStart(Cyclic_Call)); oThread2.Start(); delegate void SetText_lab_Statubar(string text); private void m_SetText_lab_Statubar(string text) { if (this.lab_Statubar.InvokeRequired) { SetText_lab_Statubar d = new SetText_lab_Statubar(m_SetText_lab_Statubar); this.Invoke(d, new object[] { text }); } else { this.lab_Statubar.Text = text; } } private void Cyclic_Call() { do { //... ... ReadMatrixCode(Station6, 0, str_Code); this.m_SetText_lab_Statubar(str_Code[4]); Thread.Sleep(100); } while (!b_AbortThraed); } private void ReadMatrixCode(Station st, int ItemNr, string[] str_Code) { IntPtr pItemStates = IntPtr.Zero; IntPtr pErrors = IntPtr.Zero; int NumItems = itemServerHandles.Length; m_SyncIO.Read(DataSrc, NumItems, itemServerHandles, out pItemStates, out pErrors); // This calls external dll which has some of "out IntPtr" errors = new int[NumItems]; Marshal.Copy(pErrors, errors, 0, NumItems); IntPtr pos = pItemStates; // Now get the read values and check errors for (int dwCount = 0; dwCount < NumItems; dwCount++) { result[dwCount] = (ITEMSTATE)Marshal.PtrToStructure(pos, typeof(ITEMSTATE)); pos = (IntPtr)(pos.ToInt32() + Marshal.SizeOf(typeof(ITEMSTATE))); } // Free allocated COM-ressouces Marshal.FreeCoTaskMem(pItemStates); Marshal.FreeCoTaskMem(pErrors); pItemStates = IntPtr.Zero; pErrors = IntPtr.Zero; } m_syncIO is a class and finally it will call COM component which is defined below [Guid("39C12B52-011E-11D0-9675-1020AFD8ADB3")] [InterfaceType(1)] [ComConversionLoss] public interface ISyncIO { void Read(DATASOURCE dwSource, int dwCount, int[] phServer, out IntPtr ppItemValues, out IntPtr ppErrors); void Write(int dwCount, int[] phServer, object[] pItemValues, out IntPtr ppErrors); }

    Read the article

  • Libraries for text animation in Flex / Actionscript ?

    - by Simon
    Are there any good libraries for cool text animation effects for use in Actionscript (for use in an intro screen or banner). I've given up tryin to use Flash itself because that takes forever, and I dont know which of the many flash text animation tools to choose from. I'd like to be able to dynamically product cool text effects with different messages.

    Read the article

  • Why does C# exit when calling the Ada elaboration routine using debug?

    - by erict
    I have a DLL created in Ada using GPS. I am dynamically loading it and calling it successfully both from Ada and from C++. But when I try to call it from C#, the program exits on the call to Elaboration init. What am I missing? The exact same DLL is perfectly happy getting called from C++ and Ada. Edit: If I start the program without Debugging, it also works with C#. But if I run it with the Debugger, then it exits on the call to ElaborationInit. There are no indications in any of the Windows event logs. If the Ada DLL is Pure, and I skip the elaboration init call, the actual function DLL is called correctly, so it has something to do with the elaboration. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace CallingDLLfromCS { class Program { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)] public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool FreeLibrary(IntPtr hModule); [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate int AdaCallable2_dlgt(int val); static AdaCallable2_dlgt fnAdaCallable2 = null; [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate void ElaborationInit_dlgt(); static ElaborationInit_dlgt ElaborationInit = null; [UnmanagedFunctionPointer(CallingConvention.StdCall)] delegate void AdaFinal_dlgt(); static AdaFinal_dlgt AdaFinal = null; static void Main(string[] args) { int result; bool fail = false; // assume the best IntPtr pDll2 = LoadLibrary("libDllBuiltFromAda.dll"); if (pDll2 != IntPtr.Zero) { // Note the @4 is because 4 bytes are passed. This can be further reduced by the use of a DEF file in the DLL generation. IntPtr pAddressOfFunctionToCall = GetProcAddress(pDll2, "AdaCallable@4"); if (pAddressOfFunctionToCall != IntPtr.Zero) { fnAdaCallable2 = (AdaCallable2_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(AdaCallable2_dlgt)); } else fail = true; pAddressOfFunctionToCall = GetProcAddress(pDll2, "DllBuiltFromAdainit"); if (pAddressOfFunctionToCall != IntPtr.Zero) { ElaborationInit = (ElaborationInit_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(ElaborationInit_dlgt)); } else fail = true; pAddressOfFunctionToCall = GetProcAddress(pDll2, "DllBuiltFromAdafinal"); if (pAddressOfFunctionToCall != IntPtr.Zero) AdaFinal = (AdaFinal_dlgt)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(AdaFinal_dlgt)); else fail = true; if (!fail) { ElaborationInit.Invoke(); // ^^^^^^^^^^^^^^^^^^^^^^^^^ FAILS HERE result = fnAdaCallable2(50); Console.WriteLine("Return value is " + result.ToString()); AdaFinal(); } FreeLibrary(pDll2); } } } }

    Read the article

  • Case Insensitive URLs with mod_rewrite

    - by Paul Tarjan
    I'd like for any url that doesn't hit an existing file, to do a lookup on the other possible cases and see if those files exist, and if so, 302 to them. If that's not possible, then I'm ok with these compromises: Only check the lowercase version Only check the first path portion For example http://example.com/CoOl/PaTH/CaMELcaSE should redirect to http://example.com/cool/path/camelCase (assuming the latter exists). but of course a full solution is much more useful to me and others

    Read the article

  • C++0x Overload on reference, versus sole pass-by-value + std::move?

    - by dean
    It seems the main advice concerning C++0x's rvalues is to add move constructors and move operators to your classes, until compilers default-implement them. But waiting is a losing strategy if you use VC10, because automatic generation probably won't be here until VC10 SP1, or in worst case, VC11. Likely, the wait for this will be measured in years. Here lies my problem. Writing all this duplicate code is not fun. And it's unpleasant to look at. But this is a burden well received, for those classes deemed slow. Not so for the hundreds, if not thousands, of smaller classes. ::sighs:: C++0x was supposed to let me write less code, not more! And then I had a thought. Shared by many, I would guess. Why not just pass everything by value? Won't std::move + copy elision make this nearly optimal? Example 1 - Typical Pre-0x constructor OurClass::OurClass(const SomeClass& obj) : obj(obj) {} SomeClass o; OurClass(o); // single copy OurClass(std::move(o)); // single copy OurClass(SomeClass()); // single copy Cons: A wasted copy for rvalues. Example 2 - Recommended C++0x? OurClass::OurClass(const SomeClass& obj) : obj(obj) {} OurClass::OurClass(SomeClass&& obj) : obj(std::move(obj)) {} SomeClass o; OurClass(o); // single copy OurClass(std::move(o)); // zero copies, one move OurClass(SomeClass()); // zero copies, one move Pros: Presumably the fastest. Cons: Lots of code! Example 3 - Pass-by-value + std::move OurClass::OurClass(SomeClass obj) : obj(std::move(obj)) {} SomeClass o; OurClass(o); // single copy, one move OurClass(std::move(o)); // zero copies, two moves OurClass(SomeClass()); // zero copies, one move Pros: No additional code. Cons: A wasted move in cases 1 & 2. Performance will suffer greatly if SomeClass has no move constructor. What do you think? Is this correct? Is the incurred move a generally acceptable loss when compared to the benefit of code reduction?

    Read the article

  • Django: FloatField or DecimalFied for Currency ?

    - by Hellnar
    I am curious which one would be better fitting as a currency field ? I will do simple operations such as taking difference, the percentage between old and new prices. I plan to keep two digits after the zero (ie 10.50) and majority of the time if these digits are zero, I will be hiding these numbers and display it as "10"

    Read the article

  • Java configuration framework

    - by Steen
    I'm in the process of weeding out all hardcoded values in a java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer xml-based config-files, but it's not essential. Please do only reply if you have practical experience with a framework. I'm not looking for examples, but experience... Thanks for taking the time.

    Read the article

  • .NET read binary contents of .lnk file

    - by Flores
    I want to read the binary contents of a .lnk file. As long as the target of the shortcut (lnk file) exists this works fine with IO.File.ReadAllBytes(string file). BUT If the target of the shortcut does not exist (believe me I want this) the method only returns zero's. I guess this is because the OS follows the link and if it does not exist it returns zero's Is there some way to bypass the fact that the framework follows the target of the .lnk before displaying the contents of the .lnk file?

    Read the article

  • Is it guaranteed that False == 0 and True == 1 in Python?

    - by EOL
    Is it guaranteed that False == 0 and True == 1, in Python? For instance, is it in any way guaranteed that the following code will always produce the same results, whatever the version of Python (existing and in the foreseeable future)? 0 == False # True 1 == True # True ['zero', 'one'][False] # is 'zero' Any reference to the official documentation would be much appreciated! Other comments would be appreciated too… :)

    Read the article

  • DeviceIoControl returning false

    - by Anand
    In my C# code,DeviceIoControl is returning false,the handle is correct DeviceIoControl(deviceHandle, IOCTL_STORAGE_GET_DEVICE_NUMBER, IntPtr.Zero, 0, OutBuffPtr,//&psdn, OutBuffSize, ref dwBytesReturned, IntPtr.Zero);

    Read the article

  • Why is the Objective-C Boolean data type defined as a signed char?

    - by EddieCatflap
    Something that has piqued my interest is Objective-C's BOOL type definition. Why is it defined as a signed char (which could cause unexpected behaviour if a value greater than 1 byte in length is assigned to it) rather than as an int, as C does (much less margin for error: a zero value is false, a non-zero value is true)? The only reason I can think of is the Objective-C designers micro-optimising storage because the char will use less memory than the int. Please can someone enlighten me?

    Read the article

  • Simple Ruby Command Line Question

    - by aronchick
    Um - I feel like an idiot, but.... ruby -e '3+5' Outputs nothing (Windows 7, Ruby 1.8.7, Cygwin or Git Bash). What am I missing? Extra credit - will this also allow the extra cool bundle (stolen from TextMate) Execute and Update # = markers to work properly? EDIT Ok that worked, and I'll accept the answer, but e-texteditor still doesn't work with that really cool bundle. Too bad.

    Read the article

  • Collision Detection probelm (intersection with plane)

    - by Demi
    I'm doing a scene using openGL (a house). I want to do some collision detection, mainly with the walls in the house. I have tried the following code: // a plane is represented with a normal and a position in space Vector planeNor(0,0,1); Vector position(0,0,-10); Plane p(planeNor,position); Vector vel(0,0,-1); double lamda; // this is the intersection point Vector pNormal; // the normal of the intersection // this method is from Nehe's Lesson 30 coll= p.TestIntersionPlane(vel,Z,lamda,pNormal); glPushMatrix(); glBegin(GL_QUADS); if(coll) glColor3f(1,0,0); else glColor3f(1,1,1); glVertex3d(0,0,-10); glVertex3d(3,0,-10); glVertex3d(3,3,-10); glVertex3d(0,3,-10); glEnd(); glPopMatrix(); Nehe's method: #define EPSILON 1.0e-8 #define ZERO EPSILON bool Plane::TestIntersionPlane(const Vector3 & position,const Vector3 & direction, double& lamda, Vector3 & pNormal) { double DotProduct=direction.scalarProduct(normal); // Dot Product Between Plane Normal And Ray Direction double l2; // Determine If Ray Parallel To Plane if ((DotProduct<ZERO)&&(DotProduct>-ZERO)) return false; l2=(normal.scalarProduct(position))/DotProduct; // Find Distance To Collision Point if (l2<-ZERO) // Test If Collision Behind Start return false; pNormal= normal; lamda=l2; return true; } Z is initially (0,0,0) and every time I move the camera towards the plane, I reduce its z component by 0.1 (i.e. Z.z-=0.1 ). I know that the problem is with the vel vector, but I can't figure out what the right value should be. Can anyone please help me?

    Read the article

  • how to make datagrid Visibility is Collapsed in codebehind

    - by prince23
    hi i have data grid. now here i am checking the condition if Companyrows.count is zero . if count is zero make data grid.visible is false. List<Employee> Companyrows = new List<Employee>(); if (Companyrows.Count == 0) { dgrdRowDetail.Visibility = "Collapsed"; // getting error // convert type 'string' to 'System.Windows.Visibility' } else { dgrdRowDetail.ItemsSource = Companyrows; } any help how to solve this issue would be great thank you

    Read the article

  • Do you know any mainstream desktop applications developed with Python and Qt?

    - by systempuntoout
    Hi i'm developing a small prototype of a desktop application using Qt and Python because i would like to distribute it in a multiplatform way. A friend of mine is annoying me on messenger because he claims that there are not known cool mainstream desktop apps developed with Qt and python technologies so, what i am doing, is just an exercise without future. Do you know any cool apps developed in python+Qt? thanks

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >