Posts

Showing posts from May, 2012

Upload Image Directly From Browser Using AngularJS Amazon S3 -

i trying upload images browser amazon s3 directly, getting error of aws not being defined: public/modules/users/controllers/settings.client.controller.js 16 | var bucket = new aws.s3({ ^ 'aws' not defined. 18 | credentials: new aws.credentials($scope.creds.access_key, $scope.creds.secret_key) ^ 'aws' not defined. below code: 'use strict'; angular.module('users').controller('settingscontroller', ['$scope', '$http', '$location', 'users', 'authentication', function($scope, $http, $location, users, authentication) { $scope.user = authentication.user; $scope.profpic = ''; $scope.creds = { bucket: 'bucket_name', access_key: '', secret_key: '' }; $scope.upload = function() { // configure s3 object var bucket = n...

javascript - Click button to highlight a Map Marker (Gmaps) - how? -

on page need "get directions," button highlight 1 of 3 points/map markers on map. far, have following wrapped around button/img.... <a href="https://maps.googleapis.com/maps/api/staticmap?center=" + 37.7029 + "," + -121.9335 + "&zoom=13&size=300x300&sensor=false"><img src="images/get-directions.jpg" alt="get directions"></a><br> though code not working. idea, went wrong code or know better way? it looks using static map url have embed map ? https://www.google.com/maps/embed/v1/directions ?key=api_key &origin= &destination=

python - Matplotlib Pick Event Functionality -

i'm having weird issue pick event fired if "scroll" while mouse cursor placed on artist object of interest. expected behaviour? clarify, i'm using macbook, , scroll mean 2 finger swipe (or 1 finger on magic mouse). the functionality i'm trying achieve have tooltips on axvspan segments (polygon artist objects), , pick event works if click, if scroll while mouse on 1 of segments of interest, multiple pick events fired. i couldn't find online people faced same issue, , doc isn't clear on firing of pick event either (it says: "fired when user picks location on canvas sufficiently close artist"). constitutes "pick"? edit: example of doing (these functions part of wxpython panel sub-class) def plot(self): in range(len(starttimes)): self.axs.axvspan(starttimes[i], endtimes[i], color='blue', alpha=0.3, picker=true)) self.figure.canvas.mpl_connect('pick_event', self.onpick3) def onpick3(se...

Trying to change statement so create_radio function is only called once (PHP) -

i have function creates radio button in php: // function creates radio button. // function takes 2 arguments: value , name. // function makes button "sticky". function create_radio($value, $name = 'gallon_price') { // start element: echo '<input type="radio" name="' . $name .'" value="' . $value . '"'; // check stickiness: if (isset($_post[$name]) && ($_post[$name] == $value)) { echo ' checked="checked"'; } // complete element: echo " /> $value "; } // end of create_radio() function. i leave php form create html form , call function 3 times values represent 3 different gas prices. <span class="input"> <?php create_radio('3.00'); create_radio('3.50'); create_radio('4.00'); ?> </span> i wondering how chan...

high availability - Whats the best way to migrate a zookeeper ensemble of 3? -

i have zk ensemble of 3 nodes. i need move each different server. whats best way achieve while achieving 0 downtime? an approach temporary requires increasing ensemble size work too. achieving 0 downtime main goal. have @ gist: https://gist.github.com/miketheman/6057930 add 2 more nodes on new servers let them sync, add them existing configs restart followers kill remaining master , deploy 3. zk on new server kill 2 zk on wrong servers

ios - Obscure Xcode build error: "The file “myapp-SBPartialInfo.plist” couldn’t be opened because there is no such file." -

i'm getting following error toward end of build: error: not read data '/users/myname/library/developer/xcode/deriveddata/myapp-ftieubjjfkuwyrhhleghfevbhxuu/build/intermediates/myapp.build/debug-iphoneos/myapp.build/myapp-sbpartialinfo.plist': file “myapp-sbpartialinfo.plist” couldn’t opened because there no such file. the thing can think of is result of having aborted build hour or ago. i have cleaned, quit xcode, rebooted computer - none of easy fixes working. i've checked other build directories (debug-iphonesimulator , release-iphoneos), , neither of directories contain file either. both simulator , archive building correctly. xcode bugs worst. i heard apple support. something wrong 1 of generated files. here steps fix it: 1) quit xcode. 2) open finder , select go > go folder... 3) delete deriveddata folder 4) open xcode. 5) clean project 6) build

java - How to change the imagebutton over another activity? -

i have onclick method , when click on onclick change imagebutton in mainactivitiy.class this onclick: public void onclick8 (view view) { //here should go command change imagebutton in mainactivity.class intent myintent = new intent(view.getcontext(), mainactivity.class); startactivity(myintent); finish(); mediaplayer mediaplayer = mediaplayer.create(zem13.this, r.raw.song); mediaplayer.start(); } if can please show code set in mainactivity.class , other activity. use string references , set string activity , when came activity can change image if

c# - How to implement in-app purchases in a Windows Store App -

i wondering how in-app purchases implemented in windows store apps (meaning not windows phone), because i've looked online , @ microsoft's tutorials , have found nothing seems avail me. i used unity develop game , exported windows store 8.1 file. specifically, have event implemented in unity code linked method in mainpage.xaml.cs file accessible in visual studio (i running express 2013 windows). actual method being executed, when request product purchase in method so, error: // assigned event called in unity whenever "get points" button pressed. private async void purchasepoints(object arg) { // find gamemanager gameobject. unityengine.gameobject gamemanager = unityengine.gameobject.findgameobjectwithtag("gamemanager"); // script attached it. gamemanager gamemanagerscript = gamemanager.getcomponent<gamemanager>(); // license information app. windows.applicationmodel.store.licenseinfo...

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot...

Store information from a File in a Class object (C++) -

this question has answer here: why reading record struct fields std::istream fail, , how can fix it? 9 answers i want read in input file class object using c++. here class object trying read file input array had problems reading in lines after "polygon" keyword. class polygon{ public: int object_number; float point_count; float px[size][size]; float py[size][size]; float pz[size][size]; float nx[size], ny[size], nz[size]; }; i want able store information after polygon keyword until next polygon keyword. so, first polygon in file. object_number = 0; point_count = 4; px[0][0] = 100; py[0][0]= 100; pz[0][0] = 200; nx[0][0] = 0.398925; ny[0][0] =0.598388; nz[0][0] = -0.453324; and forth until reaches next "poylgon" keyword in file. i'm going use information perform phong shading calculations the f...

asp.net - vNext: Form method POST not working with Debian/Kestrel -

i trying build simple asp.net vnext application. i have simple client-side html code: <!doctype html> <html> <body> <form action="/home/login" method="post"> login: <input type="text" name="login"><br> password: <input type="text" name="password"><br> <input type="submit" value="submit"> </form> </body> </html> and have simple server-side code handle post action: [httppost] [allowanonymous] public iactionresult login(string login, string password) { if (validate(login, password)) { var claims = new[] { new claim(claimtypes.name, login) }; var identity = new claimsidentity(claims, cookieauthenticationdefaults.authenticationtype); context.response.signin(identity); return redirecttoaction("index", "home"); ...

c# - ComboBox IsEnabled property not updating -

i trying disable items in combobox when multiple properties (or'd together) result in false. first time click combobox, properties' getters called , correct state shown. every time click combobox after first, properties not checked again, after have been changed (meaning items enabled/disable state should different). here code combobox item isenabled property: <!--itemcontainer style disabling combobox item--> <combobox.itemcontainerstyle> <style targettype="comboboxitem"> <setter property="isenabled" > <setter.value> <multibinding converter="{staticresource orconverterkkey}"> <!--<binding source="{staticresource vm}" path="notuseanglerange" updatesourcetrigger="propertychanged"/>--> <binding path="isaxisenabled" u...

php - Getting radio button value in while loop -

i'm doing simple examination program using php. here code taking quiz, it's still in testing don't mind design. this session person taking quiz (no problem here): <?php session_start (); $_session['username']; ?> <div id="wrap"> <?php $host="localhost"; // host name $username="root"; // mysql username $password=""; // mysql password $db_name="myproject"; // database name $tbl_name="q_quiz"; // table name // connect server , select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select db"); // value of id sent address bar $id=$_get['q_id']; $sql="select * $tbl_name q_id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <tab...

mediaSource API not working on Chrome but works smoothly on Firefox -

i trying stream webm format video being generated using gstreamer , individual frame being sent on websockets. typical byte arrangement of webm file (you may familiar this). ebml (head size: 12 bytes, data: 16 bytes, pos: 0, '0x0') doctype (head size: 3 bytes, data: 5 bytes, pos: 12l, '0xcl') : 'webm\x00' doctypeversion (head size: 3 bytes, data: 1 bytes, pos: 20l, '0x14l') : 2 doctypereadversion (head size: 3 bytes, data: 1 bytes, pos: 24l, '0x18l') : 2 ... ... segmentinfo (head size: 12 bytes, data: 91 bytes, pos: 192l, '0xc0l') timecodescale (head size: 4 bytes, data: 3 bytes, pos: 204l, '0xccl') : 1000000 duration (head size: 3 bytes, data: 8 bytes, pos: 211l, '0xd3l') : 0.0 muxingapp (head size: 3 bytes, data: 31 bytes, pos: 222l, '0xdel') : 'gstreamer plugin version 1.2.4\x00' writingapp (head size: 3 bytes, data: 25 bytes, pos: 256l, '0x100l') : 'gstreame...

conditions for multiple variables in while loop c++ -

im trying while loop show "invalid input" while loop 3 variables. im starting out c++ im not best @ trying show need here in terms. while(children1,children2,children3)<1||(children1,children2,children3)>100) cout << "invalid input"; return 0; it's easiest to express each requirement separately: while (children1 < 1 || children2 < 1 || children3 < 1 || children1 > 100 || children2 > 100 || children3 > 100) std::cout << "invalid input\n"; a c++11 alternatives is: #include <algorithm> ... while (std::min({ children1, children2, children3 }) < 1 || std::max({ children1, children2, children3 }) > 100) std::cout << "invalid input\n"; fwiw, if kept numbers in std::vector - arguably more elegant - option available: std::vector<int> children; children.push_back(23); children.push_back(123); children.push_back(13); // ...however many like... ...

Some gridview rows' buttons do not work, some does ASP.Net C# -

Image
i have project has problem , couldn't find reason why. use ajaxcontrol gridview display data come database. each row when populated has delete , edit buttons. when delete clicked, should display confirmation pop up. when edit clicked, display modalpopupextender editing data. some of buttons in rows (like 1st 15 rows) work, buttons of rows below not work. see picture i use onrowdatabound sum values each employee , total of records protected void gvdetails_onrowdatabound(object sender, gridviewroweventargs e) { (int rowindex = gvdetails.rows.count - 2; rowindex >= 0; rowindex--) { gridviewrow gvrow = gvdetails.rows[rowindex]; gridviewrow gvpreviousrow = gvdetails.rows[rowindex + 1]; (int cellcount = 0; cellcount < 2; //gvrow.cells.count cellcount++) { if (gvrow.cells[cellcount].text == gvpreviousrow.cells[cellcount].text) { if (...

c++ - change thread priority of dragon age inquisition -

i'm trying game run better on dual core processor, used program called process explorer see game runs 15 threads, 4 of take around ~98% of processing power @ 1 time. found 1 thread uses 10%-30% of cpu cycles not impact gameplay @ all, suspending thread gave dramatic boost game performance. i'm thinking if can adjust priority of other 3 main threads, can further improve performance. so question how can write program changes game's thread priority given thread id's inputs? in c++ there function called setthreadpriority() requires thread handle, seems used threads of current program only. i've been reading dll injection, game couldn't launch @ on dual core processors, , solution inject "dualcore.dll" using program called extreme injector, there way see code of dll , how can write own modify thread priorities?

canvas - Check if all pixels in a region are all empty in Javascript? -

i have 2d canvas things drawn , want know if pixels in region (rect - x,y,w,h) empty/fully transparent? know can done getimagedata there faster way? writing simple java script image packer , wish exclude empty images final sheet. the way read pixels use getimagedata() , can speed sort of checks using different view default uint8clampedarray , example uint32array allows read single pixel per iteration: function isempty(ctx, x, y, w, h) { var idata = ctx.getimagedata(x, y, w, h), // needed usual ... u32 = new uint32array(idata.data.buffer), // reads 1x uint32 instead of 4x uint8 = 0, len = u32.length; while(i < len) if (u32[i++]) return false; // if !== 0 return false, not empty return true // empty, ok } however, cannot used check transparency though. if pixel transparent there may color data present in other channels. example, produce invisible pixel: rgba(255,128,0,0) , isempty() report ...

arrays - Using a loop to assign labels won't work in Actionscript 3. TypeError: Error #1010 -

i've used website many things , found lot of useful information has helped me create randomized quiz mostly. i'm trying make code efficient possible , has led me error. i have created array uses .push function store existing buttons on stage array future use. code shown below sets label of each button correctly. _buttons[0].label = xmldata.difficulty1.questions[num2].op1.text(); _buttons[1].label = xmldata.difficulty1.questions[num2].op2.text(); _buttons[2].label = xmldata.difficulty1.questions[num2].op3.text(); _buttons[3].label = xmldata.difficulty1.questions[num2].op4.text(); so naturally wanted make little more efficient , put these in loop. based on logic should work doesn't. for (var i:number = 0; < 4; i++) { _buttons[i].label = xmldata.difficulty1.questions[num2].op[i+1].text(); } this code should increment array counter of _buttons , set label each. mean it's first set of code in loop right? when run following error: typeerror: error #1010: ...

ios - Swift - Creating a Parse Class with an Object that is a Pointer to an object in another class -

excuse me if explained somewhere in swift, know simple can't find answer anywhere. so problem have class in parse called "groups" has "title" object in it. in code below, creating new class called "rankeditems" has it's own objects. 1 of objects "groupowner" , objective here assign pointer "title" object in "groups" class. my code listed below. have wrong syntax in line of code attempts create "groupowner", have been trying figured leave in placeholder. can point me in right direction how should create "groupowner" pointer object in "groups" class? thanks! // add parse group object var itemrank:pfobject = pfobject(classname: "rankeditems") itemrank["itemname"] = newitem itemrank["groupowner"] = pfobject(withoutdatawithclassname: "groups", objectid: "title") itemrank.saveinbackgroundwithblock { ...

jquery - php + Ajax + Json page submit -

i have business functionality employee search (ajax), on submitting form. have load employee details using jquery based ajax. following search code. issue after submitting form, <div id="emp"></div> not populated values. in employee.php page see json object, able print employees. i guess below form submitting, not returning page after json object created. me how can make ajax based call. <!doctype html> <html> <head> <title></title> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.2.js"></script> <script type="text/javascript"> $(document).ready(function () { //alert('test'); $(".js-ajax-php-json").submit(function(){ alert('test'); $.getjson("employee.php", function (jsoncontent) { alert(jsoncontent); jsonarray...

html - Create equal height two column with css -

i want create equal height 2 column, 2 column right following height column left. @import url('http://getbootstrap.com/dist/css/bootstrap.css'); .left-side { background-color: green; height: auto; } .right-side-up { background-color: red; height:100px; //ignore value, if u have other way } .right-side-down{ background: blue; height: 80px; //ignore value, if u have other way } the same code on jsfiddle you use javascript define equal height of left side , right side. var leftside = document.queryselector('.left-side'); var rightside = document.queryselector('.right-side'); var hleftside = leftside.clientheight; var hrightside = rightside.clientheight; var maxh = math.max(hleftside, hrightside); leftside.style.height = maxh + 'px'; rightside.style.height = maxh + 'px'; .left-side { background-color: green; height: auto; } .right-side-up { background-color: red; height...

javascript - Allow only number in text box based on consecutive id -

here fiddle allow numbers. i want in based on id. so created fiddle $(document).ready(function () { //called when key pressed in textbox $("#quantity").keypress(function (e) { //if letter not digit display error , don't type if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) { //display error message $("#errmsg").html("digits only").show().fadeout("slow"); return false; } }); }); how can series of id quantity1,quantity2, this.. update : i can't use class name.. how can id all you've match id's simple. see fiddle . here's part code - $(document).ready(function () { //called when key pressed in textbox $("[id^=quantity]").keypress(function (e) { //if letter not digit display error , don't type if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 5...

ios - Replace ViewController of a tab in a TabBarControlller -

i have tabbarcontroller & 4 tabs individual viewcontrollers (embedded in navigationcontroller/tableviewcontroller) created using interface. dynamically added multiple barbuttons on viewcontroller1. current view controller of tab 1 has replaced on click of barbutton. how should go it? this snippet should play around with, hang of more self.tabbarcontroller.selectedindex = 1; i have answered question before too, can refer answer here [self.tabbarcontroller setviewcontrollers:arrayofnewviewcontrollers]; self.tabbarcontroller.selectedindex = 0;

javascript - jQplot tooltip dismiss issue -

Image
i have implemented simple bar chart, ive added tooltip feature using highlighter facing issue same. when move mouse down , exit chart canvas tooltip doesnt dismiss i have tried adding $.jqplot.eventlistenerhooks.push(['jqplotmousemove', handlemove]); $.jqplot.eventlistenerhooks.push(['jqplotmouseleave', handlemove]); but doesnt work , error handlemove not defined here code fiddle same https://jsfiddle.net/9j2na3l7/ i got working :) -- problem: mouse cursor escaping fast canvas, prevents event form fireing -- solution : first of grab handle of jplot object var plotbar = $.jqplot('task_brk_bar_chart', [... so can use manipulate on run-time. then use jqplotdatahighlight , jqplotdataunhighlight events change graph properties , replot() function apply them on fly. $('#task_brk_bar_chart').bind('jqplotdatahighlight', function () { plotbar.showtooltip = true; plotbar.replot(); }); $('#tas...

group method for activerecord. Docs are confusing? -

i don't means in rails tutorial: group(*args) public allows specify group attribute: user.group(:name) => select "users".* "users" group name returns array distinct records based on group attribute: user.group(:name) [user id: 3, name: "foo", ...>, #user id: 2, name: "oscar", ...>] i don't see grouping example gave... group useful (i think) if trying count stuff in database or if join multiple tables. let me give few examples. 1. if want know how many users there in data base each name can do: user.group(:name).count this return hash looking this: { ann: 4, bert: 15, cecilia: 3 ... } i not know why there many berts in database anyway... 2. if users have related records (for instance cars) can use first car included in activerecord model (the reason first because of how group works , further explained in link below) user.joins(:cars).select('users.*, cars.model car_model, cars.name car_name...

Click event from Adapter to Activity or Fragment in Android -

i have customized expandable list view showing in navigation drawer. have click listener in adapter send click event adapter activity or fragment. is possible if how go doing it? here snippet of adapter: public class customadapter implements expandablelistadapter { @override public view getgroupview(int position, boolean isexpanded, view convertview, viewgroup parent) { if (convertview == null) { convertview = inflater.inflate(r.layout.menu_item, parent, false); } textview text = (textview) convertview.findviewbyid(android.r.id.text1); text.settext(items.get(position).getname()); imageview imageview = (imageview) convertview.findviewbyid(r.id.imageindicator); if (items.get(position).ishaschild() && items.get(position).getsubmenuitems().size() > 0) imageview.setvisibility(view.visible); else imageview.setvisibility(view.invisible); if (isexpanded) ...

javascript - How to pass multiple JSON data objects from CSHTML to WEB.API? -

based on following question: passing-multiple-json-objects-as-data-using-jquerys-ajax my situation similar, different, , wondering if solution applies: my web.api code section follows: [route("api/admin/sitesettings/updatecompanycontactinformation")] [httpput] [responsetype(typeof(sitesettings.companycontactinformation))] public ihttpactionresult updatecompanycontactinformation( sitesettings.companycontactinformation _ocompanycontactinformation, sitesettings.sitedetails _ositedetails) { sitesettings _ositesettings = new sitesettings(); return ok(_ositesettings.companycontactinformation_update(_ocompanycontactinformation, _ositedetails)); } so main question do multi-level json data object as: _data={_ocompanycontactinformation: { ... }, _ositedetails: {...}} ??

javascript - Auto complete search is not working properly, do not iterate all elements in $.each ul li shows on time in response -

i have implemented auto complete search in site. problem response coming not iterate elements in <ul><li> elements. shows 1 element in html coming multiple response. on top search see if type river comes river records not show in 1 ul li means li iteration not working. here jquery code: <script> $(document).ready(function(){ $('#keyword').keyup(function() { var total; $.ajax({ type: "post", url: "http://realtyexecutivesny.com/getrecset.php?rnd=" + math.random(), data:{ key: $(this).val() }, success: function(data){ $.each(data.locations, function( key, value ) { total = '<li>'+data.locations[0].value+'</li>'; }); $('#lists').html('<ul>'+total+'</ul>'); } }); }); $('#lists ul li').click(func...

html - how to divide the input into two in single line -

in code below, getting 1 one input fields, want display single line, 2 input fields want show. now output: name password expected output: name password can 1 me updated html <div> <input type="text" name="name" class="login-input" placeholder=" name" autofocus> <input type="password" name="password" class="login-input" placeholder="password"> <input type="text" name="father_name" class="login-input" placeholder=" father name" autofocus> </div> <div> <input type="text" name="mother_name" class="login-input" placeholder=" mother name" autofocus> <textarea type="text" name="adress" class="login-input" placeholder=" address" cols="40" rows="6" autofocus></textarea> </div> ...

javascript - How can an XML file be included into a mocha test case -

i have written test in mocha runned in karma. test make use of test xml data included in separate file. purpose of test evaluate parser. have tried include using files in karma. error "unexpected token <". got work, had left out "included: false" {pattern: 'test/mock/description.xml', watched: false, served: true} caused default true. lead karma trying including in html causing error.

android - Spinner style (AppCompat Light DarkActionBar) for a button => wrong icon color -

i use theme bases on appcompat.light.darkactinbar . (1) spinner works expected if add spinner following, works expected: <spinner android:id="@+id/sptype" android:layout_width="wrap_content" android:layout_height="wrap_content" /> and set adapter: adaptertype = new arrayadapter<mappedresourcevalue>(getactivity(), r.layout.support_simple_spinner_dropdown_item, statistictypes.getvalues()); adaptertype.setdropdownviewresource(r.layout.support_simple_spinner_dropdown_item); sptype.setadapter(adaptertype); (2) spinner style view not work if add button , want style it, spinner, has white drop down icon instead of dark one... <button android:id="@+id/bttypes" style="?android:attr/spinnerstyle" android:layout_width="match_parent" android:layout_height="wrap_content" /> i tried style="?android:spinnerstyle" apperently not make difference... ...

.htaccess - Show a custom page for notfound folders -

i want show custom page example sub.php , whenever url not found for example http://domain.com/blabla/ http://domain.com/blabla/bladas.html http://domain.com/tedabad/dasd/sadsad/ so above examples of not found urls , display contents of http://domain.com/sub.php , tried below code , not working options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / rewritecond %{request_filename} !-d [or] rewritecond %{request_filename} !-f [or] rewritecond %{request_filename} !-l rewriterule ^ - [l] rewriterule ^([^/]+)/?$ /sub.php [l] rewriterule ^([^/]+)/(.+?)/?$ /$1/sub.php [l] you can check presence of sub.php in rewritecond , use errordocument directive: options +followsymlinks -multiviews rewriteengine on rewritecond %{request_filename} !-d rewritecond %{document_root}/$1/sub\.php -f [nc] rewriterule ^([^/]+)/(.+?)/?$ /$1/sub.php [l] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule . /sub.php [l] ...

c#: how to include filename when sending files to an asmx service -

i have asmx method accepts list of files so: [webmethod] public void uploadfiles(list<byte[]> files) { } the windows metadata not included in byte array. tried using dictionary<filename, byte[]> classes implement idictionary not serializable. tried using keyvaluepair<string, byte[]>[] imo looks dirty. there other ways include name of file? as mentioned in comments, can resolved making custom data class. it's unfortunate dictionaries aren't serializable, it's inherent flaw of xml serialization process. same goes data classes circular references, doesn't work. wcf, however, has managed fix issues. you're using .asmx (soap), you're stuck unfortunate incompatibility. i'd make custom class: [serializable] public class file { public string filename {get;set;} public byte[] payload {get;set;} } then change web method to: [webmethod] public void uploadfiles(list<file> files) { //... } simple, effe...

Javascript - How to alter a property of a css class -

here's i'm trying do: i want width of particular div changed every time resize window. div's class properties in external css document class name '.nav'. in html: <body onresize="nav_resize()"> in js: var w= window.innerwidth, h= window.innerheight; var nav= document.getelementsbyclassname('nav'); function nav_resize(){ if (w<700){ nav.style.width= w-150;} } .nav{ background-color:#5f1c1c; position:fixed; float:left; width:190px; min-width:85px; top:105px; height:100vh; overflow:hidden; z-index:1; } know i'm doing wrong since nothing happens when try in browser. appreciated. to control kind of resize events use @media css rule @media screen , (min-width: 700px) { // css style +700px } @media screen , (max-width: 700px) { // css style -700px } this avoid problems resize both smaller bigger , opposite.

zk grid - Get value from form of ZK -

i have problem zk! this part of code: <template name="model:group"> <group label="@load(each)" onclick="@command('viewgraph')"/> </template> <!-- template each element in model --> <template name="model" > <row > <label value="@load(each.hour)" /> <label value="@load(each.value)" /> </row> </template> when click on group label create graph each.hour , each.value. the problem these value table. want graph value clicked item. possible? the code vague, can suggest try passing through bindingparam: onclick="@command('viewgraph', item=each)"/> but i'm not sure how fill underlying groupsm...

dataset - SAS transpose using a part of the name -

i'm here asking for problem proc transpose. i have dataset made way (i'm going show 3 variables have lots of them) pr id var1a var1b var1c var2a var2b var2c var3a var3b var3c 1 1 x x x x x x x x x 1 2 x x x x x x x x x 1 3 x x x x x x x x x 2 1 x x x x x x x x x 2 2 x x x x x x x x x 2 3 x x x x x x x x x i need output dataset this: preid id var(name) b c 1 1 var1(name) x x x 1 1 var2(name) x x x 1 1 var3(name) x x x 1 2 var1(name) x x x 1 2 var2(name) x x x 1 2 var3(name) x x x 1 3 var1(name) x x x 1 3 var2(name) x x x 1 3 var3(name) ...