Posts

Showing posts from January, 2012

animation - How to do an animated plot in matlab -

i wondering if knew how animation plot of x = (dataset of 1000 points) y = (dataset of 1000 points) plot(x,y) big problem these datasets trying plot , or x,y coordinates opposed function know how plot via animation. i tried frames in loop gave me dots , didn't join them in line graph couldn't watch path being traced out. code used was for = 1:length(dataset1) pause(0.1) plot(dataset1(i),dataset2(i)) draw on end looks close. not sure draw on command though. see if code here inspires solve case - %// sample x , y values assumed demo. x = 1:1000; y = x.^2; %// plot starts here figure,hold on %// set x , y limits of plot xlim([min(x(:)) max(x(:))]) ylim([min(y(:)) max(y(:))]) %// plot point point k = 1:numel(x) plot(x(k),y(k),'-') %// choose own marker here %// matlab pauses 0.001 sec before moving on execue next %%// instruction , creating animation effect pause(0.001); end

Firefox userChrome.css window focus selector -

is there css selector can use in userchrome.css change text color of firefox when whole browser window loses focus? i've tried: window:focus element { color: #aaa; } /* nothing */ window:active element { color: #aaa; } /* when something's being clicked */ window:hover element { color: #aaa; } /* when cursor on window */ window[focus] element { color: #aaa; } /* wishful thinking--doesn't work */ window[active="true"] element { color: #aaa; } /* documented work... */ or stuck using javascript? if so, there userchrome.js can put script in? solved! per https://developer.mozilla.org/en-us/docs/web/css/:-moz-window-inactive , functionality has been changed. now can use: element:-moz-window-inactive { color: #aaa; } and: element:not(-moz-window-inactive) { color: #aaa; } to change css styles depending on if firefox window focused.

django - Query database using POST data in FormView class -

i'm new django , need simple task. have 2 templates. search.html : renders simple form text field submit button , posts /search_results/ search_results.html : need render result of database query posted /search_results/ in forms.py file: from django import forms class systemsform(forms.form): serial_num = form.charfield(label="serial no.", max_length=45) in urls.py urlpatterns = patterns('', url(r'^search/$', systemsearch.as_view()), url(r'^search_results/$', systemresult.as_view()), ) in views.py file from django.views.generic.edit import formview inventory.forms import systemsform class systemsearch(formview): # displaying form template_name = 'inventory/search.html' form_class = systemsform class systemresult(formview): template_name = 'inventory/search_result.html' form_class = systemsform # how these 2 thin...

javascript - I am having trouble linking two pages in Ionic Framework -

i following tutorial on pluralsight build web app , getting error connecting team.html , team-detail.html . "ui-sref = "app.game({id: game.gameid}" on line 4 of team-detail.html do? correct? error says: typeerror: cannot read property 'name' of undefined @ new teamdetailctrl (team-detail-ctrl.js:18) @ object.invoke (ionic.bundle.js:11994) @ extend.instance (ionic.bundle.js:16247) @ ionic.bundle.js:15502 @ foreach (ionic.bundle.js:8155) @ nodelinkfn (ionic.bundle.js:15501) @ compositelinkfn (ionic.bundle.js:14887) @ publiclinkfn (ionic.bundle.js:14766) @ self.appendviewelement (ionic.bundle.js:47324) @ object.switcher.render (ionic.bundle.js:45864)ionic.bundle.js:19387 (anonymous function) here's link code have halfway through tutorial: https://github.com/bhaskar2khaneja/elitescheduleapp/tree/master/www also, not understand <.. href = "#/app/teams/{{team.id}}"> doing in standings.html file. it's not produ...

c# - Clear the ViewBag? -

is there way clear viewbag ? viewbag has no setter, can't nulled out: viewbag = null; i can't seem use reflection iterate on , wipe out dynamic properties, can't create instance of dynamic . note: know viewbag on own bit of code smell it's not typed, , giant collection of global variables. , we're moving away it, still need deal in meantime. you can call viewdata.clear(); as viewbag uses internally. here working example - https://dotnetfiddle.net/gmxcti . if uncomment commented line, displayed text cleared here current implementation viewbag in mvc: public dynamic viewbag { { if (_dynamicviewdatadictionary == null) { _dynamicviewdatadictionary = new dynamicviewdatadictionary(() => viewdata); } return _dynamicviewdatadictionary; } } and part of dynamicviewdatadictionary // implementing function improves debugging experience provides debugger list of // properties define...

java - How should I store a two column table with duplicated first column entries? -

in program there 72 paths (numbered 1 72). in program need retrieve adjacent paths, , check ownership of these 2 paths. paths range 2 adjacent paths 4. example path 1 has adjacent paths 2 , 7; whereas, path 13 has adjacent paths 8, 12, 14, 21. these path relationships constant. i write method path.getadjacent(int pathnum) return int[] containing adjacent paths. way make loop checks each owners each adjacent path. how should store , access path relationship data may efficiently retrieved method path.getadjacent() ? davide answered question: use map<integer,arraylist<integer>>

javascript - Toggle visibility of multiple table-rows with specified <tr class="xxx"> by button (more/less details) -

there tons of jquery accordions toggle single rows or lines. need one, can toggle multiple table-rows specified tr-class (tr class="xxx") "show more/less details"-button @ once. i want start, showing table basic information (few rows). on button-click, hidden rows between invisible ones should shown. can't find that. has idea?

Android cordova plugin : NoClassDefFoundError -

my project meteor application has web users , mobile users (on android , ios). reason why need have native applications cordova because need use specific library (that have been coded android , ios). i've developped cordova-plugin bridge between meteor app , library. add cordova-plugin command meteor add cordova:{plugin_name@bitbucket_url/get/commit_hash.tar.gz} . , run app meteor run android-device --verbose build on nexus 5. when @ logs, see no error, see jar files needed in plugin dexed: -dex: [dex] input: /home/raphael/webstormprojects/skyshow/.meteor/local/cordova-build/platforms/android/ant-build/classes [dex] input: /home/raphael/webstormprojects/skyshow/.meteor/local/cordova-build/platforms/android/cordovalib/ant-build/classes.jar [dex] input: /home/raphael/webstormprojects/skyshow/.meteor/local/cordova-build/platforms/android/com.google.playservices/google-play-services_lib/ant-build/classes.jar [dex] input: /home/raphael/webstormprojects/...

excel - Copying and Pasting the Results of a Loop calculation using VBA -

i have vba calculation looping recalculate cells 500 (or whatever iteration is) times. each recalculation there output want record of after loop complete. have tried few different ways can't seem right. here example of have far. private sub commandbutton1_click() dim iteration integer, integer iteration = range("c4") = 1 iteration range("c14,c15,c16,c17,c18,c19,c20").calculate range("c20").copy range("j" & rows.count).end(xlup).offset(1).select.pastespecial xlpastevalues next end sub try this: private sub commandbutton1_click() dim iteration integer, integer dim val variant iteration = range("c4") = 1 iteration range("c14,c15,c16,c17,c18,c19,c20").calculate val = range("c20").value debug.print "i: " & & " val: " & val range("j" & rows.count).end(xlup).offset(1) = val next e...

inline code - how to add jquery to a specific section -

i have jquery code: <script>// <![cdata[ $(document).ready(function() { $('body').rainsnow({ effect_name: 'snow', drop_appear_speed: 200, drop_falling_speed: 8000, wind_direction: 3, drop_rotate_angle : '-10deg', drop_count_width_height:[[22,22], [14,16], [18,20]], drop_left_to_right : false }); }); // ]]></script> i have added script between fullwidth shortcode in wordpress page. want effect show in section contact form section though have added script in between short code displaying on whole of page. how correctly add code display on section want to? the beginning of code says piece of dom tree going applied. explicitly write "body". play this. btw. looks after reading jquery manual on addressing dom elements discover marvellous things.

Best way to migrate Kafka cluster -

i have kafka cluster of 2 nodes. kafka version 0.8.1. need migrate different set of servers. whats best way migrate maintaining no downtime , no data loss? assuming new servers , old servers live in same data center, easiest way add new ones replicas existing partitions have. kafka bring them in sync making them isrs. 1 in-sync should able safely shutdown old nodes. this of course depends on how consumers configured (will automatically find new nodes?) , version of kafka you're on. take at: https://kafka.apache.org/documentation.html#basic_ops_cluster_expansion https://kafka.apache.org/documentation.html#basic_ops_decommissioning_brokers you need use kafka-reassign-partitions.sh tool make happen. test in non-production environment first.

bit manipulation - C# - fast way to compare 2 integers, bit by bit, and output for more than one integer, possible? -

i have 2 input integer numbers , output list< int> myoutputlist. inputs lets say a=0x 110101 b=0x 101100 then have calculated c integer number depending on , b numbers.i coded algorithm, can calculate c integer. c integer shows bits should changed. 1 value represents changing bits, 0 values represents unchanging bits. 1 bit should changed in each time. c integer depends on , b inputs, 1 bit, 3 bits, 8 bits needs changed. in given , b values, have c integer follows c=0x 0 1 00 1 0 (1 represents changing values; second , fifth bits should changed in case) as c integer has value "1" 2 times; there should 2 results in case result 1-changing second bit, other bits same a(0x110101) : change second bit of => d1=1101 1 1 result 2-changing fifth bit, other bits same a(0x110101) : change fifth bit of => d2=1 1 0101 what thinking using loop, shifting , c step step, , using &1 mask c? , check if equal "1" for(i=0;i<32;i++) ...

python - Is this right way to call coroutine method in Tornado framework? -

i have websockethandler in tornado application. not sure right way make code asynchronous. class myhandler(websockethandler): def open(self): ... self.my_coroutine_method() @gen.coroutine def my_coroutine_method(self): user = yield db.user.find_one() # call motor asynchronous engine self.write_message(user) yes, correct. however, in cases calling coroutine without yielding can cause exceptions handled in unexpected ways, recommend using ioloop.current().spawn_callback(self.my_coroutine_method) when calling coroutine non-coroutine this.

arrays - At which memory segment does pointer c+9 point for given function? -

void f() {int *c=(int*)malloc(10);} void f() {int c[10];} i think on in first case c+9 pointing @ element c[9] in array allocated on heap. and second case think c+9 pointing @ same element c[9] of array located on stack. i new programming , not sure if correct answer. help. in both cases behaviour undefined. in case 1 points beyond allocated piece of memory. in case 2 points array allocated on stack , has been popped.

javascript - Floated box drops down when mousing over title text which expands -

please @ screen shot. how stop property box dropping down when mouse on title text , expands? the wbesite url http://luxurymarbellahomes.com/properties/ here url screenshot. https://www.dropbox.com/s/g6w70ibs3zk49zd/screen%20shot%202015-03-16%20at%2019.19.57.png?dl=0 thanks you can use bootstrap classes visible-xs-block visible-sm-block visible-md-block visible-lg-block isolate each row. after each row can add div . tested in developer panel , worked fine.

javascript - jQuery.ripples contained within a box/table -

https://github.com/sirxemic/jquery.ripples/ i've fooled around ripples jquery plugin, though being novice can't seem find way contain ripple effect within specific area (such or something) - can work if set apply entire body of site. i have tried editing ripple controls different css classes, though breaks if change $('body') part else. $(document).ready(function() { try { $('body').ripples({ resolution: 512, dropradius: 20, //px perturbance: 0.04, }); $('main').ripples({ resolution: 128, dropradius: 10, //px perturbance: 0.04, }); } is there way plugin apply area of page? thanks. difficult problem if don't provide code .. anyway, have read first lines of plugin code ? // ripples class definition // ========================= var ripples = function (el, options) { var = this; this.$el = $(el); this.$el.addclass('jquery-ripples'); // if ...

javascript - DNS issue with Ubuntu. Url request works fine in MacOSX, but fails in Ubuntu -

a nodejs script invokes require('request').post() has been written. script works fine in macosx (travis) fails in ubuntu (travis). nodejs 'https' module tested eliminate extraneous variables contribute error. did not work either. /** * upload data coverage server */ exports.upload = function (data, callback) { var url = server + '/v1/coverage'; request.post(url, { form : { type : 'grunt-appc-coverage', data: data }, json: true, agentoptions: false }, function (err, response, body) { console.log(err, response, body); .... return callback(null, success_upload); }); }; this logs ubuntu. request make request https://coverage.appcelerator.com/v1/coverage { [error: getaddrinfo enotfound coverage.appcelerator.com] code: 'enotfound', errno: 'enotfound', syscall: 'getaddrinfo', hostname: 'coverage.appcelerator.com' } undefined u...

visualization - Plot 3D Grid Data as Heat Map using gnuplot -

Image
assume have 5x4x3 3d grid, each cell has value: 0.5523 0.0495 0.1465 0.5386 0.6299 0.4896 0.1891 0.6952 0.0320 0.1925 0.0427 0.4991 0.6147 0.1231 0.6352 0.5358 0.3624 0.2055 0.2819 0.4452 0.1239 0.2085 0.9479 0.6210 0.4904 0.5650 0.0821 0.5737 0.8530 0.6403 0.1057 0.0521 0.8739 0.4170 0.1420 0.9312 0.2703 0.2060 0.1665 0.7287 0.7378 0.8589 0.1339 0.3329 0.0634 0.7856 0.0309 0.4671 0.8604 0.5134 0.9391 0.6482 0.9344 0.1776 0.3013 0.0252 0.9844 0.3986 0.2955 0.8422 how can achieve plot in gnuplot similar plot achieved in matlab using patch ? note grid cells has alpha value of 0.8.

ios - CLGeocoder geocodeAddressString not working with partial place names (i.e. 'Lond' doesn't show 'London') -

i'm trying use apple's clgeocoder search place based on string , latitude/longitude of it. i'm using instant feedback system, type address in, suggestions made beneath search field selection can made from, using function: (void)geocodeaddressstring:(nsstring *)addressstring completionhandler:(clgeocodecompletionhandler)completionhandler however, seems search each space-separated token in exact form opposed part of word. example, if search 'lond', "lond, sheopur, madhya pradesh, india" instead of "london". how can make clgeocoder work partial place names , return 'london' string 'lond'? thanks,

elastica - Elasticsearch php error -

i getting following error when trying insert data {"error":"mapperparsingexception[failed parse [pub]]; nested: mapperparsingexception[failed parse date field [false], tried both date format [dateoptionaltime], , timestamp number locale []]; nested: illegalargumentexception[invalid format: \"false\"]; ","status":400}

jquery - Listen to youtube iframe events using javascript -

i have site list of many embedded youtube videos this <div class="thumbnail"> <iframe width="560" height="315" src="https://www.youtube.com/embed/2szaexbp0ne" frameborder="0" allowfullscreen></iframe> </div> the video list big , changing daily. im looking way capture start video event, can force user accept tos (using popup) before seeing videos. tried place div higher z-index , put onclick event there ,but not working/preventing user watch video. so ended using youtube api few things mention you must use div placeholder video this <div id="video3" class="video3"></div> and may declare callback function fires once video clicked function onyoutubeiframeapiready() { video1 = new yt.player('video1', { height: '315', width: '560', videoid: 'youtubeid', events: { 'onstatechange...

c - getopt isn't working for one argument -

this simple program wrote in order practice getopt, , structs. typedef struct { int age; float body_fat; } personal; typedef struct { const char *name; personal specs; } person; int main(int argc, char *argv[]) { char c; person guy; while((c = getopt(argc, argv, "n:a:b:")) != -1) switch(c) { case 'n': guy.name = optarg; break; case 'a': guy.specs.age = atoi(optarg); break; case 'b': guy.specs.body_fat = atof(optarg); break; case '?': if(optopt == 'a') { printf("missing age!\n"); } else if (optopt == 'b') { printf("missing body fat!\n"); } else if (optopt == 'n') { printf("missing name!\n"); } else { printf("incorre...

github - How to push to a folder within a folder on a private Git Repo -

there's repo granted access it's not own. i want push changes folder within folder: privaterepo/folder1/folder2 i've got local git setup ready push, i set origin url leading 'folder2' (i've removed private information in master i'm using proper url: https://github.com/[group]/[privaterepo]/tree/master/[folder1]/[folder2] but error: fatal: repository 'https://github.com/[group]/[privaterepo]/tree/master/[folder1]/[folder2]' not found so how can add local folder files , sub folders private repo's sub folders? git repositories work whole . since git tracks full contents of working directory single unit, can push full repository, not subfolder of project. so make work, still have clone full repository, , work full project. comes down “discipline” edit files within 1 subfolder if that’s required.

mysql - How can I determine the MySqlException.Number? -

i thinking of creating case statement mysqlexceptions, based on number property. there easy way determine if exception relates specific case? example, number "1062" always refer "duplicate entry"? according mysql documentation answer question is, yes. http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html or 5.6 http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html when in doubt go dev.mysql...

machine learning - How to use the OneVsRestClassifier in Scikit-learn to analyse the performance of predicting each individual class with multi-class classification? -

in onevsrestclassifier documentation on scikit-learn website states following: "since each class represented 1 , 1 classifier only, possible gain knowledge class inspecting corresponding classifier." but gives no explanation of how , can't see how of methods in documentation on page achieve that. want able print out accuracy of model each individual class, can see performance has @ predicting each class. the code have far below, don't know go here, seems there nothing in documentation, explains how this. appreciated. def predict_one_vs_rest(self): clf = onevsrestclassifier(linearsvc(random_state=0)) clf.fit(self.x, self.y) result = clf.classes_ estimators = clf.estimators_ print(result) print("") print(estimators) you don't need wrap linearsvc in onevsrestclassifier. documentation says, linearsvc supports multi-class classification. inspecting accuracy of classes, use confusion matrix or classification re...

css - How to show image inside a button? -

how can make image inside button fit better , higher quality? <button onclick="clipboard(z#emp_ext#);"> <img src="copy-icon.png" style="height:16px;width:16px;"> </button> im using image https://www.iconfinder.com/icons/174935/copy_icon . here how looks code above. i made http://jsfiddle.net/e58s7jpy/ don't show image here. wish post image need 10 reputation ;(. you need save image btter quality enhancing pixels in path refer. hope helps. if happy, vote answer. button div{ width:16px; height:16px; background-image: url(images/ui-icons_d19405_256x240.png); } you can enhance background modification , padding.

.net - C++/CLI - how to marshal "unsigned int&"? -

i've got bunch of c++ functions need wrap managed c++ class. of unmanaged functions return unsigned int values reference. e.g.: int func(....., unsigned int& val , ......); i've got 2 questions: i'd wrapping c++ methods expose "val" such native functions unsigned int (either "ref" or "out"). type should use? "unsigned int %", "uintptr^%", else? how wrapping method declation like? inside managed c++ wrapper method, how should marshal parameter? i've tried multiple combinations along lines of: marshal_context ctx; return origfunc(....., ctx.marshal_as<unsigned int&>(val), ......); but compiler errors complaining unsupported conversions.

changing default resizing property of subplot function of matlab -

i show 3 different figure using subplot. 1 of them original 1 , other 1 oversampled factor of x. subplot resize oversampled image fit , shows original though size x times bigger original one. how can change code show them in actual size. function: function zp_over=zp_oversample(zp,fs,n,f) % zp 2d image, fs sampling frequency, n dimension of image, f used scaling sampling factor % over-sampling , plot x=round(fs/f); zp_ov = zeros(n*x); zp_ov(1:x:end,1:x:end)=zp; figure,subplot(121), imshow(zp_ov); title (' on sampled'); subplot(122);imshow(zp); % original image title('original'); you'll need use 'position' option of "subplot" function manually specify locations , sizes of subplots. for example: figure; subplot('position', [0.35, 0.25, 0.5, 0.6]); % [left, bottom, width, height] imshow(zp_ov); subplot('position', [0.35, 0.15, 0.5, 0.6]); imshow(zp); of course, exact values of coordinates siz...

How to process database changes using Spark Streaming? -

if have rdd depends on database table, how listen db changes through spark streaming , reconstruct rdd when table changes? without reinventing wheel can use http://data.linkedin.com/projects/databus inside spark

javascript - active of a Xlink anchor SVG -

i have 4 anchor xlink inside svg , want active event of each, how can call in js? that looks that: $(document).ready(function() { $('#fullpage').fullpage({ anchors: ['firstpage', 'secondpage', '3rdpage', '4thpage', 'lastpage'], menu: '#timeline', scrollingspeed: 1000, onleave: function(index, nextindex, direction){ $('#bluecircle').css('stroke-dashoffset', (1510/4)*(4-(nextindex-1))); } }); }); html { image-rendering: optimizequality; -webkit-font-smoothing: antialiased; -ms-interpolation-mode: nearest-neighbor } body { height:100%; margin:0; padding:0; overflow:hidden; font-family: 'source_sans_prolight'; } div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre, form,fieldset,input,textarea,p,blockquote,th,td { padding: 0; margin: 0; } ul, { list-style:none; text-decoration:none;...

java - Insert BufferedReader into JTextArea -

dunno if can me out or not. assignment due here in 3 hours , i'm pretty frustrated. cannot file reading display in jtextarea. need do. can out? public class reader extends javax.swing.jframe { /** * creates new form reader */ public reader() { initcomponents(); } public void displaytext(){ jlabel text = new jlabel(); add(text); } /** * method called within constructor initialize form. * warning: not modify code. content of method * regenerated form editor. */ @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="generated code"> private void initcomponents() { jlabel1 = new javax.swing.jlabel(); jscrollpane1 = new javax.swing.jscrollpane(); jtextarea1 = new javax.swing.jtextarea(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close); jlabel1.setfont(new java.awt.font("tahoma", 0, 18)); // noi18n jlabel1.settext(...

MySQL MAX() function returns wrong associated value -

i've tried various queries , read different answers , nothing seems give i'm looking for. advice appreciated. i have table items, dates , quantities. each item, need latest date , associated quantity. table looks this: item date qty 1234 2014-12-22 300 1234 2015-02-13 500 after running query: select item, max(date), qty table group item i this: item date qty 1234 2015-02-13 300 instead of qty of 500 . i've tried couple of different solutions including this , this . first 1 gave records null in date . second 1 seems work, until try sum(qty) (there can multiple qty item on given date ). since solution sorts date descending, , not cut out data, doesn't in scenario. why original query not work? other ideas? thanks! of course does. need join want: select t.* table t join (select item, max(date) maxd table t group item ) tmax on t.item = tmax.item , t.date = tmax.maxd; you...

xml - Simple Android Layout Resize -

i'm attempting resize buttons on rotate expand proportionately. right now, fix length, i'm unsure of alternative method buttons resize (setting weight doesn't seem help). want buttons fill length of screen both vertically , horizontally. please let me know if need more information. <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="5dp" android:layout_gravity="center_vertical" > <button android:id="@+id/maincommentbtn" android:layout_width="119dp" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:clickable="true" android:focusable="false" android:focusableintouchmode="false" ...

html - Chrome file upload bug: file name goes wrong when choose for the second time -

i working on simple web page file upload control: <input type="file" name="file"> and when test it, find strange bug: when choose file disk second time, file name go wrong. for example, when choose e:\tmp\123456789012345.jpg , value of input c:\fakepath\123456789012345.jpg , correct. if click browse button again , choose file e:\tmp\a.jpg , value of input become c:\fakepath\45.jpg , causing file not found error afterwards. after repeated test different files, find out bug occurs when choose file longer file name, , choose shorter file name. also, broken file name "suffix" of longer file name (chosen @ first time), , broken_file_name.length + correct_file_name.length == long_file_name - 4 . an example case , corresponding console output: // first, choose e:\tmp\123456789012345.jpg >$('input[name="file"]').val() <"c:\fakepath\123456789012345.jpg" >$('input[name="file"]').val().len...

excel - VBA Set Cell value to text containing ' not working -

i'm trying macro type out heap of formulae me. formula goes this: =countif('other_sheet'!a:a,"hello*") the user can specify , other_sheet, select cell , go activecell.value = "=countif('" & othercell & "'!" & column & ":" & _ column & """,hello*"")" but keeps giving me errors like: 1004: object defined error i have tried using activecell.text , activecell.formula etc. , don't work. it needs activecell.formula , ", wrong way around next hello . should be: activecell.formula= "=countif('" & othercell & "'!" & column _ & ":" & column & ",""hello*"")"

Need to pass data to hidden text field in Selenium -

i got below solution here, jse.executescript("document.getelementsbyname('body')[0].setattribute('type', 'text');"); and passing data using sendkeys . but creating duplicate text field text attribute , hidden text field still exist.. you have 2 input tags. assuming want execute script against second 1 not first. also, using queryselector , allows pass cssselector identify element want. note: make sure format of datetopass correct string datetopass = "01/01/2015"; string scripttext = "document.queryselector('.propertyyear.require').setattribute('value','" + datetopass + "')"; ((javascriptexecutor)driver).executescript(scripttext);

objective c - iPhone 6 iOS 8 keyboard not showing while the UITextField is active -

this happening real iphone 6 device , not simulator. in application, view controllers supports both portrait , landscape orientations. application working fine on iphone 5 (ios 8). on iphone 6 when change orientation portrait landscape , portrait , after pushing next view controller keyboard not showing while uitextfield active. keyboard not showing on screen @ when tapped on bottom shows digits being written on textfield. keyboards position has changed , not visible on screen @ all. have not optimised application iphone 6 , using native scaling. can suggest me possible solution??? this bug of ios simulator. to see keyboard, press cmd (⌘) + k you done.

javascript - html doesnt render in partial view -

following code using render html view. @{ layout = null; } <script type="text/javascript"> $(document).ready(function () { debugger; $("#divchart").load('http://localhost/abcd.portal/barchart.html'); }); </script> <div style="width: 100%;" id="divchart"></div> html trying load <style> .bar { fill: steelblue; } .bar:hover { fill: brown; } .axis { font: 10px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispedges; } .x.axis path { display: none; } </style> <body> <script> debugger; var margin = { top: 20, right: 20, bottom: 30, left: 40 }, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; ...

fullcalendar: eventLimitClick -- execute a url -

on "+17 more" link, want open url of chosing specific date. i'm not finding documentation have example, , know must easy (because else has been!). found it... eventlimitclick: function(cellinfo) { if (cellinfo.date) { var newdate = moment(cellinfo.date).format('yyyy-mm-dd'); window.open('url-i-am-calling?variables, "_blank"); return false; } },

javascript - JqGrid tables reloading after editing and saving any row -

i have 4 jqgrid tables in php file , passsing different json array each grid tables.the data displaying on grid 1 table different sql conditions. i using inline editing functionality grids , when edit , save row table1, want grids should refresh if row edited exists in next tables should vanished automatically. want reload grid tables after editing row in table. have written following code: <table id="jqgrid"></table> <div id="pjqgrid"></div> <table id="jqgrid1"></table> <div id="pjqgrid1"></div> <table id="jqgrid2"></table> <div id="pjqgrid2"></div> <table id="jqgrid3"></table> <div id="pjqgrid3"></div> <script> pagesetup(); var myeditoptions = { keys: true, successfunc: function (response) { // alert(json.stringify(response)); var msg=response.responsetext; va...

ruby - Chefspec loads libraries repeatedly and gives the warning "already initialized constant CONSTANT" -

i have chef cookbook library, e.g. library.rb . contains constant : constant = 'constant' when write unit tests cookbook, gives me warning: (some prefix...)warning: initialized constant constant (some prefix...)warning: previous definition of constant here the warnings come repeatedly, many times number of examples (test cases) minus one. think because chefspec loads libraries once each example. tell me how make libraries load once, or how disable warning message? short term, change to: constant ||= 'constant' long term, it's better use let() , or move constant out of test case, or choose other way of replacing constant, or ensure testing code loads library once, not many times. edit -- point @sawa in comments: if constant nil or false , ||= approach doesn't stop warnings, you'll want better solution such as: constant = 'constant' unless defined? constant

sql server - Trigger of Batch Update -

i have 3 tables , trigger in purchase table. user (userid | balance) purchase (purchaseid | userid | amount | isconfirm) transactiondetail (trxid | userid | balance |amount) when purchase isconfirm updated false true, want trigger update player balance , insert new record(s) transactiondetail. i have bulk update statement: update purchase set isconfirm = true userid=1 i know trigger fired once batch update. if there 5 rows updated, there 1 row inserted transactiondetail table, , balance not updated correctly. if there 5 rows affected in batch update, using trigger, there way insert 5 updated rows transactiondetail , update user balance correctly?

ExtJS Integration of CKEditor -

we plan use extjs ckeditor. i saw there port of tinymce extjs. is possible write ckeditor wrapper extjs? what concerned event handling (extjs defines own implementation). i found information tinymce port extjs: https://github.com/qtx/tinymcetextarea5/blob/master/doc/instructions.pdf thank sharing experience topic in advance. there extension extjs 3 available on github: https://github.com/tocco/extjs3-ckeditor-extension we use in production, works fine.

ios - Changing the state of the CollectionView Cell -

- (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath{ //nslog(@"enter category cell"); categoryviewcell* cell = (categoryviewcell*)[collectionview dequeuereusablecellwithreuseidentifier:cellidentifier forindexpath:indexpath]; [cell.imgcat setimage:[uiimage imagenamed:[categoryimages objectatindex:indexpath.row]]]; [cell.labelcatname settext:[[nsstring stringwithformat:@"%@", [catname objectatindex:indexpath.row]] capitalizedstring]]; if([categories[[nsstring stringwithformat:@"%d",(int)indexpath.row]] isequal:@yes]) { //nslog(@"set border"); cell.layer.bordercolor = [uicolor redcolor].cgcolor; cell.layer.borderwidth = 3; } return cell; } -(void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { categoryviewcell* cell = (categoryviewcell*)[collectionview cellfori...

c# - Uploading data to two different tables MVC 4 -

i developing application requires user profile creation. though mvc 4 templates has built-in option authorization , authentication. want save more info of users. created user profile table having user_id primary attribute , more attributes. not saving user profile picture in same table user data. saving table called file_master having file id primary attribute. what created far user controller , created views crud ops. here created new field profile picture submit button. submitting selected image db created action method on same controller. now scenario is, whenever click upload image button, action method create being hit, suppose action method upload should hit. how solve issue? lil sample appreciated. it seems problem view responsible uploading image. check action of form , ensure linked action method want. and rest of work, take @ following link see how store images in database https://stackoverflow.com/questions/17966503/how-to-insert-an-image-into-sql-se...

regex - Apache Redirect setting https to http and matching & not matching -

i confusing redirect setting apache. looks simple can’t figure out… under http access if carts/ , events/* need redirect https i adding setting in sites-enabled/default-http.conf <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri} ^/carts/ [or] rewritecond %{request_uri} ^/events/* rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [r,l] </ifmodule> under https access if not carts/ , events/* need redirect http i adding setting in sites-enabled/default-https.conf <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri} !(^/carts/) [or] rewritecond %{request_uri} !(^/events/*) rewriterule ^(.*)$ http://%{http_host}%{request_uri} [r,l] </ifmodule> the problem this http working https not work. https://test.com/test should redirect http://test.com/test first of avoid restart of apache enable .htaccess (if not enabled already) use these rules in site root .htaccess: rewr...

asp.net - Android JSON string server not show arabic character -

i write simple app in android,but when send arabic character json asp.net server page,in server not known arabic character , show me this: ["????"] encode arabic string , send string, public static string getencodedstring(string str) { string ret = null; try { ret = base64.encode(str.getbytes("utf-8")); } catch (exception e) { e.printstacktrace(); } return ret; }

yii2 - User role in gridview -

how print user role in yii 2 gridview widget? i've tried code: public function getuserrole($id) { $roles = \yii::$app->authmanager->getrolesbyuser($id); $role = ''; foreach($roles $key => $value) { $role = $key; } return $this->role = $role; } in user model class it's not working. each user has assigned 1 role. many help. ok, got it! view: <?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], //'id', [ 'label' => 'nazwa użytkownika', 'value' => 'username' ], //'auth_key', //'password_hash', //'password_reset_token', 'email:email', [ 'label' => 'rola',...

c++ - how to use maidsafe-rudp as part of my project? -

i download source code in https://github.com/maidsafe/maidsafe-rudp . i built , compiled source code , got link library. not know how program interface while client cannot communicate server,as listed below: int setupnetwork(){ endpointpair endpoints0,endpoints1; endpoints0.local=endpoint(boost::asio::ip::address::from_string("127.0.0.1"),2468); endpoints1.local=endpoint(boost::asio::ip::address::from_string("127.0.0.1"),4268); nodeid chosen_node_id,node_chosen_bootstrap_peer; int result0; maidsafe::rudp::helper::node node(34); result0=node.bootstrap(std::vector<endpoint>(1,endpoints0.local),chosen_node_id, endpoints1.local);//here cut <node.bootstrap> sample-code if(result0==kbinderror){ std::cerr<<"errorx1\n\n\n\n"; } if(result0!=ksuccess){ std::cerr<<"errorx2\n\n\n"; //------->> question one:i cannot handle problem return setupnetwork(); }else { std::cout...

unity3d - Canvas Screen Scaling with script Instantiated objects? -

Image
can explain me why, when in editor instantiated shop ui looks wonderful (left) when running on device (right), looks squished?, (please excuse dodgy cam picture!): the ui bars prefabs, containing individual canvas's , various ui elements. each of canvases manually set use screen scaling, reference resolution set x: 320 y: 480, , set use width basis scaling. has proved work brilliantly in previous games, 1 doesn't seem hold. i've manually set each of instantiated objects' properties scaling in script, still nothing. the thing i'm doing differently building ui @ runtime instantiating ui prefabs , filling them when shop created. has seen before? know how fix it? when instantiate prefab in code , add prefab parent, unity ui system tries compenstate difference between size of prefab when created , size should after canvas scaler update. when in code use extension: public static void setparentandreset(this recttransform rect, transform parent) { ...

c# - Cannot get Gridview header on PDF in ASP.NET -

i trying add pdf asp page, takes value gridview onto pdf. however, can values apart header. there seem space on top nothing there. have practically copied code here . html markup : <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" cellpadding="4" forecolor="#333333" gridlines="none" width="100%" allowpaging="true" datakeynames="enrollecode" onpageindexchanging="gridview1_pageindexchanging" onrowcommand="gridview1_rowcommand" onrowdeleting="gridview1_rowdeleting" onselectedindexchanged="gridview1_selectedindexchanged" onrowediting="gridview1_rowediting" pagersettings-pagebuttoncount="20"> <alternatingrowstyle backcolor="white" forecolor="#284775" /> <columns> ...