Search Results

Search found 317 results on 13 pages for 'spirit zhang'.

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

  • How to download Vim script on the command-line?

    - by HaiYuan Zhang
    Whenever I want to install a new Vim script on the Linux server I'm working on, my typical workflow is as the following: surf the plugin's homepage in Vim online using FireXXXX download a right version of the plugin to my laptop by click some highlighted link upload the downloaded plugin from my laptop to Linux server using WinSCP which is really inconvenient. I don't know what is the magic behind this: I mean for the same hyperlink I click it in web browser. I can let you download it but use Wget plus the hyperlink in Linux command-line will end up with nothing but an error indication. Hyperlink in the web browser. Otherwise I can get the link in web browser and then use Wget or some similar tool to actually do the downloding. I try new cool Vim scripts quite ofte , so you can imagine my dismay when I have to repeat the tedious action all the time. What are some tips which can let me download the Vim scripts in a more "professional" way? Post edit: My problem is not find a tool like Wget or cURL. The problem I met is quite specific; to use these tools to download a Vim script. Let's take http://www.vim.org/scripts/script.php?script_id=30 as an example. It's the normal place where one can get the script, at least for me. But I can't find an working URL from this page that can feed to Wget.

    Read the article

  • how to download vim script in command line

    - by HaiYuan Zhang
    whenever I want to install a new vim script to the linux server I'm working in , my typical workflow is as the following: surf the plugin's homepage in vim online using fireXXXX download a right version of the plugin to my laptop by click some highlighted link upload the downloaded plugin from my laptop to linux server using winscp which is really inconvenient. I don't know what is the magic behind this : I mean for the same hyperlinki click it in web browser I can let you download it but use wget plus the hyperlink in linux commandline will end up with nothing but error indication. hyperlink in web browser . otherwise I can get the link in web browser and then use wget or some similar tool to actually do the downloding. I try new cool vim scripts quite often , so you can imagin my dismay when have to repeat the tedious action all the time. So if anyone of you knows some tips which can let me downloading the vim scripts in a more "professional" way, I'll appreciate it a lot. post edit : My problem is not find a tool like wget or curl . The problem I met is quite specific to use these tools to download vim script. let's take http://www.vim.org/scripts/script.php?script_id=30 as an example, it's the normal place where one can get the script, at least for me. but I can't find an working url from this page that can feed to wget .

    Read the article

  • How to download Vim script on the command-line?

    - by HaiYuan Zhang
    Whenever I want to install a new Vim script on the Linux server I'm working on, my typical workflow is as the following: surf the plugin's homepage in Vim online using FireXXXX download a right version of the plugin to my laptop by click some highlighted link upload the downloaded plugin from my laptop to Linux server using WinSCP which is really inconvenient. I don't know what is the magic behind this: I mean for the same hyperlink I click it in web browser. I can let you download it but use Wget plus the hyperlink in Linux command-line will end up with nothing but an error indication. Hyperlink in the web browser. Otherwise I can get the link in web browser and then use Wget or some similar tool to actually do the downloding. I try new cool Vim scripts quite ofte , so you can imagine my dismay when I have to repeat the tedious action all the time. What are some tips which can let me download the Vim scripts in a more "professional" way? Post edit: My problem is not find a tool like Wget or cURL. The problem I met is quite specific; to use these tools to download a Vim script. Let's take http://www.vim.org/scripts/script.php?script_id=30 as an example. It's the normal place where one can get the script, at least for me. But I can't find an working URL from this page that can feed to Wget.

    Read the article

  • how to temporarily set makeprg in vim

    - by Haiyuan Zhang
    In the normal case I use vim's make utility I will set makeprg to the Makefile of the project I'm currently working for. Since usually the project will last for weeks or even longer, I don't need to change the setting of makeprg very often . But sometimes I need to write some "foobar" code either for practicing my c++ skill or for prototyping some primitive ideas in my mind. So whenever I switch to the "foobar" mode of vim usage, I need to comments the original makeprg setting add the new setting as following : au FileType c set makeprg=gcc\ % au FileType cpp set makeprg=g++\ % which is really very very inconvenient . when I back to the "normal project mode" of vim usage, I need to change back to the original setting . back and forth .... what I want to know from you guys is that : is it possible to make the setting of makeprg temporarily . for example , define a function in which first set a local value of makeprg and then call make before return form the function call automatically restore makeprg to the value before the function call.

    Read the article

  • jquery dynatree class methods

    - by Jj Zhang
    I'm a new user of dynatree plugin. When I read the documentation, I found the list of tree and node class member functions, such as tree.getRoot(), node.countChildren(). However, when I tried to use them, it complained that no such methods were found. Here is a sample code I am testing with: var tree = ("#test").dynatree(treeData); var rootNode = tree.getRoot(); //not working var rootNode2 = ("#test").dynatree("getRoot"); //this works var numChildren = rootNode2.countChildren(); //not working Help please. Thanks. -JJ

    Read the article

  • Why does my co-worker see a different Project file (*.csproj) using Visual Source Safe

    - by Leo Zhang
    Hello everybody, I met a problem which is very strange, my company uses Visual Source Safe to control version,but I found that my team's different member see the same .csproj file in VSS is not the same, it's very strange,can you help me? thanks!! there is a file named IPRA.WinUi.Sal.Sra.csproj in VSS: when Tom log on ,the file 'IPRA.WinUi.Sal.Sra.csproj' is : <Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath> </Reference> <Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath> </Reference> But when leo log on,the same file 'IPRA.WinUi.Sal.Sra.csproj' is : <Reference Include="Ark.Client.WinUi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Client.WinUi.dll</HintPath> </Reference> <Reference Include="Ark.Common.Business, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\BusinessFramework\Ark.Controls.WinUi.dll</HintPath> <Reference Include="Ark.Controls.Business, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\ARAF\SystemFramework\Ark.Controls.Business.dll</HintPath> </Reference>

    Read the article

  • how to manage a "resource" array efficiently

    - by Haiyuan Zhang
    The senario of my question is that one need to use a fixed size of array to keep track of certain number of "objects" . The object here can be as simply as a integer or as complex as very fancy data structure. And "keep track" here means to allocate one object when other part of the app need one instance of object and recyle it for future allocation when one instance of the object is returned .Finally ,let me use c++ to put my problme in a more descriptive way . #define MAX 65535 /* 65535 just indicate that many items should be handled . performance demanding! */ typedef struct { int item ; }Item_t; Item_t items[MAX] ; class itemManager { private : /* up to you.... */ public : int get() ; /* get one index to a free Item_t in items */ bool put(int index) ; /* recyle one Item_t indicate by one index in items */ } how will you implement the two public functions of itemManager ? it's up to you to add any private member .

    Read the article

  • How to drag item out from Iframe and drop onto parent

    - by ethan.zhang
    Hi, I have a folder tree view on the left page which was in a tag, left page was the iframe container which contain the file list, when I want to drag the files out from the iframe, I got a headache. no matter the containment option was set to 'parent' or 'window', I just can't drag out elements in the iframe container can any one help on this?

    Read the article

  • push_back of STL list got bad performance?

    - by Leon Zhang
    I wrote a simple program to test STL list performance against a simple C list-like data structure. It shows bad performance at "push_back()" line. Any comments on it? $ ./test2 Build the type list : time consumed -> 0.311465 Iterate over all items: time consumed -> 0.00898 Build the simple C List: time consumed -> 0.020275 Iterate over all items: time consumed -> 0.008755 The source code is: #include <stdexcept> #include "high_resolution_timer.hpp" #include <list> #include <algorithm> #include <iostream> #define TESTNUM 1000000 /* The test struct */ struct MyType { int num; }; /* * C++ STL::list Test */ typedef struct MyType* mytype_t; void myfunction(mytype_t t) { } int test_stl_list() { std::list<mytype_t> mylist; util::high_resolution_timer t; /* * Build the type list */ t.restart(); for(int i = 0; i < TESTNUM; i++) { mytype_t aItem = (mytype_t) malloc(sizeof(struct MyType)); if(aItem == NULL) { printf("Error: while malloc\n"); return -1; } aItem->num = i; mylist.push_back(aItem); } std::cout << " Build the type list : time consumed -> " << t.elapsed() << std::endl; /* * Iterate over all item */ t.restart(); std::for_each(mylist.begin(), mylist.end(), myfunction); std::cout << " Iterate over all items: time consumed -> " << t.elapsed() << std::endl; return 0; } /* * a simple C list */ struct MyCList; struct MyCList{ struct MyType m; struct MyCList* p_next; }; int test_simple_c_list() { struct MyCList* p_list_head = NULL; util::high_resolution_timer t; /* * Build it */ t.restart(); struct MyCList* p_new_item = NULL; for(int i = 0; i < TESTNUM; i++) { p_new_item = (struct MyCList*) malloc(sizeof(struct MyCList)); if(p_new_item == NULL) { printf("ERROR : while malloc\n"); return -1; } p_new_item->m.num = i; p_new_item->p_next = p_list_head; p_list_head = p_new_item; } std::cout << " Build the simple C List: time consumed -> " << t.elapsed() << std::endl; /* * Iterate all items */ t.restart(); p_new_item = p_list_head; while(p_new_item->p_next != NULL) { p_new_item = p_new_item->p_next; } std::cout << " Iterate over all items: time consumed -> " << t.elapsed() << std::endl; return 0; } int main(int argc, char** argv) { if(test_stl_list() != 0) { printf("ERROR: error at testcase1\n"); return -1; } if(test_simple_c_list() != 0) { printf("ERROR: error at testcase2\n"); return -1; } return 0; }

    Read the article

  • why can't I comment lines in visual mode

    - by Haiyuan Zhang
    I want to comment several lines in my .vimrc, the usual way I do it is :x,ys/^/"/ and x stands for the start line number and y stands for the line number of the last line. I read some post which said in visual mode this task can be done by the following step: 1 Select your lines with VISUAL BLOCK 2 press I to insert before all highlighted lines. 3 type your comment charact , in this case should be " 4 then ESC I fllowed the above steps and met met problems in step 2 . the thing is when I select the lines in Visual mode and press I , vim ( I use version7.2) go back to insert mode and the cursor back to the start of the first line. so if you continue to do the step 3 and step 4, you end up in just inserting " at the start the first line , far from what I want to achieve. so could you point out what's wrong with the recipe ? thanks in advance

    Read the article

  • how to manage vim plugin

    - by Haiyuan Zhang
    I want to know how do you manage your vim plugins. As it is, One of the biggest fun of using is that one can easily try many interesing new plugins, just download it and unzip it in under ~/.vim. But if you try too often and try too much, you might get trouble as confilct of key mapping , in compatitble script version, dpendency between different plugin ..... Then you want to remove some plugin ,kind of like rollback your vim to a sound condition. But, the rollback could be very painful . cus for some "giant" plugin, like perl-support ( it's great plugin, anyway), will consist of many vim scripts which spread in different dirctories. To remove single one giant plugin will be anoying, not too mention if you remvoe many plugin at one time. In a word , I'm looking for good practice for managing vim plugins.

    Read the article

  • how to bind a link local address to an ipv6 socket

    - by Haiyuan Zhang
    This thread can be treated as a sister thread of this. It's will be very tedious that when you want to bind a link local adress to a ipv6 socket you need to the set sin6_scope_id field of sockaddr_in6 struct as well. I'm wondering if someone can provide a good practise like solution here for me or anyone who interested in this topic to learn from.

    Read the article

  • How to update the original InfoPath form from within Workflow?

    - by Allen.Zhang
    Hi All, I have created an InfoPath form (e.g. Form_ExpenseReport) for collect data from end users, and a number of task forms (also InfoPath form, e.g. TaskForm_1, TaskForm_2) for my state machine workflow use. The users want to see all the comments of Task forms (TaskForm_1 & TaskForm_2) in the original IP form (Form_ExpenseReport). How can I update the first form from within workflow? Can anybody give me some tips? My environment: MOSS 2007 Enterprise license VS 2008

    Read the article

  • can't create socket using IO::Socket

    - by Haiyuan Zhang
    when I run the following code, the execution is just hanging there, No response at all. does any of you can tell me what's wrong with the sample code? use strict; use warnings; use IO::Select; use IO::Socket; my $s = new IO::Socket ( LocalPort => 8889, Proto => 'tcp', Listen => 16, Reuse => 1 ); die "could not create socket $!\n" unless $s;

    Read the article

  • how to handle "unknown error" in perl module compilation

    - by Haiyuan Zhang
    when I try to use a "third part module" in my perl script, I got some error message like "unknown error, compilation failed in require at ... line xxx" nothing else and the line mentioned in the error message is exact the same line I "use the module"... my question is: are there any good practice to handle this situation? like a list to check or something else. thanks in advance.

    Read the article

  • Is it possible ot mix named pipe with select in perl

    - by Haiyuan Zhang
    I need to write a daemon that supposed to have one TCP socket and one named pipe. Usually if I need to implement a multi IO server with "pure" sockets, the select based multi-IO model is always the one I will choose. so does anyone of you have ever used named pipe in select or you can just tell me it is impossible. thanks in advance.

    Read the article

  • Initialize a static member ( an array) in C++

    - by Jimmy zhang
    I intended to create a class which only have static members and static functions. One of the member variable is an array. Would it be possible to initialize it without using constructors? I am having lots of linking errors right now... Class A{ public: static char a[128]; static void do_something(); } How would you initialize a[128]? Why can't I initialize a[128] by directly specifying its value like in C? a[128={1,2,3,...};

    Read the article

  • approximating log10[x^k0 + k1]

    - by Yale Zhang
    Greetings. I'm trying to approximate the function Log10[x^k0 + k1], where .21 < k0 < 21, 0 < k1 < ~2000, and x is integer < 2^14. k0 & k1 are constant. For practical purposes, you can assume k0 = 2.12, k1 = 2660. The desired accuracy is 5*10^-4 relative error. This function is virtually identical to Log[x], except near 0, where it differs a lot. I already have came up with a SIMD implementation that is ~1.15x faster than a simple lookup table, but would like to improve it if possible, which I think is very hard due to lack of efficient instructions. My SIMD implementation uses 16bit fixed point arithmetic to evaluate a 3rd degree polynomial (I use least squares fit). The polynomial uses different coefficients for different input ranges. There are 8 ranges, and range i spans (64)2^i to (64)2^(i + 1). The rational behind this is the derivatives of Log[x] drop rapidly with x, meaning a polynomial will fit it more accurately since polynomials are an exact fit for functions that have a derivative of 0 beyond a certain order. SIMD table lookups are done very efficiently with a single _mm_shuffle_epi8(). I use SSE's float to int conversion to get the exponent and significand used for the fixed point approximation. I also software pipelined the loop to get ~1.25x speedup, so further code optimizations are probably unlikely. What I'm asking is if there's a more efficient approximation at a higher level? For example: Can this function be decomposed into functions with a limited domain like log2((2^x) * significand) = x + log2(significand) hence eliminating the need to deal with different ranges (table lookups). The main problem I think is adding the k1 term kills all those nice log properties that we know and love, making it not possible. Or is it? Iterative method? don't think so because the Newton method for log[x] is already a complicated expression Exploiting locality of neighboring pixels? - if the range of the 8 inputs fall in the same approximation range, then I can look up a single coefficient, instead of looking up separate coefficients for each element. Thus, I can use this as a fast common case, and use a slower, general code path when it isn't. But for my data, the range needs to be ~2000 before this property hold 70% of the time, which doesn't seem to make this method competitive. Please, give me some opinion, especially if you're an applied mathematician, even if you say it can't be done. Thanks.

    Read the article

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