Search Results

Search found 123 results on 5 pages for 'jf lr'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Sort multiple columns while using a bindingsource or bindinglist

    - by JF
    Hi everyone. I have a problem I am trying to fix and it's sorting a DataGridView on multiple columns. I have read that this option is not a feature built-in the DataGridView and I have to implement it. I have found multiple solutions, but none quite got to do the work. I'm also quite a newbie in C# and I don't know much of the .Net library. I have also read on the MSDN site for info on different classes that might be of use, but no success. Now, let's get to the point. I have a DataGridView, with a BindingList (originally, a BindingSource) that I want to sort, but by multiple keys. My DataGrid has 9 columns and the user should be able to sort on any column. For example, let's say my Datagrid has 3 columns, named : Index, ID, Name. The user wants to sort by Name, implicitly, the next order would be Index and then ID. So, in case 2 names are identical, Index should be the next sort option. Any ideas how this can be made?

    Read the article

  • Worse is better. Is there an example?

    - by J.F. Sebastian
    Is there a widely-used algorithm that has time complexity worse than that of another known algorithm but it is a better choice in all practical situations (worse complexity but better otherwise)? An acceptable answer might be in a form: There are algorithms A and B that have O(N**2) and O(N) time complexity correspondingly, but B has such a big constant that it has no advantages over A for inputs less then a number of atoms in the Universe. Examples highlights from the answers: Simplex algorithm -- worst-case is exponential time -- vs. known polynomial-time algorithms for convex optimization problems. A naive median of medians algorithm -- worst-case O(N**2) vs. known O(N) algorithm. Backtracking regex engines -- worst-case exponential vs. O(N) Thompson NFA -based engines. All these examples exploit worst-case vs. average scenarios. Are there examples that do not rely on the difference between the worst case vs. average case scenario? Related: The Rise of ``Worse is Better''. (For the purpose of this question the "Worse is Better" phrase is used in a narrower (namely -- algorithmic time-complexity) sense than in the article) Python's Design Philosophy: The ABC group strived for perfection. For example, they used tree-based data structure algorithms that were proven to be optimal for asymptotically large collections (but were not so great for small collections). This example would be the answer if there were no computers capable of storing these large collections (in other words large is not large enough in this case). Coppersmith–Winograd algorithm for square matrix multiplication is a good example (it is the fastest (2008) but it is inferior to worse algorithms). Any others? From the wikipedia article: "It is not used in practice because it only provides an advantage for matrices so large that they cannot be processed by modern hardware (Robinson 2005)."

    Read the article

  • Getting the uptime of a SunOS UNIX box in seconds only

    - by JF
    How do I determine the uptime on a SunOS UNIX box in seconds only? On Linux, I could simply cat /proc/uptime & take the first argument: cat /proc/uptime | awk '{print $1}' I'm trying to do the same on a SunOS UNIX box, but there is no /proc/uptime. There is an uptime command which presents the following output: $ uptime 12:13pm up 227 day(s), 15:14, 1 user, load average: 0.05, 0.05, 0.05 I don't really want to have to write code to convert the date into seconds only & I'm sure someone must have had this requirement before but I have been unable to find anything on the internet. Can anyone tell me how to get the uptime in just seconds? TIA

    Read the article

  • Problem with StandardOutput stream in async mode.

    - by JF
    Hi everyone. I have a program that launches command line processes in async mode, using BeginOutputReadLine. My problem is that the .Exited event is triggered when there is still some .OutputDataReceived events being triggered. What I do in my .Exited event must happen only once all my .OutputDataReceived events are done, or I'll be missing some output. I looked in the Process class to see if anything could be useful to me, as to wait for the stream to be empty, but all I find is for sync mode only. Can any of you help? Thanx.

    Read the article

  • Bootstrapper with custom package

    - by JF
    I'm currently developping a bootstrapper to deploy one of my VSTO addins. I thus created a prerequisites list before compiled it with MSBuild, but I also need to test and install the otkloadr.dll fix (KB907417). In a first time I used a custom bootstrapper package, but the package directory and files must be included with my deployment if I want to use it. In fact I really want to have a very light setup kit, with only the setup.exe and the addin.msi files... Is there a way to use a custom bootstrapper package embedded into the setup.exe ? If not, is there a standard bootstrapper package which include the KB907417 fix ?

    Read the article

  • How to break out of a nested parallel (OpenMP) Fortran loop idiomatically?

    - by J.F. Sebastian
    Here's sequential code: do i = 1, n do j = i+1, n if ("some_condition") then result = "here's result" return end if end do end do Is there a cleaner way to execute iterations of the outer loop concurrently other than: !$OMP PARALLEL private(i,j) !$OMP DO do i = 1, n if (found) goto 10 do j = i+1, n if (found) goto 10 if ("some_condition") then !$OMP CRITICAL !$OMP FLUSH if (.not.found) then found = .true. result = "here's result" end if !$OMP FLUSH !$OMP END CRITICAL goto 10 end if end do 10 continue end do !$OMP END DO NOWAIT !$OMP END PARALLEL

    Read the article

  • Preferred Windows Java Development Environment

    - by JF
    I've been a Linux Java developer for years and have loved it. I just got a new laptop which is running Windows 7. I could wipe the drive and go back to my typical Linux dev setup: vim for editing, tabbed Bash windows running javac and java for smaller projects, ant for big projects That said, I'm really thinking it couldn't hurt to learn to develop in a new environment. So, with that in mind, are there any Windows-based Java devs out there? What setup do you like to use to get things done? It'd be interesting to hear both ways to emulate my Linux-based environment as well as completely different styles that I might benefit from trying.

    Read the article

  • Can't figure out how to code my css

    - by JF
    Hi, I'm a new poster in stackoverflow. The community seems really nice so I'll go ahead and post my question. I'm trying to style a asp.net MVC2 form so that instead of having all the fields on a strait line, I would like to have it like so: Label: Text field Label: Text field I know you could do that with a table but I would like to use CSS to accomplish that. I know a little bit about css but not enough to figure out what to do. The only thing I came close to was to but my fields as a unorder list then styling the li item. Thank you for your help!

    Read the article

  • XmlSerializer Deserialize failures

    - by smvlad
    I have wsdl from third party server. Method that i'm interested in returns XmlNode. My thought was wrap web methods and use XmlSerializer to return strongly typed objects. Returned xml looks like this (i removed soap headers): <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ResponseExt" xmlns="http://www.thirdparty.com/lr/"> <Code>0</Code> <Message>SUCCESS</Message> <SessionId>session_token</SessionId> </Response> Looked simple. Created a class: [XmlRoot("Response")] public class MyClass { public string Code {get; set;} public string Message {get; set;} public string SessionId {get; set;} } Processing time: //XmlNode node = xml from above XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); XmlNodeReader reader = new XmlNodeReader(node); Myclass myclass = serializer.Deserialize(reader) as MyClass Last line is where it blows up with inner exception message: The specified type was not recognized: name='ResponseExt', namespace='http://www.thirdparty.com/lr/', at . I can't figure out how to make Serializer happy and what exactly these two mean xsi:type="ResponseExt" xmlns="http://www.thirdparty.com/lr/ As always any advice and pointer are appreciated

    Read the article

  • Reasonably faster way to traverse a directory tree in Python?

    - by Sridhar Ratnakumar
    Assuming that the given directory tree is of reasonable size: say an open source project like Twisted or Python, what is the fastest way to traverse and iterate over the absolute path of all files/directories inside that directory? I want to do this from within Python (subprocess is allowed). os.path.walk is slow. So I tried ls -lR and tree -fi. For a project with about 8337 files (including tmp, pyc, test, .svn files): $ time tree -fi > /dev/null real 0m0.170s user 0m0.044s sys 0m0.123s $ time ls -lR > /dev/null real 0m0.292s user 0m0.138s sys 0m0.152s $ time find . > /dev/null real 0m0.074s user 0m0.017s sys 0m0.056s $ tree appears to be faster than ls -lR (though ls -R is faster than tree, but it does not give full paths). find is the fastest. Can anyone think of a faster and/or better approach? On Windows, I may simply ship a 32-bit binary tree.exe or ls.exe if necessary. Update 1: Added find

    Read the article

  • Line Intersection from parametric equation

    - by Sidar
    I'm sure this question has been asked before. However, I'm trying to connect the dots by translating an equation on paper into an actual function. I thought It would be interesting to ask here instead on the Math sites (since it's going to be used for games anyway ). Let's say we have our vector equation : x = s + Lr; where x is the resulting vector, s our starting point/vector. L our parameter and r our direction vector. The ( not sure it's called like this, please correct me ) normal equation is : x.n = c; If we substitute our vector equation we get: (s+Lr).n = c. We now need to isolate L which results in L = (c - s.n) / (r.n); L needs to be 0 < L < 1. Meaning it needs to be between 0 and 1. My question: I want to know what L is so if I were to substitute L for both vector equation (or two lines) they should give me the same intersection coordinates. That is if they intersect. But I can't wrap my head around on how to use this for two lines and find the parameter that fits the intersection point. Could someone with a simple example show how I could translate this to a function/method?

    Read the article

  • Grep, no value return

    - by Daniel S.
    I am searching for a word, in this case "hehe" that is located in the file findTest by using grep, but when i initiate the search: grep -r "hehe" or grep -lr "hehe" it starts but after 5 min waiting nothing happens, even if i am in the same directory as the file. the only way i get a results straight away is being in the same directory and typing: grep "hehe" findTest Are their any other ways to search for a word? even if not in the same directory.

    Read the article

  • Extend and Overload MS and Point Types

    - by dr d b karron
    Do I have make my own Point and Vector types to overload them ? Why does this not work ? namespace System . windows { public partial struct Point : IFormattable { public static Point operator * ( Point P , double D ) { Point Po = new Point ( ); return Po; } } } namespace SilverlightApplication36 { public partial class MainPage : UserControl { public static void ShrinkingRectangle ( WriteableBitmap wBM , int x1 , int y1 , int x2 , int y2 , Color C ) { wBM . DrawRectangle ( x1 , y1 , x2 , y2 , Colors . Red ); Point Center = Mean ( x1 , y1 , x2 , y2 ); wBM . SetPixel ( Center , Colors.Blue , 3 ); Point P1 = new Point ( x1 , y1 ); Point P2 = new Point ( x1 , y2 ); Point P3 = new Point ( x1 , y2 ); Point P4 = new Point ( x2 , y1 ); const int Steps = 10; for ( int i = 0 ; i < Steps ; i++ ) { double iF = (double)(i+1) / (double)Steps; double jF = ( 1.0 - iF ); Point P11 = **P1 * jF;** } }

    Read the article

  • Cygwin vim doesn't load files in runtimepath

    - by durron597
    I created a custom syntax file, and but none of the files in $VIMRUNTIME seem to load. I followed these pieces of the documentation: http://vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype http://vimdoc.sourceforge.net/htmldoc/syntax.html#mysyntaxfile When I do :echo &runtimepath I get: /home/durron597/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/home/durron597/.vim/after However, if I open a file with vim -D, here's the listed files as I type f: /etc/vimrc /home/durron597/.vimrc /usr/share/vim/vim73/plugin/getscriptPlugin.vim /usr/share/vim/vim73/plugin/gzip.vim /usr/share/vim/vim73/plugin/matchparen.vim /usr/share/vim/vim73/plugin/netrwPlugin.vim /usr/share/vim/vim73/plugin/rrhelper.vim /usr/share/vim/vim73/plugin/spellfile.vim /usr/share/vim/vim73/plugin/tarPlugin.vim /usr/share/vim/vim73/plugin/tohtml.vim /usr/share/vim/vim73/plugin/vimballPlugin.vim /usr/share/vim/vim73/plugin/zipPlugin.vim Here's the output of ls -lR durron597@Durron597 ~/.vim $ ls -lR .: total 0 drwxr-xr-x+ 1 durron597 None 0 Jun 3 11:06 ftdetect drwxr-xr-x+ 1 durron597 None 0 Jun 3 11:06 syntax ./ftdetect: total 1.0K -rw-r--r-- 1 durron597 None 45 Jun 3 11:06 mytype.vim ./syntax: total 4.0K -rw-r--r-- 1 durron597 None 740 Jun 3 11:06 mytype.vim The exact exact paths are: /home/durron597/.vim/ftdetect/mytype.vim /home/durron597/.vim/syntax/mytype.vim Note: the problem is that these files don't seem to be loaded at all, not that these files have internal mistakes Output of :filetype filetype detection:ON plugin:ON indent:OFF Edit 3: No, really, the files are in the right place: $ find /home -name '*.vim' /home/durron597/.vim /home/durron597/.vim/ftdetect/fix.vim /home/durron597/.vim/syntax/fix.vim

    Read the article

  • Home-made HTTP proxy server [closed]

    - by Martin Dimitrov
    I wanted to help a friend who has some restrictions at work to visit certain sites. Locally, on a Windows 7 machine, I run Apache server and decided to make it a proxy just for the IP of my friend. So I added the following to the configuration file: ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Deny from all Allow from <his.ip> </Proxy> It worked fine. But shortly the proxy started to receive many requests of the form: 66.249.66.242 - - [22/Sep/2012:11:01:12 +0300] "GET /search?hl=en&lr=lang_en&as_qdr=all&ie=UTF-8&q=related:www.aarp.org/aarp-foundation/+allinurl:+foundation&tbo=1&sa=X&ei=BSy2T9L_L8PitQapwtHtBw&ved=0COQBEB8wPw HTTP/1.1" 403 208 66.249.71.36 - - [22/Sep/2012:11:01:49 +0300] "GET /search?hl=en&lr=lang_en&as_qdr=all&ie=UTF-8&q=related:www.aarp.org/aarp-foundation/+allinurl:+foundation&tbo=1&sa=X&ei=BOCzT-_WK8_0sgbki5XCDA&ved=0COABEB8wPg HTTP/1.1" 403 208 These are Google IPs. The requests are every 30 seconds or so. My friend is not at work today. In apache_error.log I see: [Sat Sep 22 11:09:20 2012] [error] [client 66.249.66.242] client denied by server configuration: C:/wamp/www/aclk [Sat Sep 22 11:09:47 2012] [error] [client 66.249.71.36] client denied by server configuration: C:/wamp/www/search What the hell is going on? Please, help.

    Read the article

  • File descriptor linked to socket or pipe in proc

    - by primero
    i have a question regarding the file descriptors and their linkage in the proc file system. I've observed that if i list the file descriptors of a certain process from proc ls -la /proc/1234/fd i get the following output: lr-x------ 1 root root 64 Sep 13 07:12 0 -> /dev/null l-wx------ 1 root root 64 Sep 13 07:12 1 -> /dev/null l-wx------ 1 root root 64 Sep 13 07:12 2 -> /dev/null lr-x------ 1 root root 64 Sep 13 07:12 3 -> pipe:[2744159739] l-wx------ 1 root root 64 Sep 13 07:12 4 -> pipe:[2744159739] lrwx------ 1 root root 64 Sep 13 07:12 5 -> socket:[2744160313] lrwx------ 1 root root 64 Sep 13 07:12 6 -> /var/lib/log/some.log I get the meaning of a file descriptor and i understand from my example the file descriptors 0 1 2 and 6, they are tied to physical resources on my computer, and also i guess 5 is connected to some resource on the network(because of the socket), but what i don't understand is the meaning of the numbers in the brackets. Do the point to some property of the resource? Also why are some of the links broken? And lastly as long as I asked a question already :) what is pipe?

    Read the article

  • Linux: how to use Jellyfish from Jack Meterbridge?

    - by klox
    dear all, i have installed Meterbridge. But,i'm just need to use Jellyfish from this package. I changed the Meterbridge properties become: /usr/bin/meterbridge -t jf alsa_pcm:playback_1 alsa_pcm:playback_2 My problem come here, i can open the Jellyfish window but i can't show the wave from input jack. How should i do? have you ever try this? some tell me to set up the Jack Audio Connection Kit, But i don't understand how to do it because i'm new for this

    Read the article

  • IIS can't serve files with accents and spaces in file names

    - by pho3nix
    My server recently stopped serve files with accents and spaces in filename. and example [http://jf-monteabraao.pt/UserFiles/File/OP%C3%87%C3%95ES%20DO%20PLANO%20-%20OR%C3%87AMENTO%202010.pdf][1] I not installed anything except urlscan but i seeing urlscan.ini and don't find any reference to this rule. anyone have idea whats happen?

    Read the article

  • Where is the xorg.conf file in Karmic Koala (Ubuntu 9.10) ?

    - by jfmessier
    I am trying to change this xorg.conf file that I used to modify under Ubuntu 9.04, so it can have the higher resolutions of my monitor. Under 9.04, the monitor was unknown, and I had to key in all resolutions in the file, and although it is found under 9.10, 9.10 does not have the highest resolution that My monitor can sustain. How can I change such setting ? Is xorg.conf moved, or replaced ? Merci :-) JF

    Read the article

  • Ninject 3.0 MVC kernel.bind error Auto Registration

    - by user295734
    Getting and error on kernel.Bind(scanner = ... "scanner" has the little error line under it in VS 2010. Cannot convert lambda expression to type 'System.Type[]' because it is not a delegate type Tyring to Auto Register like the old kernel.scan in 2.0. I can not figure out what i am doing wrong. Added and removed so many Ninject packages. completely lost, getting to be a big waste of time. using System; using System.Web; using Microsoft.Web.Infrastructure.DynamicModuleHelper; using Ninject; using Ninject.Web.Common; //using Ninject.Extensions.Conventions; using Ninject.Web.WebApi; using Ninject.Web.Mvc; using CommonServiceLocator.NinjectAdapter; using System.Reflection; using System.IO; using LR.Repository; using LR.Repository.Interfaces; using LR.Service.Interfaces; using System.Web.Http; public static class NinjectWebCommon { private static readonly Bootstrapper bootstrapper = new Bootstrapper(); /// <summary> /// Starts the application /// </summary> public static void Start() { DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); bootstrapper.Initialize(CreateKernel); } /// <summary> /// Stops the application. /// </summary> public static void Stop() { bootstrapper.ShutDown(); } /// <summary> /// Creates the kernel that will manage your application. /// </summary> /// <returns>The created kernel.</returns> private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>(); RegisterServices(kernel); return kernel; } /// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { kernel.Bind(scanner => scanner.FromAssembliesInPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) .Select(IsServiceType) .BindToDefaultInterface() .Configure(binding => binding.InSingletonScope()) ); } private static bool IsServiceType(Type type) { // temp return true; // .Any() is not recognized either. return true; // type.IsClass && type.GetInterfaces().Any(intface => intface.Name == "I" + type.Name); }

    Read the article

  • Dev Lop

    - by Jason Franks
    Back in the early 90s, before I was a professional geek--much less a geek with a blog--I saw this old chop socky movie. I don't remember what it was called, or who was in it... all I remember is that, in one scene, the venerable sensei tells the hero: "You must develop your nunchaku technique." This became a bit fo a catchphrase amongst my high school mates. Well folks, I am developing my technuique. This blog has been renamed and the old posts removed--I could go into my reasons for this, but that would defeat the point of the exercise. Sorry if you liked 'em. It has been a good couple of years since I wrote anything here, so I doubt that I am putting out any regular readers. Will I be posting here more often, now that I've renamed and rethemed the place? I don't know. In the meantime, check it out: Bruce Lee playign ping pong with nunchaku. --JF

    Read the article

  • Generating %pc relative address of constant data

    - by Hudson
    Is there a way to have gcc generate %pc relative addresses of constants? Even when the string appears in the text segment, arm-elf-gcc will generate a constant pointer to the data, load the address of the pointer via a %pc relative address and then dereference it. For a variety of reasons, I need to skip the middle step. As an example, this simple function: const char * filename(void) { static const char _filename[] __attribute__((section(".text"))) = "logfile"; return _filename; } generates (when compiled with arm-elf-gcc-4.3.2 -nostdlib -c -O3 -W -Wall logfile.c): 00000000 <filename>: 0: e59f0000 ldr r0, [pc, #0] ; 8 <filename+0x8> 4: e12fff1e bx lr 8: 0000000c .word 0x0000000c 0000000c <_filename.1175>: c: 66676f6c .word 0x66676f6c 10: 00656c69 .word 0x00656c69 I would have expected it to generate something more like: filename: add r0, pc, #0 bx lr _filename.1175: .ascii "logfile\000" The code in question needs to be partially position independent since it will be relocated in memory at load time, but also integrate with code that was not compiled -fPIC, so there is no global offset table. My current work around is to call a non-inline function (which will be done via a %pc relative address) to find the offset from the compiled location in a technique similar to how -fPIC code works: static intptr_t __attribute__((noinline)) find_offset( void ) { uintptr_t pc; asm __volatile__ ( "mov %0, %%pc" : "=&r"(pc) ); return pc - 8 - (uintptr_t) find_offset; } But this technique requires that all data references be fixed up manually, so the filename() function in the above example would become: const char * filename(void) { static const char _filename[] __attribute__((section(".text"))) = "logfile"; return _filename + find_offset(); }

    Read the article

  • Cast object to interface when created via reflection

    - by Al
    I'm trying some stuff out in Android and I'm stuck at when trying to cast a class in another .apk to my interface. I have the interface and various classes in other .apks that implement that interface. I find the other classes using PackageManager's query methods and use Application#createPackageContext() to get the classloader for that context. I then load the class, create a new instance and try to cast it to my interface, which I know it definitely implements. When I try to cast, it throws a class cast exception. I tried various things like loading the interface first, using Class#asSubclass, etc, none of which work. Class#getInterfaces() shows the interface is implemented. My code is below: PackageManager pm = getPackageManager(); List<ResolveInfo> lr = pm.queryIntentServices(new Intent("com.example.some.action"), 0); ArrayList<MyInterface> list = new ArrayList<MyInterface>(); for (ResolveInfo r : lr) { try { Context c = getApplication().createPackageContext(r.serviceInfo.packageName, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE); ClassLoader cl = c.getClassLoader(); String className = r.serviceInfo.name; if (className != null) { try { Class<?> cls = cl.loadClass(className); Object o = cls.newInstance(); if (o instanceof MyInterface) { //fails list.add((MyInterface) o); } } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } // some exceptions removed for readability } } catch (NameNotFoundException e1) { e1.printStackTrace(); }

    Read the article

  • Prototype function to set onclick event observer in checkboxes

    - by xain
    Hi, I want to set an observer for each of the following checkboxes: <div id="listr"> <ul id="lr" style="list-style-type: none"> <p class="tir">Text 1</p> <li class="ro"><input type="checkbox" name="r1" id="r1"/>A1</li> <li class="ro"><input type="checkbox" name="r2" />A2</li> <p class="tir">Text 2</p> <li class="rubro"><input type="checkbox" name="r3" />B1</li> <p class="tir">Text 3</p> <li class="ro"><input type="checkbox" name="r4" />B2</li> </ul> </div> It works if I write one observer per checkbox, but I want to do it in a short fashion, so I need something like $$('listr.lr.li.input').invoke('observe',click,function(field) { alert(this.name + ' clicked ' + this.checked); // other stuff ... }); Which is not working Thanks in advance

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >