Posts

javascript - jquery validation by date on a not required field -

i have been working on of today , feel i'm stumped. i found code validate field mm/dd/yyyy format not required. working 1 field. have multiple date fields not required if have in text field should date formatted mm/dd/yyyy. wish use datepicker client doesn't want it's validating data in text fields. here script i'm using on form: $(function() { $.validator.setdefaults({ errorclass: 'help-block', highlight: function(element) { $(element) .closest('.form-group') .addclass('has-error'); }, unhighlight: function(element) { $(element) .closest('.form-group') .removeclass('has-error'); }, errorplacement: function (error, element) { if (element.prop('type') === 'radio') { error.insertafter(element.parent()); } else { error.insertafter(element); } } }); $.validator.addmethod( "gooddate"...

html - Put a backgound when hover a menu item -

i want create background-color or background-image when hover menu. this part of code. when hover on item c, background color changes behind submenu without jquery. @import "fonts.css"; body { color: #fff; margin: 0px; } .dropdownmenu{ height: 72px; background: #ec008c; } .dropdownmenu ul, .dropdownmenu li { margin: 0; padding: 0; } .dropdownmenu ul { background: gray; list-style: none; width: 100%; } .dropdownmenu li { float: left; position: relative; width:auto; } .dropdownmenu { color: #ffffff; display: block; padding: 24px 24px; font-size: 21px; text-align: center; text-decoration: none; } .menu:hover { background: #fff; color: #ec008c; } #submenu { left: 0; opacity: 0; position: absolute; top: 72px; visibility: hidden; z-index: 1; width: 235px; } li:hover ul#submenu { opacity: 1; visibility: visible; } #submenu li { float: none; width: 100%; ...

PHP: How to retrieve the parent array dimension having child -

i want create function pass parameter array "position", this: function f($pos){}; f($people[all][person][name]); then want retrieve parent dimension of array, want have $people[all] . way foreach cycle on person. my idea function pass position , function sort "parent" dimension position given. common case: $people[men][person][name]=>value f($people[men][person][name]) will sort men name. how that? how function f($pos){ foreach ($people[all][person] $name){ echo $name; } } f($people); this name

linux - Delete all except the most recent n files of each prefix (based on file date)? -

i'm running command in script, , it's deleting 5 of each file, it's not keeping last 5 files based on date: ls -rv | awk -f_ '++n[$1]>5' | xargs rm **underscore delimiter between prefix (hostname) , filenames. i've tried other stuff too, didn't seem trick. i'm running delete last n files in folder , works correctly: rm -f $(ls -1t -i "*.sh" | tail -n +21) this applies though. i have folder full of backups various devices have hostname prefixes. format is: hostname_config.backup-timestamp. @rici solved it. dumping -rv flags , using -t created behavior looking for. ls -t | awk -f_ '++n[$1]>5' | xargs rm

why ~9 returns -10 in Python -

this question has answer here: what '~' mean in python? [duplicate] 5 answers i trying following code , here outputs, have ideas why -10 , -11 returned? thanks. print ~9 print ~10 -10 -11 btw, using python 2.7.8. thanks in advance, lin from: python doc the unary ~ (invert) operator yields bitwise inversion of plain or long integer argument. bitwise inversion of x defined -(x+1). applies integral numbers. from: python doc two's complement binary negative integers: negative numbers written leading 1 instead of leading zero. if using 8 bits twos-complement numbers, treat patterns "00000000" "01111111" whole numbers 0 127, , reserve "1xxxxxxx" writing negative numbers. negative number, -x, written using bit pattern (x-1) of bits complemented (switched 1 0 or 0 1). -1 complement(1 - 1) = complement(0) = ...

xcode - error uploading iOS app to the store -

Image
i'm trying upload app store here get: what i've done before:: 1- removing armv7s plist.info files 2- disabling compile active architecture only any idea please?? based on errors speculate architectures build setting includes architectures other arm64 , specify arm64 required device capability in info.plist. should either remove requirement info.plist or set architectures build setting arm64 .

c# - Visual Studio 2013: Is there a way to set properties like Autosize to true for all Forms on a particular project? -

i'm curious if there easy way set winform property autosize (for example) true every form in project without having manually change every single 1 of them. thanks! create form called baseform , let other forms inherit it. on baseform can set desired font, scaling etc. , other forms inherit these properties. first thing in every windows forms project fire up. you may consider creating basedialog, inheriting baseform. basedialog can have hidden minimize/maximize buttons etc. common modal dialogs in application.