Search Results

Search found 259 results on 11 pages for 'nam g vu'.

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

  • How do I add a click handler to a new element when I create it? [closed]

    - by vicky
    How do I add a click handler to a new element when I create it? This is what I have tried, but it does not work as expected: DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': SayHi(this) })); document.body.appendChild(DeCheBX); DeImg = $('MyDiv').insert(new Element('img', { 'id': "Imgx" + obj[i].Nam, 'src': obj[i].IM })); document.body.appendChild(DeImg); } SayHi = function (x) { try { if ($(x).checked == true) { alert("press" + x); } } catch (e) { alert("error");

    Read the article

  • How to import a macro file (previously exported as .bas file) to Microsoft Word using command line?

    - by Nam Gi VU
    I'm writing a command-line program that has a step in which I need to replace text in a Word file. The replacing task is accomplished using Word macro. What I need to do now is to call this macro from command-line. At the moment we can do this by using the -mMacroName parameter of 'winword.exe', i.e. \winword.exe -mMacroName. But this need the macro to be already available as a global macro. Since I need to run the program on another computer, I need to import the above replacing macro programatically... and I don't know how to do this. Please help.

    Read the article

  • How to use multifieldquery and filters in Lucene.net

    - by Khotu Nam
    I want to perform a multi field search on a lucene.net index but filter the results based on one of the fields. Here's what I'm currently doing: To index the fields the definitions are: doc.Add(new Field("id", id.ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.Add(new Field("title", title, Field.Store.NO, Field.Index.TOKENIZED)); doc.Add(new Field("summary", summary, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.YES)); doc.Add(new Field("description", description, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.YES)); doc.Add(new Field("distribution", distribution, Field.Store.NO, Field.Index.UN_TOKENIZED)); When I perform the search I do the following: MultiFieldQueryParser parser = new MultiFieldQueryParser(new string[]{"title", "summary", "description"}, analyzer); parser.SetDefaultOperator(QueryParser.Operator.AND); Query query = parser.Parse(text); BooleanQuery bq = new BooleanQuery(); TermQuery tq = new TermQuery(new Term("distribution", distribution)); bq.Add(tq, BooleanClause.Occur.MUST); Filter filter = new QueryFilter(bq); Hits hits = searcher.Search(query, filter); However, the result is always 0 hits. What am I doing wrong?

    Read the article

  • How to get import custom tasks more than once without warning message?

    - by Nam Gi VU
    I'm using some custom tasks from MSBuild Extension Pack (MEP). My projects are splitted among many files. In those files I import the MEP tasks using (twice or three times in two/three files). I receive the warning message when doing this like: ... warning MSB4011: "C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.tasks" cannot be imported again. It was already imported at "D:...\Tasker.proj (5,3)". This is most likely a build authoring error. This subsequent import will be ignored. Does anyone know how to get rid of this warning message? Please help!

    Read the article

  • When does Visual Studio call target AfterBuild & BeforeBuild? And how is it handled when these targe

    - by Nam Gi VU
    Hi Fiburt, Today I meet a similar problem and it reminds me about this thread. In Visual Studio, if we open the .csproj file, we see that they tell us to uncomment the two targets AfterBuild and BeforeBuild so as to execute them after and before the build of the current project accordingly. My questions are: Where are these two targets called in Visual Studio? And how is it handled if the targets are not defined (be commented out) ?

    Read the article

  • how to create run time element? where i am doin wrong help....help.....

    - by vicky
    new Ajax.Request('Handler.ashx', { method: 'get', onSuccess: function(transport) { var response = transport.responseText || "no response text"; //alert("Success! \n\n" + response); var obj = response.evalJSON(true); alert(obj[0].Nam); alert(obj[0].IM); for(i = 0; i < 4; i++) { $('MyDiv').insert( new Element('checkbox', { 'id': "Img" + obj[i].Nam, 'value': obj[i].IM }) ); return ($('MyDiv').innerHTML); } }, onFailure: function() { alert('Something went wrong...') } });

    Read the article

  • WebKitErrorDomain error 101

    - by Nam Young-jun
    The following code produces and error of: WebKitErrorDomain error 101 code: -(Void) searchBarSearchButtonClicked: (UISearchBar *) activeSearchBar { NSString * query = [searchBar.text stringByReplacingOccurrencesOfString: @ "" withString: @ "+"]; NSURL * url = [NSURL URLWithString: [NSString stringWithFormat: @ "http://http://www.google.com/search?q =%, query]]; NSURLRequest * requestObj = [NSURLRequest requestWithURL: url]; [Home loadRequest: requestObj]; } -(Void) loadView { [Super loadView]; CGRect bounds = [[UIScreen mainScreen] applicationFrame]; searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake (0.0, 0.0, bounds.size.width, 48.0)]; searchBar.delegate = self; [Self.view addSubview: searchBar]; } I don't speak english and rely on a translator. Because of the language issue could this be a keyboard problem, or an encoding problem?

    Read the article

  • How to execute statements in order in objective c

    - by Vu Tu?n Anh
    When i tap on my button, my function was called [myBtn addTarget:self action:@selector(myFunction) forControlEvents:UIControlEventTouchUpInside]; In my function, a collection of complex statement will be executed and take a litte bit time to run, so i want to show Loading (UIActivityIndicatorView) as the following: -(void) addTradeAction { //Show Loading [SharedAppDelegate showLoading]; //disable user interaction self.view.userInteractionEnabled = NO; //execute call webservice in here - may be take 10s //Hide Loading [ShareAppDelegate hideLoading]; } When tap on myBtn (my Button) - after 3s or 4s, [ShareAppDelegate showLoading] was called. It is unusual when i use [ShareAppDelegate showLoading] on other Function, - it work very nice, i mean all the statement be executed in order. All i want, when i tap on My Button, Loading will be called immediatelly. Tks in advance

    Read the article

  • The submitHandler is not binded to the form after loading. why?

    - by Alex
    $(".normalform").click( function() { var hrf = $(this).attr("href"); var typ = $(this).attr("frm_type"); var cls = $(this).attr("class"); var nam = $(this).attr("frm_nam"); var url = $(this).attr("url"); //alert("href:"+hrf+", "+"type:"+typ+", "+"class:"+cls+", "+"name:"+nam+", "+"url:"+url+", "); $("#contentContainer").load(url, null, function() { //start validate : normalform jQuery("#normalform").validate({ submitHandler: function(form) { $('#submitbutton').attr('disabled', 'disabled'); jQuery("#normalform").ajaxSubmit({ target: "#result", error: function () { $('#submitbutton').removeAttr('disabled'); alert('Submission Error ! Try again.'); }, success: function (data) { $('#submitbutton').removeAttr('disabled'); }, clearForm: true }); } }); //end validate : normalform }); });

    Read the article

  • std::vector optimisation required

    - by marcp
    I've written a routine that uses std::vector<double> rather heavily. It runs rather slowly and AQTime seems to imply that I am constructing mountains of vectors but I'm not sure why I would be. For some context, my sample run iterates 10 times. Each iteration copies 3 c arrays of ~400 points into vectors and creates 3 new same sized vectors for output. Each output point might be the result of summing up to 20 points from 2 of the input vectors, which works out to a worst case of 10*400*3*2*20 = 480,000 dereferences. Incredibly the profiler indicates that some of the std:: methods are being called 46 MILLION times. I suspect I'm doing something wrong! Some code: vector<double>gdbChannel::GetVector() { if (fHaveDoubleData & (fLength > 0)) { double * pD = getDoublePointer(); vector<double>v(pD, pD + fLength); return v; } else { throw(Exception("attempt to retrieve vector on empty line")); ; } } void gdbChannel::SaveVector(GX_HANDLE _hLine, const vector<double> & V) { if (hLine != _hLine) { GetLine(_hLine, V.size(), true); } GX_DOUBLE * pData = getDoublePointer(); memcpy(pData, &V[0], V.size()*sizeof(V[0])); ReplaceData(); } ///This routine gets called 10 times bool SpecRatio::DoWork(GX_HANDLE_PTR pLine) { if (!(hKin.GetLine(*pLine, true) && hUin.GetLine(*pLine, true) && hTHin.GetLine(*pLine, true))) { return true; } vector<double>vK = hKin.GetVector(); vector<double>vU = hUin.GetVector(); vector<double>vTh = hTHin.GetVector(); if ((vK.size() == 0) || (vU.size() == 0) || (vTh.size() == 0)) { return true; } ///TODO: confirm all vectors the same lenghth len = vK.size(); vUK.clear(); // these 3 vectors are declared as private class members vUTh.clear(); vThK.clear(); vUK.reserve(len); vUTh.reserve(len); vThK.reserve(len); // TODO: ensure everything is same fidincr, fidstart and length for (int i = 0; i < len; i++) { if (vK.at(i) < MinK) { vUK.push_back(rDUMMY); vUTh.push_back(rDUMMY); vThK.push_back(rDUMMY); } else { vUK.push_back(RatioPoint(vU, vK, i, UMin, KMin)); vUTh.push_back(RatioPoint(vU, vTh, i, UMin, ThMin)); vThK.push_back(RatioPoint(vTh, vK, i, ThMin, KMin)); } } hUKout.setFidParams(hKin); hUKout.SaveVector(*pLine, vUK); hUTHout.setFidParams(hKin); hUTHout.SaveVector(*pLine, vUTh); hTHKout.setFidParams(hKin); hTHKout.SaveVector(*pLine, vThK); return TestError(); } double SpecRatio::VValue(vector<double>V, int Index) { double result; if ((Index < 0) || (Index >= len)) { result = 0; } else { try { result = V.at(Index); if (OasisUtils::isDummy(result)) { result = 0; } } catch (out_of_range) { result = 0; } } return result; } double SpecRatio::RatioPoint(vector<double>Num, vector<double>Denom, int Index, double NumMin, double DenomMin) { double num = VValue(Num, Index); double denom = VValue(Denom, Index); int s = 0; // Search equalled 10 in this case while (((num < NumMin) || (denom < DenomMin)) && (s < Search)) { num += VValue(Num, Index - s) + VValue(Num, Index + s); denom += VValue(Denom, Index - s) + VValue(Denom, Index + s); s++; } if ((num < NumMin) || (denom < DenomMin)) { return rDUMMY; } else { return num / denom; } } The top AQTime offenders are: std::_Uninit_copy , double *, std::allocator 3.65 secs and 115731 Hits std::_Construct 1.69 secs and 46450637 Hits std::_Vector_const_iterator ::operator !=1.66 secs and 46566395 Hits and so on... std::allocator<double>::construct, operator new, std::_Vector_const_iterator<double, std::allocator<double> >::operator ++, std::_Vector_const_iterator<double, std::allocator<double> >::operator * std::_Vector_const_iterator<double, std::allocator<double> >::operator == each get called over 46 million times. I'm obviously doing something wrong to cause all these objects to be created. Can anyone see my error(s)?

    Read the article

  • How to record user interaction in Flash app?

    - by Trung Vu
    I am looking for a way to capture the user interactions with a text input control in Flash over a period of time (not a screen cast)? For example: If the user enter some text, then delete, then enter something, I would be able to store that interaction as it happens and replay that later. Any help would be extremely useful Thanks

    Read the article

  • How to create copying items from property values?

    - by Nam Gi VU
    Let's say I have a list of sub paths such as <PropertyGroup> <subPaths>$(path1)\**\*; $(path2)\**\*; $(path3)\file3.txt; </subPaths> </PropertyGroup> I want to copy these files from folder A to folder B (surely we already have all the sub folders/files in A). What I try was: <Target Name="Replace" DependsOnTargets="Replace_Init; Replace_Copy1Path"> </Target> <Target Name="Replace_Init"> <PropertyGroup> <subPaths>$(path1)\**\*; $(path2)\**\*; $(path3)\file3.txt; </subPaths> </PropertyGroup> <ItemGroup> <subPathItems Include="$(subPathFiles.Split(';'))" /> </ItemGroup> </Target> <Target Name="Replace_Copy1Path" Outputs="%(subPathItems.Identity)"> <PropertyGroup> <src>$(folderA)\%(subPathItems.Identity)</src> <dest>$(folderB)\%(subPathItems.Identity)</dest> </PropertyGroup> <Copy SourceFiles="$(src)" DestinationFiles="$(dest)" /> </Target> But the Copy task didn't work. It doesn't translate the *** to files. What did I do wrong? Please help!

    Read the article

  • A linq join combined with a regex

    - by Geert Beckx
    Is it possible to combine these 2 queries or would this make my code too complex? Also I think there should be a performance gain by combining these queries since I think in the near future my source table could be over 11000 records. This is what i came up with so far : Dim lit As LiteralControl ' check characters not in alphabet Dim r As New Regex("^[^a-zA-Z]+") Dim query = From o In source.ToTable _ Where r.IsMatch(o.Field(Of String)("nam")) lit = New LiteralControl(String.Format("letter: {0}, count: {1}<br />", "0-9", query.Count)) plhAlpabetLinks.Controls.Add(lit) Dim q = From l In "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToLower.ToCharArray _ Group Join o In source.ToTable _ On l Equals o.Field(Of String)("nam").ToLowerInvariant(0) Into g = Group _ Select l, g.Count ' iterate the alphabet to generate all the links. For Each letter In q.AsEnumerable lit = New LiteralControl(String.Format("letter: {0}, count: {1}<br />", letter.l, letter.Count)) plhAlpabetLinks.Controls.Add(lit) Next Kind regards, G.

    Read the article

  • how to hide the image? how can i do ?

    - by user309381
    function Psend() { new Ajax.Request('Handler.ashx', { method: 'get', onSuccess: function(transport) { var response = transport.responseText || "no response text"; //alert("Success! \n\n" + response); var obj = response.evalJSON(true); for (i = 0; i < 4; i++) { DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this)' })); DeImg = $('MyDiv').insert(new Element('img', { 'id': "img" + obj[i].Nam, 'src': obj[i].IM, 'style': 'display = inline', 'onClick': 'Say(this)' })); document.body.appendChild(DeCheBX); document.body.appendChild(DeImg); } }, onFailure: function() { alert('Something went wrong...') } }); SayHi = function(x) { if ($(x).checked == true) { // $('id').hide(); **$('img'+i).style.visibility = "hidden";**// doesnt work } };

    Read the article

  • mvc bind/post boolean to radiobutton

    - by Xuan Vu
    Hi all, I have a column in my Model with a NULLABLE boolean value. Now on my View (for editing), I would like to bind that to two radiobuttons: Yes & No. If the value is null, then just have the two radiobutton un-checked. How would I go to do that? Thanks.

    Read the article

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