Posts

Showing posts from March, 2011

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(); }); }

jquery - Do not select if the parent class is hidden -

with code below selecting checkboxes , radio buttons send them array. var options = []; $('.option input[type="checkbox"]:checked, .option input[type=radio]:checked').each(function() { options.push($(this).val()); }); var options_checked = options.join(','); there single radio buttons have parent class sass_syntax , of course selected. don't want select them if class sass_syntax hidden ( display: none ). how can this? you can exclude them using .not() filter var options = $('.option input[type="checkbox"]:checked, .option input[type=radio]:checked').not('.sass_syntax:hidden input').map(function() { return $(this).val(); }).get(); var options_checked = options.join(',');

titanium - clear views in ScrollableView -

i have titanium project alloy. in screen have scrollableview. when open screen need remove views of screen, can't. principal.xml <scrollableview id="emisorview" onscrollend="cambioemisor" top="10%" height="10%" width="100%" backgroundcolor="#fff"> </scrollableview> principal.js function construyoemisores(){ var db = ti.database.open('termolink'); var rows = db.execute('select * regulaciones order regulaciones.nombre,regulaciones.serie'); nregistros=comprueboregbd(); (i=0;i<$.emisorview.views.length;i++){ $.emisorview.removeview($.emisorview.views[i]); } var i; var serieenqueestoy=0; (i=0;i<nregistros;i++){ tablanombretermostatos[i]= rows.field(2); if (rows.field(0)==serie) serieenqueestoy=i; //esto es para posicionar en el seleccionado var nuevaview=ti.ui.createview(); var titulo1=ti.ui.createlabel({ id: "nombreterm",

assembly - How To Boot 512byte bootloader from USB (ARMx86) -

Image
it simple non-os-specific assembly program designed work pc's architecture. compiled nasm's linux version. i tried place usb , when selected boot usb in bios, did try boot usb. , silence. hardware kept running program supposed print characters screen. black screen flashing white cursor on top left (i think belongs bios). maybe bios didn't count "file" boot sector. here usb content (screenshot win7, not in english can understand is): properties need make usb drive bootable? need partition master boot record? a few years ago created bootable shell emulator supposed boot usb drive, stucked many times figuring out issue, in order make happen need put mbr boot program @ first sector of drive, special boot signature, has 512 bytes long, there can boot other sector on drive contain rest of bootable programs. make sure boot loader code correct , @ first sector of drive. http://wiki.osdev.org/bootloader http://forum.osdev.org/viewtopic.php?f=1&a

Python inserting dynamic list in excel file -

my program compares values in 2 files loaded dynamically every month. value in between may vary every time. first file has same second one. if script finds doesn't match, save these values in list. if finds more 1 missmatch appends list of values this: ['001210', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', '001210', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', 'vw0012', '13/06/2016', '000590030', '0', '16', '16105971', '26- - ', 'vw0012', '13/06/2016', '000590030', '0', '16', '16105971', '26- - '] i'm trying figure out how write output this: columns divided code formatted above , number of rows changes it's range... can do? it's better pandas or what? any advice precious... thank in adv

assign values to list of variables in python -

i have made small demo of more complex problem def f(a): return tuple([x x in range(a)]) d = {} [d['1'],d['2']] = f(2) print d # {'1': 0, '2': 1} # works now suppose keys programmatically generated how achieve same thing case? n = 10 l = [x x in range(n)] [d[x] x in l] = f(n) print d # syntaxerror: can't assign list comprehension you can't, it's syntactical feature of assignment statement. if dynamic, it'll use different syntax, , not work. if have function results f() , list of keys keys , can use zip create iterable of keys , results, , loop on them: d = {} key, value in zip(keys, f()): d[key] = value that rewritten dict comprehension: d = {key: value key, value in zip(keys, f())} or, in specific case mentioned @jonclements, as d = dict(zip(keys, f()))

python - Firebase DB HTTP API Auth: When and how to refresh JWT token? -

i'm trying make python webapp write firebase db using http api (i'm using new version of firebase presented @ google i/o 2016). my understanding far specific type of write i'd accomplish made post request url of type: https://my-project-id.firebaseio.com/{path-to-resource}.json what i'm missing auth part: if got correctly jwt should passed in http authorization header authorization : bearer {token} . so created service account, downloaded private key , used generate jwt, added request headers , request wrote firebase db. now jwt has expired , similar request firebase db failing. of course should generate new token question is: wasn't expecting handle token generation , refresh myself, http apis i'm used require static api key passed in request webapps kept relatively simple adding stati api key string request. if have take care of token generation , expiration webapp logic needs become more complex (because i'd have store token, check if st

excel - Add data in next available row -

this macro adds data in cell a10. data gets overwritten every time run again. how can add 1 cel below? sub invoer() dim debiteurnummer integer dim aantalpallets integer dim totaalgewicht integer debiteurnummer = inputbox("debiteurnummer invoeren") aantalpallets = inputbox("aantal pallets?") totaalgewicht = inputbox("totaal gewicht?") range("a10").value = debiteurnummer range("a10").offset(0, 2) = aantalpallets range("a10").offset(0, 3) = totaalgewicht end sub add dynamic search lastrow : sub invoer() dim debiteurnummer integer dim aantalpallets integer dim totaalgewicht integer dim lastrow long debiteurnummer = inputbox("debiteurnummer invoeren") aantalpallets = inputbox("aantal pallets?") totaalgewicht = inputbox("totaal gewicht?") lastrow = cells(rows.count, "a").end(xlup).row range("a" & lastrow + 1).value = debiteurnummer range("a"

ios - How to implement UIViewControllerTransitioningDelegate in UIStoryboardSegue? -

Image
this now: func presentoverlaycontroller(controller: uiviewcontroller) { controller.modalpresentationstyle = .custom controller.transitioningdelegate = self presentviewcontroller(controller, animated: true, completion: nil) } //mark: - uiviewcontrollertransitioningdelegate public func presentationcontrollerforpresentedviewcontroller(presented: uiviewcontroller, presentingviewcontroller presenting: uiviewcontroller, sourceviewcontroller source: uiviewcontroller) -> uipresentationcontroller? { return overlaypresentationcontroller(presentedviewcontroller: presented, presentingviewcontroller: presenting) } it works pretty awesome. first controller storyboard using .instantiateviewcontrollerwithidentifier: . controller presented right way: but same result need achieve custom segue : class overlaysegue: uistoryboardsegue, uiviewcontrollertransitioningdelegate { override func perform() { destinationviewcontroller.modalpresentationstyle = .cust

c# - Xamarin.Forms: ListView are not being Displayed on Xamarin.Droid -

Image
i'm creating xamarin.forms portable application . have database in visual studio , want display data inside xamarin listview. whenever that, data not being displayed on xamarin.droid leaving blank space. tried in uwp , worked. how in xamarin.droid? (screenshot of xamarin.droid) notice listview still occupy space if records not being displayed. think reason behind this? check in web api if data being retrieved , does. meaning, real problem occurs in displaying records on listview. hope can me. here codes i've tried. clientlist.xaml <?xml version="1.0" encoding="utf-8" ?> <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:class="xamarinformsdemo.views.clientlistpage" xmlns:viewmodels="clr-namespace:xamarinformsdemo.viewmodels;assembly=xamarinformsdemo" xmlns:controls="clr-namespace:imagecir

android - Cannot find symbol "messaging" in com.google.firebase.messaging.FirebaseMessagingService -

Image
i trying access firebasemessagingservice using firebase 9.2.1 library. have created project download json file. have integrated json file project. firebaseinstanceidservice running fine showing error firebasemessagingservice. checked project folder inside android studio. find firebase-messaging 9.2.1 library missing. how can resolve issue. have upgraded of sdk libraries. please me fix issue. you need add firebase messaging dependencies: compile 'com.google.firebase:firebase-messaging:9.2.1' setup firebase cloud messaging explained in documentation .

php - Mysql Insert form into database table PDO -

i have problem.. tried today lot make working seems impossible me.. decided ask here. have form needs added on database table when submit button pressed. php code use.. removed tries btw: <?php $pdo = new pdo('mysql:host=;dbname=', '', ''); $sql = "select * games limit 10"; foreach ($pdo->query($sql) $row) { ?> my html code (form): <form class="form-group" method="post" action=""> <div role="tabpanel" class="tab-pane active" id="home"> <div class="form-group" style="margin-top: 15px;"> <label for="exampleinputemail1">game title</label> <input type="text" class="form-control" id="exampleinputemail1" placeholder="" name="gtitle" /> </div> <div class="form-group"> <label for="exampleinputpa

jQuery get json_encode variable from PHP -

my php file retrieves data postgresql db. have send them jquery function in 2 different arrays. 1 passed using: echo json_encode($tb); and works fine, in js file data correctly using: $.ajax({ type: "post", url: './db/lb.php', data: {d_p: oa}, success: function (tb) { console.log(tb); }) console output expected. the other php array, have replace chars: str_replace(array('[', ']'), '', htmlspecialchars(json_encode($ltb), ent_noquotes)); but if write: $.ajax({ type: "post", url: './db/lb.php', data: {d_p: oa}, success: function (tb, ltb) { console.log(tb); console.log(ltb); }) console.log(ltb) outputs success what i'm getting wrong? the second parameter of succes response staus. reason because success when logging tlb . you can return 1 json @ at time, combine them: echo json_encode(array("other stuff", "tb"

c# - Showing Data with SQL Database Error -

i try data local sql database. 1st code workis simple , write path directly. string connstring = "data source=(localdb)\\mssqllocaldb;attachdbfilename=c:\\****\\****-\\desktop\\mssolution\\mssolution\\datatt.mdf;integrated security=true"; after research change code : static string apppath = path.getdirectoryname(application.executablepath); string connstring = "data source=(localdb)\\mssqllocaldb;attachdbfilename=" + apppath + "\\datatt.mdf;integrated security=true"; but problem it's not showing data. , question, app deploy exe setup, problems working local database <connectionstrings> <add name="contextname" connectionstring= "data source=.; database=dbname; integrated security=true" providername="system.data.sqlclient" /> </connectionstrings> is looking for...?

php - SQL SELECT * returns only one row -

i'm designing website , wrote webpage display list of users. used a $query = select * `table_users` `id`='.$id.' and increment id "while" can grab users. it's slow now, , glitches when there gap between ids. so tried $query = select `name` `tbl_user`order `id` and displaying userlist a while ($i < sizeof(mysql_fetch_array(mysql_query($query)))){ <code display user> $i++ } but mysql_fetch_array returnes 1 user, first 1 (the 1 littliest id). want return users in array. how do ? try this $query = "select `name` `tbl_user` order `id`"; $user_query = mysql_query($query); $i=1; while ($row = mysql_fetch_array($user_query)){ echo $i." : ".$row['name']."<br>"; $i++; }

typescript - Import from npmcdn in WebStorm -

in systemjs.config.js have mapped '@angular' 'https://npmcdn.com/@angular' can import things like: import {component, input} '@angular/core'; but webstorm produces error ts2307: cannot find module '@angular/core' . is there way fix other downloading every module https://npmcdn.com/@angular local directory?

c# - how to add claims in jwt using jose-jwt -

i using jose jwt library creating jwt token, not sure how can use claims tag in payload. want store user name , other data related it. below code using generate code byte[] secretkey = base64urldecode("-----begin private key-----"); datetime issued = datetime.now; datetime expire = datetime.now.addhours(10); var payload = new dictionary<string, object>() { {"iss", "service email"}, {"aud", "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.identitytoolkit"}, {"sub", "service email"}, {"iat", tounixtime(issued).tostring()}, {"exp", tounixtime(expire).tostring()} }; string token = jwt.encode(payload, secretkey, jwsalgorithm.hs256); return token; the jwt specification talks 3 types of claims: registered, public , private. regist

How to fit range of calculate calomn to pivot table size in Excel 2013 -

i have pivot table changes row number after each refresh. near (next column), created calculate column not part of pivot table, uses pivot table data. i have been dragging down last cell calculate column in order fit changing pivot table size calculate values. is there way fit calculate column pivot table size automatically? if there way , depends on vba code, there option insert formula , not run macro? thanks. add routine worksheet code option explicit enabled @ top. private sub worksheet_calculate() application.enableevents = false dim calccol string, firstrow long, lastrow long calccol = "a" 'write column name here firstrow = me.pivottables(1).tablerange2.cells(1,1).row lastrow = me.pivottables(1).tablerange2.cells(me.pivottables(1).tablerange2.rows.count,1).row me.range(calccol & firstrow).formula = 'your formula string here me.range(calccol & firstrow & ":" & calccol & lastrow).filldown

Texture mapping bitmap to SVG path -

i have ordinary rectangular bitmap able use fill four-pointed svg path - mapped texture 4 corners of bitmap mapped 4 points of path , rest of image 'warped' accordingly. i have been able fill svg rect same image , transform rect such bitmap transformed it: <defs> <pattern id="bmp" x="0" y="0" width="1" height="1"> <image x="0" y="0" width="100" height="100" href="mybmp.bmp"/> </pattern> </defs> <rect x="0" y="0" width="100" height="100" fill="url(#bmp)" stroke="black" transform="skewx(10)"/> when try use bitmap fill path though gets mapped bounding box of path shape , not 4 points of path itself: <defs> <pattern id="bmp" x="0" y="0" width="1" height="1"> <image x="0" y="0

javascript - Replace the angularjs pop-up and change to jquery -

hi in kind of unique situation. have code in angularjs , have given task join html in jquery. jquery page opens when click on particular link. checked code , find out calls modalservice.showmodal , passing 2 name. 1 template , 1 controller name. now, have done checked function defination is. there commented out if controller name empty go forward. the function this- self.showmodal = function(options) { // create deferred we'll resolve when modal ready. var deferred = $q.defer(); // validate input parameters. var controllername = options.controller; if (!controllername) { //deferred.reject("no controller has been specified."); //return deferred.promise; } but if nothing happening. how can this. please me on this. edit: have page in angularjs , html. there link in page pop-up. now, want change pop-up jquery pop-up. dont know how add it. here link have call jquery table has controller pa

javascript - ES6 template literals based on template variable -

this question has answer here: convert string template string 14 answers i try render es6 template literal variable : function render(template, data){ ... } const template = 'resources/${id}/'; console.log(render(template, {id: 1})); // -> resources/1/ does exist way transform string template context formated string es6 template literals feature ? you can not simple template literals. however, can achieve such behaviour wrapping literals functions. es6 features (desctructuring , arrow functions), result code simple function render(template, data) { return template(data); } const tpl = ({ id }) => `resources/${id}/`; console.log(render(tpl, { id: 1})); // resources/1/

c# - How to get localized display name for the windows store apps -

i parsing appxmanifest.xml , getting display name. contains like ms-resource:applicationtitlewithbranding, ms-resource:apptitlewithbranding, ms-resource:appstorename. when use shloadindirectstring function display name (in format of @{prifilepath?resource} ), don't localized display name. returns nothing. but proper response apps contain display name ms-resource:///resources/appstorename. is there workaround localized display names ? i need work on both windows8.1 , windows10. desktop app. i passed 'ms-resource:apptitlewithbranding' function along pri file location. that's why did not localized names. we should not send resource in format : ms-resource:apptitlewithbranding. modify thing in below format. resource should in format: ms-resource://package.id.name/resources/apptitlewithbranding if appxmanifest.xml contains in above format, pass is. and final format should @{prifilepath?resource}

CouchDB replications not starting when new replication added -

when add replication couchdb, doesn't start. i.e. following doc after saving: { "_id": "xxx", "_rev": "yyy", "target": "https://user:pswd.domain/db", "source": "db", "create_target": true, "continuous": true, "user_ctx": { "name": "admin", "roles": [ "_admin" ] }, "owner": "admin" } usually after creating replication, replication triggered , doc updated include: "_replication_state": "triggered" or "error", "_replication_state_time": "some time", "_replication_id": "some id" i using couchdb 1.6.0 on ubuntu 16.04. cause happen? replication working fine until hour ago when 80 of 140 or replications failed @ once. there 60 replications seen 'triggered' in couch

html - Change Form Size Depending on Screen Resolution -

Image
i've had online , via stack have able find fixes c# far. i've been working on new job search form - actual form works great, i'm having issues when test on different sized computer screens. the form supposed this: simple design. when use form search our job boards, works great. problem arises when use on different resolution screen, issue this: believe error has come me coding in size of input bars: <input name='keywords' type='text' maxlength='64' size='50' id='keywords' value='' placeholder="e.g freight forwarding" style="font-style:italic;" x-webkit-speech /> is there way can code in size fits in depending on size of screen user viewing from? any appreciated it.

python - How can I open up webcam and process images with docker and OpenCV? -

i have python script uses opencv , when runs script want process image webcam , give result. how can make it? this how tried: my simple test python script: import cv2 cap = cv2.videocapture(0) while true: ret, frame = cap.read() print ret this in dockerfile: from gaborvecsei/opencvinstall add testcode.py ./testcode.py #start sample app cmd ["python", "testcode.py"] after build , run it prints false means not have image webcam. how can images? to make cam visible docker container, should pass --device argument when start container. docker start --device /dev/video0 helloworld:1.0.0

javascript - Mysterious '...' at end of my strings, although it doesn't seem to be a char? -

Image
i running unit tests on javascript, however, following test failing: it('should pass tags without code clean through', function () { //some logic expect(processed_content).tobe(data); }); however, getting error shown below. both strings seem identical, , when copy , pasted online diff checker reports identical. 1) test migrator should pass tags without code clean through 1.1) expected '--- title: location description: how work geographical location data. --- import module in code use: {% nativescript %} javascript var geolocation = require("nativescript-geolocation"); ' '--- title: location description: how work geographical location data. --- import module in code use: {% nativescript %} javascript var geolocation = require("nativescript-geolocation"); '. however, when tried comparing processed_content.split('') , data.split('') , got: so can see there difference in how end of file being dealt dur

java - SnmpV3 Trap Receiver with Authentication/Privacy - dynamically obtain engineID from agents -

i trying develop snmpv3 trap receiver using webnms adventnet api. if use authentication , privacy options ( md5 + des ), need know engineid of agent sends traps in order decrypt trap content. how can obtain engineid dynamically (without hardcoding in application)? i saw it's possible perform discovery of engineid but work need provide port used agent when sends traps (and agent real network element uses random source ports). the following code working, hard-coded engineid . there different way decrypt traps without hardcoding engineid ? public class dragosapp2 implements snmpclient{ public static void main(string[] args) throws snmpexception { snmpapi api = new snmpapi(); snmpengineentry snmpentry = new snmpengineentry("10.10.66.79"); snmpenginetable enginetable = api.getsnmpengine(); enginetable.addentry(snmpentry); snmpsession session = new snmpsession(api); session.addsnmpclient(new dragosapp2());

javascript - PHP PDO SESSION not able to redirect -

i using session through login form , when trying login not redirecting index.php . please let me know mistaken. below code index , login <?php session_start(); if (!isset($_session['user_name'])) { header("location: login.php"); } else{ echo "welcome $user_name"; ?> following html <!doctype html> <html> <head> <title>admin panel</title> <link rel="stylesheet" type="text/css" href="admin_style.css"> </head> <body> <h1>welcome home page</h1> </body> </html> <?php } ?> below login.php code form <?php session_start(); ?> <!doctype html> <html> <head> <title>admin login</title> </head> <body> <form action=&

c# - Button command(s) to select next / previous item in ListBox -

is there simple command can send standard wpf listbox using button select next / previous item in list? currently i'm rolling solution: <button width="30" height="30" x:name="previousbutton"> <i:interaction.triggers> <i:eventtrigger eventname="click"> <ei:changepropertyaction increment="true" propertyname="selectedindex" targetname="mylistbox" value="-1" /> </i:eventtrigger> </i:interaction.triggers> </button> <!-- listbox here. --> <button width="30" height="30" x:name="nextbutton"> <i:interaction.triggers>

jquery - Dynamic report builder using jstree and datatable -

i want build report builder, user can drag , drop columns jstree boostrap table , column should added table dragged jstree , inbetween need ajax in order retrieve data jstree dragged column. please suggest me , how proceed, struct , google alot. please suggest overview of solution.

vba - SSRS - How to get column value by column name -

i have 1 table rows , each row has column contains field name (say raw1 - 'number001', raw2-'shortchar003', etc). in order me value of these fields have use second table; table has 1 raw many columns (number001, number002, shortchar003, etc). how can extract value? good question..you can use lookup function =lookup(fields!citycolumn.value, fields!citycolumn.value, fields!countcolumn.value, "dataset1") or might have use string functions..ex left, substring, right same sql.if possible pls post data of both tables, explain in detail

java - Casting Object to int array doesn't work -

Image
this question has answer here: casting object array integer array error 4 answers convert integer[] int[] array 3 answers i reading row database using jpa, provides object 3 int values. i trying cast object int[] array, throws classcastexception , says: ljava.lang.object; cannot cast [i this code: try { utx.begin(); } catch (notsupportedexception e) { e.printstacktrace(); } catch (systemexception e) { e.printstacktrace(); } query q = em.createnativequery("select * mytable"); list<object> objectlist = q.getresultlist(); (int = 0; < objectlist.size(); i++) { object object = objectlist.get(i); int[] array = (int[]) object; } i tried integer[] . same exception. does see problem? how can cast it? just noted , there dif

python - Empty Div return with Xpath or Css Selector Using Scrapy -

i'm using scrapy crawl web page contains specific article. i'm trying informations stored inside div class "return". big problem div return empty when use scrapy xpath or css selectors. the div i'm trying extract: <div class="return"> <p><strong>conditionnement : </strong></p> <p class="one-product-detail">2 colis :<br> l178xl106xh80&nbsp;72kg<br>l178xl112xh80&nbsp;60kg<br> <span itemprop="weight" alt="3fin" class="hidden" hidden="">132kg</span></p> </div> my spider code: import scrapy alinea.items import alineaitem class alineaspider(scrapy.spider): name = "alinea" start_urls = [ "http://www.alinea.fr/", ] def parse(self, response): # ref = input(&qu

asynchronous - Calling a WCF asynchronously from an ASP.NET MVC application -

i have established n-tiered asp.net mvc application synchronously; controllers inherit controller rather asynccontroller. what want take 1 of lower tiers (that literally every flow consumes) , put in awaited call wcf. why await? well, figure reduce overall thread-count , make server more scalable. however, not in position change of code outside of tier. normally, 1 change calling methods returning t return 'async task', , give method name "async" suffix, e.g. : from public string getdata() to public task<string> getdataasync() okay, went following (cut down) code: public responseobject getsomething(requestobject request) { return mymethodasync(request).result; } private static async task<responseobject> mymethodasync(requestobject request) { using (var client = new client(new nettcpbinding(), new endpointaddress(url)))) { await client.dosomething(request).configureawait(true); } } when run code (f5), gets lin