Search Results

Search found 45031 results on 1802 pages for 'same name'.

Page 89/1802 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • Cast into new Object, Copy values by Property Name

    - by Alex
    Hello, I have the following: Class 1 (Text, State, Level) Class 2 (Text, State, Level, Ident) Is there a way for me to cast an object of Class 2 into into Class 1, and not having to do the usual cast code (Text = c.Text, State = c.State etc.)? Possibly by identifying the property names of each class and copying the value over?

    Read the article

  • Pass javascript array to php by using curly braces key name

    - by user7031
    My js code: $(function(){ var arr = new Array('jj', 'kk', 'oo'); $.post('test12.php', {'arr[]': arr}, function(data){ alert(data); }); }); PHP code: <?php echo print_r($_POST['arr']); The thing is,$.post receive a key named 'arr[]',it should be used in PHP as 'arr[]' instead of 'arr',but '$_POST['arr[]']' doesn't work,'arr' works.Which seems that Jquery might do something with curly braces '[]' before sending something to PHP. Secondly,when I remove the single quotas around 'arr[]',PHP can not receive anything by using $_POST['arr'];,I don't know why? Doing this task in a traditional way with no curly braces: $.post('test12.php', {arr: arr}, function(data){ alert(data); }); It works fine. So when sending javascript array to PHP,why bothering using single quote and curly braces like 'arr[]' instead of using a concise way like arr:arr My return result is Array( [0]=>jj [1]=>kk [2]=>oo ) 1 Notice there is a 1 under the array,why?

    Read the article

  • ASP.NET MVC partial view and form action name

    - by Dmitriy Shvadskiy
    How do I create a partial view that has a form with assigned id? I got as far as: using (Html.BeginForm(?action?,"Candidate",FormMethod.Post,new {id="blah"})) Partial view is used for both Create and Edit so first parameter ?action? will be different. I can't figure out what value of ?action? supposed to be

    Read the article

  • Find images that have a certain HTML class name

    - by Frederik Vig
    I have some markup that contains certain HTML image tags with the class featured. What I need is to find all those images, add an anchor tag around the image, set the href attribute of the anchor to the images src value (the image path), and lastly replace the images src value with a new value (I call a method that will return this value). <p>Some text here <img src="/my/path/image.png" alt="image description" class="featured" />. Some more text and another image that should not be modified <img src="/my/path/image2.png" alt="image description" /></p> Should become. <p>Some text here <a href="/my/path/image.png"><img src="/new/path/from/method.png" alt="image description" class="featured" /></a>. Some more text and another image that should not be modified <img src="/my/path/image2.png" alt="image description" /></p>

    Read the article

  • Bash - Adding 0's in the middle of a file name

    - by user596691
    I have a bunch of files which are named: mem0.csv mem1.csv . . . . mem153.csv . . . They are all in the same folder. When I do ls in the folder they appear in an order of mem0.csv mem1.csv mem10.csv mem100.csv . . . mem2.csv mem20.csv . . . I want to create a bash script to push 0's between mem and the number. I figure that I need to add 0's until all the filenames are of the same length only problem is that I don't know how to do this.

    Read the article

  • Sql Get months Name between two dates in a table

    - by user2219210
    My Table column (ID , startDate , EndDate ) I need to use this way with every row of the table : not with a specific value like : declare @start DATE = '2011-05-30' declare @end DATE = '2011-06-10' ;with months (date) AS ( SELECT @start UNION ALL SELECT DATEADD(month,1,date) from months where DATEADD(month,1,date)<= DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@end)+1,0)) ) select Datename(month,date) from months it possible ??

    Read the article

  • Cannot get Request.Form by name in ASP.NET

    - by Nissan Fan
    I have an ASP.NET page which utilizes jQuery for an autocomplete-type scenario. The jQuery tucks the actual selected values into a hidden field it creates on the fly, but for some reason I cannot get the value of that standard HTML field on postback by calling Request.Form["HiddenFieldName"]. I can see it by ordinal in the Request.Form object, but if I add/remove controls it will break. Any suggestions?

    Read the article

  • How to import a module from PyPI when I have another module with the same name

    - by kuzzooroo
    I'm trying to use the lockfile module from PyPI. I do my development within Spyder. After installing the module from PyPI, I can't import it by doing import lockfile. I end up importing anaconda/lib/python2.7/site-packages/spyderlib/utils/external/lockfile.py instead. Spyder seems to want to have the spyderlib/utils/external directory at the beginning of sys.path, or at least none of the polite ways I can find to add my other paths get me in front of spyderlib/utils/external. I'm using python2.7 but with from __future__ import absolute_import. Here's what I've already tried: Writing code that modifies sys.path before running import lockfile. This works, but it can't be the correct way of doing things. Circumventing the normal mechanics of importing in Python using the imp module (I haven't gotten this to work yet, but I'm guessing it could be made to work) Installing the package with something like pip install --install-option="--prefix=modules_with_name_collisions" package_name. I haven't gotten this to work yet either, but I'm guess it could be made to work. It looks like this option is intended to create an entirely separate lib tree, which is more than I need. Source Using pip install --target=lockfile_from_pip. The files show up in the directory where I tell them to go, but import doesn't find them. And in fact pip uninstall can't find them either. I get Cannot uninstall requirement lockfile-from-pip, not installed and I guess I will just delete the directories and hope that's clean. Source So what's the preferred way for me to get access to the PyPI lockfile module?

    Read the article

  • Validate/accept only emails from a specific domain name

    - by user1632736
    This is part of my jQuery script. I need to make the system validate emails for a specific domain. like [email protected] And only allow emails from @schooldomain.com Code: email: function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);}

    Read the article

  • Directory name "cache" in IIS 5.

    - by Chuck Conway
    In IIS 5 one of the directories off the root has a leading underscore. All files under the directory are unreachable (404) from the browser. I have verified that the paths are correct. Other javascript files outside the directory comedown fine. Any thoughts? Example: http://fm74g4rndmu02.corp.com/_cache/softwarecommunity/api.js

    Read the article

  • Is there any difference between var name = function() {} & function name() {} in Javascript?

    - by Fletcher Moore
    Suppose we are inside a function and not in the global namespace. function someGlobalFunction() { var utilFunction1 = function() { } function utilFunction2 () { } utilFunction1(); utilFunction2(); } Are these synonymous? And do these functions completely cease to exist when someGlobalFunction returns? Should I prefer one or the other for readability or some other reason?

    Read the article

  • sed script to remove file name duplicates

    - by dma_k
    Dear community, I hope the below task will be very easy for sed lovers. I am not sed-guru, but I need to express the following task in sed, as sed is more popular on Linux systems. The input text stream is something which is produced by "make depends" and looks like following: pgm2asc.o: pgm2asc.c ../include/config.h amiga.h list.h pgm2asc.h pnm.h \ output.h gocr.h unicode.h ocr1.h ocr0.h otsu.h barcode.h progress.h box.o: box.c gocr.h pnm.h ../include/config.h unicode.h list.h pgm2asc.h \ output.h database.o: database.c gocr.h pnm.h ../include/config.h unicode.h list.h \ pgm2asc.h output.h detect.o: detect.c pgm2asc.h pnm.h ../include/config.h output.h gocr.h \ unicode.h list.h I need to catch only C++ header files (i.e. ending with .h), make the list unique and print as space-separated list prepending src/ as a path-prefix. This is achieved by the following perl script: make libs-depends | perl -e 'while (<>) { while (/ ([\w\.\/]+?\.h)/g) { $a{$1} = 1; } } print join " ", map { "src/$_" } keys %a;' The output is: src/unicode.h src/pnm.h src/progress.h src/amiga.h src/ocr0.h src/ocr1.h src/otsu.h src/barcode.h src/gocr.h src/../include/config.h src/list.h src/pgm2asc.h src/output.h Please, help to express this in sed.

    Read the article

  • has_many :through name suggestions

    - by user1084769
    I have three models, user, achievement, badge and I plan on using has_many :through instead of has_many_and_belongs_to since I will have a few extra fields in the join tables. According to a Railscast I watched, using this method requires coming up with new model names and not user_badge or user_achievement. For my User Achievement join what do you think of Accomplishment? For my User Badge join what do you think of Distinction?

    Read the article

  • Caliburn.micro View ViewModel name resolution issue

    - by user1459773
    I am using a namespace called ComShorCaliburnWPF.ViewModules.Views.ShortMenuWindows.GWDSCT on my View.xaml and View.cs, for my ViewModel.cs and my IoC container I am using ComShorCaliburnWPF.ViewModules.Views.ShortMenuWindows.GWDSCT. When I remove the GWDSCT at the end it works fine, but in its current state it does not. I would like it to work how it is now because it accurately reflects where the files are located. Any suggestions?

    Read the article

  • Python package name conventions

    - by deamon
    Is there a package naming convention for Python like Java's com.company.actualpackage? Most of the time I see simple, potentially colliding package names like "web". If there is no such convention, is there a reason for it? What do you think of using the Java naming convention in the Python world?

    Read the article

  • Useless variable name in C struct type definition

    - by user1210233
    I'm implementing a linked list in C. Here's a struct that I made, which represents the linked list: typedef struct llist { struct lnode* head; /* Head pointer either points to a node with data or NULL */ struct lnode* tail; /* Tail pointer either points to a node with data or NULL */ unsigned int size; /* Size of the linked list */ } list; Isn't the "llist" basically useless. When a client uses this library and makes a new linked list, he would have the following declaration: list myList; So typing llist just before the opening brace is practically useless, right? The following code basically does the same job: typedef struct { struct lnode* head; /* Head pointer either points to a node with data or NULL */ struct lnode* tail; /* Tail pointer either points to a node with data or NULL */ unsigned int size; /* Size of the linked list */ } list;

    Read the article

  • Replace an element name while retaining the attributes with jquery

    - by geckomist
    I'm trying to create a jquery setup where all instances of <i> are changed to <em>. It's easy enough to do with: $("i").each(function(){ $(this).replaceWith($('<em>' + this.innerHTML + '</em>')); }); But what I am having trouble figuring out is how to change all the <i> tags but retain each ones individual attributes. So if I have <i style="background-color: #333;" alt="Example" title="Example">Example Text</i> I would like it to change to <em style="background-color: #333;" alt="Example" title="Example">Example Text</em> Thanks for any help!

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >