Posts

jquery - Toggle Checkbox if element has class -

i ahve list elements, class 'added' if clicked. element shall transferred form. therefore have made list of checkboxes, have same classes 'li' list. i wrote jquery script, shall check, if 'li' clicked (hasclass) , proper checkbox should have attribute 'checked'. not working properly. don't know have made wrong... html: <div class="container"> <div class="row row-centered konf-wrapper-1"> <div class="col-md-4 label-wrap"> <h1 class="header-label">konzeption</h1> <ul class="li-wrap"> <li class="added haken">kommunikationsstrategie</li> <li class="0 hide-me add-btn point">zielgruppendefinition</li> </ul> ...

ios - How to check if device orientation is landscape left or right in swift? -

if uideviceorientationislandscape(uidevice.currentdevice().orientation) { print("landscape") } if uideviceorientationisportrait(uidevice.currentdevice().orientation){ print("portrait") } how can check if it's landscape left or right? you can like, if uidevice.currentdevice().orientation == uideviceorientation.landscapeleft{ } else if uidevice.currentdevice().orientation == uideviceorientation.landscaperight{ } else if uidevice.currentdevice().orientation == uideviceorientation.uideviceorientationportraitupsidedown{ } else if uidevice.currentdevice().orientation == uideviceorientation.uideviceorientationportrait{ } swift 3 if uidevice.current.orientation == uideviceorientation.landscapeleft { } else if uidevice.current.orientation == uideviceorientation.landscaperight { } else if uidevice.current.orientation == uideviceorientation.portrait { } else if uidevice.current.orientation == uideviceorientati...

C++ DLL Not running on Windows XP when built with Windows 7 -

Image
i'm total newb c++ needed add methods existing c++ dll. dll built visual studio 2008 , worked on windows 7 , windows xp. after added methods , built dll again still worked on windows 7 not on xp. call dll java , following exception: after searching around on bit found dependency walker shows me this: the command line options compiling are /gs /analyze- /w3 /gy /zc:wchar_t /zi /gm- /o2 /ob1 /fd".\release/" /zc:inline /fp:precise /d "win32" /d "ndebug" /d "_windows" /d "_usrdll" /d "ntprocessdll_exports" /d "_vc80_upgrade=0x0600" /d "_using_v110_sdk71_" /d "_windll" /d "_mbcs" /errorreport:prompt /gf /wx- /zc:forscope /gd /oy- /mt /fa".\release/" /ehsc /nologo /fo".\release/" /fp".\release/ntprocessdll.pch" and linker command is /out:".\release\ntprocessdll.dll" /manifest /pdb:".\release/ntprocessdll.pdb" /dynamicbase:...

Regex in javascript - should not allow consecutive parenthesis , consecutive + sign and consecutive -sign -

i need validate phone number can any format . should not allow consecutive hyphens, parenthesis , + signs. in addition no special characters , alphabets should not allowed. not @ regex. allowed be: single -, ( , ), (), + , spaces. i have tried following regex (?!-)(?!.*--)(([0-9-,(),+]{0,25})) through able restrict consecutive hyphens. can on this? eg: +765766-8776(090) --> valid format 7-(98665 --> valid 123456789098880998 --> valid 85786 87787 --> valid +165667687777878(989)--> valid +1 97877-88888 (090) --> valid ----()90 --> invalid consecutive hyphens ffgffgtgf98- --> invalid characters there #$%%5 --> invalid special characters there +++++++++898988++++++++76768 -->invalid consecutive plus sign 989(((090)))) -->invalid consecutive parenthesis /^(?:(?:([-()+ ])(?!\1))|\d)+$/ start of string either of these: special character, not ...

c# - Entityframework Load certain columns of a list withing a entity -

heey, lets assume have teacher , student relation, teacher responsible group of students. lets want load information of teacher, given or id, including students teacher responsible for, students want load column containing name, not age , studentnumber (see below). question is, how that? in attempt solve problem found https://colinmackay.scot/2011/07/31/getting-just-the-columns-you-want-from-entity-framework/ , similar situation, example shown in link return list of strings, want teacher returned. classes: public class schoolcontext : dbcontext { public dbset<teacher> teachers { { return set<teacher>(); } } } public class teacher { [key] public int id { get; private set; } public string name { get; set; } public list<students> students { get; set; } } public class students { [key] public int databaseid { get; private set; } public int studentnumber { get; set; } public string name { get; set; } public int age {...

ios - NSFetchedResultsController update/insert removing cell from UITableview -

using nsfetchedresultscontroller auto update uitableview facing issue. when trying add/edit device whole cell vanished every time. here bunch of code // nsfetchedresultscontroller delegate methods - (void)controllerwillchangecontent:(nsfetchedresultscontroller *)controller { [self.atableview beginupdates]; } - (void)controller:(nsfetchedresultscontroller *)controller didchangesection:(id <nsfetchedresultssectioninfo>)sectioninfo atindex:(nsuinteger)sectionindex forchangetype:(nsfetchedresultschangetype)type { uitableview *tableview = self.atableview; switch(type) { case nsfetchedresultschangeinsert: [tableview insertsections:[nsindexset indexsetwithindex:sectionindex] withrowanimation:uitableviewrowanimationfade]; break; case nsfetchedresultschangedelete: [tableview deletesections:[nsindexset indexsetwithindex:sectionindex] withrowanimation:uitableviewrowanimationfade]; break; ...

javascript - Convert enum (as string) from CAPS_CASE to camelCase -

i've found solution convert enum camelcase, it's not elegant. var underscoretocamelcase = function(str) { str = (str === undefined || str === null) ? '' : str; str = str.replace(/_/g, " ").tolowercase(); return str.replace(/(?:^\w|[a-z]|\b\w|\s+)/g, function(match, index) { if (+match === 0) return ""; return index == 0 ? match.tolowercase() : match.touppercase(); }); } so, if str my_enum_string return myenumstring. there must way achieve single regex match? try this: var underscoretocamelcase = function(str) { return str.tolowercase() .replace(/_+(\w|$)/g, function ($$, $1) { return $1.touppercase(); }); }