query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
10321f2e6d15845e630e116cf01d9faddf1acb36b77cb0dba57dcc40533089ed
['af88a89eb55d488eb0f7387674f1c273']
On my main page, I have 3 links (images). Like a portal. This is what i want to make: When you click on one of the links, you zoom really far onto that one. So far that it filled up the full screen. But I dont want you to see whats in that page yet. Example: http://prezi.com/0ehjgvtr9fzu/?utm_campaign=share&utm_medium=copy (click on the cloud which says:"Main idea") Is this possible with HTML/CSS/JavaScript?
30961f5f6fdb8b298f3eb7258a1ca65b171e8baf57e79f00132db540746666f6
['af88a89eb55d488eb0f7387674f1c273']
I would like to get the usergroup from my database, and then check if it is 2 (which would mean its an Admin). I currently have this code as setup: Login.php <?php //process login form if submitted if(isset($_POST['submited'])){ $username = trim($_POST['username']); $password = trim($_POST['password']); if($user->login($username,$password)){ //logged in return to index page $_SESSION['login'] = "$username"; header('Location: index.php'); exit; } else { $message = '<p class="error">Wrong username or password</p>'; } }//end if submit if(isset($message)) { echo $message; } ?> <div class="lockscreen-credentials"> <form class="form-signin" role="form" method="post" action=""> <input type="text" class="form-control" name="username" placeholder="Username" required autofocus> <div class="input-group"> <input type="password" class="form-control" placeholder="password" name="password" required/> <div class="input-group-btn"> <button class="btn btn-flat" name="submited"><i class="fa fa-arrow-right text-muted"></i></button> </div> </div></form> </div><!-- /.lockscreen credentials --> And this is the class that is called (class.user.php): public function login($username,$password){ $hashed = $this->get_user_hash($username); *$st = $this->_db->prepare('SELECT userGroup FROM users WHERE username = :username'); $st->execute(array('userGroup' => 2)); $rows = $st->fetch(); if($st = 2) { $_SESSION['loggedin'] = true; return true; }* } public function logout(){ session_destroy(); } As you can see the code, within the stars (*), is where I am trying to check whether the field's value is 2. If so I want it to log in. If not, i want it to redirect. My error is: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined' in D:*****\classes\class.user.php:42 Stack trace: #0 D:******\classes\class.user.php(42): PDOStatement->execute(Array) #1 D:*******\login.php(43): User->login('demo', 'demo') #2 {main} thrown in D:*******\classes\class.user.php on line 42
2c8bdcfa598418912bc7da997379d42d3f6bac714b669809c2472fc20ee3810a
['af98939327df44f8841adfc5ae621b26']
Installing HTK: I went through a very very tough time installing HTK on my computer. This documentation will be helpful in installing it on any other computer. Prequesities: You should have a visual studio installed with c++ distribution. (Don’t just download MSVC). Download complete C++ distribution. Download HTK Source code and HTK Samples. Download and install Perl Download any extracting software like( 7-zip) Prior Steps: Extract your HTK and HTK sample and keep it in two different directories. (Apart from each other) Open VS and go on tool→ command line → any command prompt(I selected Developer command prompt) Installing steps cd into the directory in which you unpacked the sources.(source code and not the sample) Execute the below commands one after the other. cd htk mkdir bin.win32 cd HTKLib nmake /f htk_htklib_nt.mkf all cd .. Build the HTK Tools cd HTKTools nmake /f htk_htktools_nt.mkf all cd .. cd HLMLib nmake /f htk_hlmlib_nt.mkf all cd .. cd HLMTools nmake /f htk_hlmtools_nt.mkf all cd .. After this go to your bin.win32 folder and copy all the files to your Sample directory inside HTKDemo. cd into the directory HTKDemo and execute the command: perl runDemo.pl configs/monPlainM1S1.dcf Now you might find errors like hmm does not exist or such files does not exist when you execute this . Just type mkdir (missing filename without parentheses) And continue to do it until no errors are found And soon you have reached the final stage : Success. I know the documentation of current HTK is way too outdated and misleading but the stackoverflow community helped me to get through it. I am attaching some links that might be helpful: http://htk.eng.cam.ac.uk/docs/inst-win.shtml https://ubuntuforums.org/showthread.php?t=1092317&page=2 https://ubuntuforums.org/archive/index.php/t-1522471.html HTK installing in windows10 / Not able to find VC98 https://ubuntuforums.org/showthread.php?t=1522471
4fed00f9aee1c54013efd7719c8e3022689caf6494683d4367ee98c8bb5c8292
['af98939327df44f8841adfc5ae621b26']
There were three main issues with your code. 1) You were using "I" instead of "i" which resulted in an error. 2) Your print statement of hex_calculator was out of the function. (Indentation error) 3)You were popping the elements so actual your list was blank before you passed it into hex_calculator. Your code should look something like this for getting expected output: def decimal_calculator(binary): decimal = 0 for i in range(len(binary)): digit = binary[i] if digit == '1': decimal = decimal + pow(2, i) print("The decimal value of the binary number is: ", decimal) def hex_calculator(binary): decimal = 0 for i in range(len(binary)): digit = binary[i] if digit == '1': decimal = decimal + pow(2, i) print("The decimal value of the binary number is: ", decimal) def main(): binary = list(input("Input a binary number: ")) decimal_calculator(binary) #print(binary)--> for getting idea of the list. hex_calculator(binary) main() Your output will be as shown in the image.
35e48a664dbf7f84c71da9b7118efcfbc0f9774509c258195217c3d9220a5c00
['af997b1430ae4641953b81b7d2cd8e05']
remote: error https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz: Integrity check failed for "loader-utils" (computed integrity doesn't match our records, got "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== sha1-xXm140yzSxp07cbB+za/o3HVphM=") remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. remote: remote: ! remote: ! Precompiling assets failed.
682ae2d2091c87dcc9150780933b6349bb412522d46ca2278a8c7d0df44d908c
['af997b1430ae4641953b81b7d2cd8e05']
I'm using this active record query it was working well @deal = Deal.where('city_id = ?', city).where('deal_date <= ? and end_date >= ?', today, today).where('approved = ?', true).includes(:city).last After I updated to Rails 4.0.2 I got this on my browser: near "SELECT": syntax error And the following error on (web brick server) Started GET "/seattle" for <IP_ADDRESS> at 2014-02-01 06:36:28 -0800 ActiveRecord<IP_ADDRESS>SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by DealsController#show as HTML Parameters: {"city_name"=>"seattle"} User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."remember_token" = '00a7213ca6566ff5871c87901f2c37e781366b3b' LIMIT 1 (0.1ms) SELECT COUNT(*) FROM "cities" WHERE "cities"."search_name" = 'seattle' DEPRECATION WARNING: It looks like you are eager loading table(s) (one of: deals, cities) that are referenced in a string SQL snippet. For example: Post.includes(:comments).where("comments.title = 'foo'") Currently, Active Record recognizes the table in the string, and knows to JOIN the comments table to the query, rather than loading comments in a separate query. However, doing this without writing a full-blown SQL parser is inherently flawed. Since we don't want to write an SQL parser, we are removing this functionality. From now on, you must explicitly tell Active Record when you are referencing a table from a string: Post.includes(:comments).where("comments.title = 'foo'").references(:comments) If you don't rely on implicit join references you can disable the feature entirely by setting `config.active_record.disable_implicit_join_references = true`. (called from show at /Users/zekarias/Desktop/rails_project/helpon/app/controllers/deals_controller.rb:27) SQL (0.5ms) SELECT "deals"."id" AS t0_r0, "deals"."name" AS t0_r1, "deals"."regular_price" AS t0_r2, "deals"."initial_discount" AS t0_r3, "deals"."max_discount" AS t0_r4, "deals"."max_threshold" AS t0_r5, "deals"."approved" AS t0_r6, "deals"."deal_date" AS t0_r7, "deals"."blurb_title" AS t0_r8, "deals"."blurb" AS t0_r9, "deals"."tipping_point" AS t0_r10, "deals"."end_date" AS t0_r11, "deals"."company_id" AS t0_r12, "deals"."created_at" AS t0_r13, "deals"."updated_at" AS t0_r14, "deals"."photo_file_name" AS t0_r15, "deals"."photo_content_type" AS t0_r16, "deals"."photo_file_size" AS t0_r17, "deals"."photo_updated_at" AS t0_r18, "deals"."price" AS t0_r19, "deals"."amount_raised" AS t0_r20, "deals"."deal_type" AS t0_r21, "deals"."city_id" AS t0_r22, "deals"."weekend" AS t0_r23, "cities"."id" AS t1_r0, "cities"."name" AS t1_r1, "cities"."search_name" AS t1_r2, "cities"."state_id" AS t1_r3, "cities"."created_at" AS t1_r4, "cities"."updated_at" AS t1_r5 FROM "deals" LEFT OUTER JOIN "cities" ON "cities"."id" = "deals"."city_id" WHERE (city_id = SELECT "cities".* FROM "cities" WHERE "cities"."search_name" = 'seattle') AND (deal_date <= '2014-02-01' and end_date >= '2014-02-01') AND (approved = 't') ORDER BY "deals"."id" DESC LIMIT 1 SQLite3<IP_ADDRESS>SQLException: near "SELECT": syntax error: SELECT "deals"."id" AS t0_r0, "deals"."name" AS t0_r1, "deals"."regular_price" AS t0_r2, "deals"."initial_discount" AS t0_r3, "deals"."max_discount" AS t0_r4, "deals"."max_threshold" AS t0_r5, "deals"."approved" AS t0_r6, "deals"."deal_date" AS t0_r7, "deals"."blurb_title" AS t0_r8, "deals"."blurb" AS t0_r9, "deals"."tipping_point" AS t0_r10, "deals"."end_date" AS t0_r11, "deals"."company_id" AS t0_r12, "deals"."created_at" AS t0_r13, "deals"."updated_at" AS t0_r14, "deals"."photo_file_name" AS t0_r15, "deals"."photo_content_type" AS t0_r16, "deals"."photo_file_size" AS t0_r17, "deals"."photo_updated_at" AS t0_r18, "deals"."price" AS t0_r19, "deals"."amount_raised" AS t0_r20, "deals"."deal_type" AS t0_r21, "deals"."city_id" AS t0_r22, "deals"."weekend" AS t0_r23, "cities"."id" AS t1_r0, "cities"."name" AS t1_r1, "cities"."search_name" AS t1_r2, "cities"."state_id" AS t1_r3, "cities"."created_at" AS t1_r4, "cities"."updated_at" AS t1_r5 FROM "deals" LEFT OUTER JOIN "cities" ON "cities"."id" = "deals"."city_id" WHERE (city_id = SELECT "cities".* FROM "cities" WHERE "cities"."search_name" = 'seattle') AND (deal_date <= '2014-02-01' and end_date >= '2014-02-01') AND (approved = 't') ORDER BY "deals"."id" DESC LIMIT 1 Completed 500 in 123ms SQLite3<IP_ADDRESS>SQLException - near "SELECT": syntax error:
ef18d28b2b372ae150157651271e70c88d17ce8139ff34f6717eee964eb238fb
['afb477a3903e424db497f3fbfdce5772']
@Tim High availability would be nice, something like 99.9% is good enough. Cost is certainly a factor (I'm a poor plebeian student), but having good performance is more important to me than slightly higher costs. The user will spend most of his time on a map (I'm using Google Maps JavaScript API), so it will be highly dynamic with continuous ajax calls.
b519b040486e0c4e8d51fb40b8f4f578d12deeb1bab9636e4c6faa20031aa284
['afb477a3903e424db497f3fbfdce5772']
I am using PGTune to help tune my web application using PostgreSQL 9.5 Some background - The web app is a real estate search site, with up to 200 active users during the day performing fairly complex location-based queries. GeoDjango is used to host the site. My question is about tuning work_mem and max_connections. In PGTune, I noticed that when I increase max_connections, the recommended work_mem decreases. I had several questions in mind: As a rule of thumb, should you keep max_connections as low as possible, to allow for more work_mem to be freed up for better performance for each individual query? For a website with up to 200 active users at a time, constantly performing queries - what number of max_connections I should have? I currently have my max_connections set to 500 and the recommended work_mem by PGTune is 8388kB. Is it worth reducing max_connections to 400 or maybe 300, which allows me to increase work_mem?
1476bac9b73ec6e5be861e72f212f988bac51f81a6c4543b7a220846dc5d6072
['afb57c5a4dd044c6a5bae1e601205c58']
These warning messages implies that you are not getting the result in "$ejecutar". That means your query was not working. There may be some issue with your connection variable, check it again. For testing, you can print the $ejecutar directly as : print_r($ejecutar); This will return the object result if it does not return an object than either your query is not running or query is wrongly typed. To further check the query you can directly run the query on mysqli server.
8e4721b0996a1b1fdb24ea7cd0a7b2f945b469812b34ada6505761348f38cfd7
['afb57c5a4dd044c6a5bae1e601205c58']
From reading your code I think you have unnecessarily provided the $counter variable.Try this modified code: $attributes_list = []; foreach($features_cuts_list as $k => $features_cut) { $inner_counter = 0; if ($features_cut["selectedid"] != "") { $title_to_get = $features_cut["features_cuts_id"]; /* Gets the name of the box that is checked */ $query = "SELECT title FROM features_cuts_translations WHERE lang = '$lang' AND features_cuts_id = '$title_to_get' LIMIT 1;"; $result = mysql_query($query) or die("Cannot query"); $attribute_name = mysql_fetch_row($result); foreach ($attribute_name as $q) { array_push($attributes_list, $q); } $counter++; } else { } } If not completely, it will mostly solve your issue. Let me know what the result are , after running this piece of code.
60cdd7d184d48942916268b8b8323b372862795d49c74b282f7edddd9b1a700a
['afc1b3b17c2c47a29dedb0c8ff41fd39']
Sorry! The first one, from $Imd*_{i+1}=Kerd*_{i}$ we do not have $Im(d*_{i+1}\otimes 1)=Ker(d*_{i}\otimes 1)$. Could you explain it more than that? I think that it is equal. The second one, I just wanna ask that it sill be called cohomology or not? I mean it is cohomology or homology because when we take the $Hom(B,-)$ the index of semi-exact sequence is not reserved so we do not call it being cohomology, right? Just homology
f4224bb973a6c73e528fea2ec72ca550190f79853e0fcac98872d9b0b976b053
['afc1b3b17c2c47a29dedb0c8ff41fd39']
Доброго времени суток, господа. Предварительно хотелось бы уточнить, что c js особо не дружим) В общем такая ситуация. В коде где-то прописана функция, которая отвечает за автоматическую перемотку слайдов. Был бы очень признателен Вам, если бы помогли мне в поисках) jquery.cycle2.js: /*! carousel transition plugin for Cycle2; version: 20130528 http://jquery.malsup.com/cycle2/demo/carousel.php */ jQuery.noConflict(); (function(jQuery) { "use strict"; jQuery( document ).on('cycle-bootstrap', function( e, opts, API ) { if ( opts.fx !== 'carousel' ) return; API.getSlideIndex = function( el ) { var slides = this.opts()._carouselWrap.children(); var i = slides.index( el ); return i % slides.length; }; // override default 'next' function API.next = function() { var count = opts.reverse ? -1 : 1; if ( opts.allowWrap === false && ( opts.currSlide + count ) > opts.slideCount - opts.carouselVisible ) return; opts.API.advanceSlide( count ); opts.API.trigger('cycle-next', [ opts ]).log('cycle-next'); }; }); jQuery.fn.cycle.transitions.carousel = { // transition API impl preInit: function( opts ) { opts.hideNonActive = false; opts.container.on('cycle-destroyed', jQuery.proxy(this.onDestroy, opts.API)); // override default API implementation opts.API.stopTransition = this.stopTransition; // issue #10 for (var i=0; i < opts.startingSlide; i++) { opts.container.append( opts.slides[0] ); } }, // transition API impl postInit: function( opts ) { var i, j, slide, pagerCutoffIndex, wrap; var vert = opts.carouselVertical; if (opts.carouselVisible && opts.carouselVisible > opts.slideCount) opts.carouselVisible = opts.slideCount - 1; var visCount = opts.carouselVisible || opts.slides.length; var slideCSS = { display: vert ? 'block' : 'inline-block', position: 'static' }; // required styles opts.container.css({ position: 'relative', overflow: 'hidden' }); opts.slides.css( slideCSS ); opts._currSlide = opts.currSlide; // wrap slides in a div; this div is what is animated wrap = jQuery('<div class="cycle-carousel-wrap"></div>') .prependTo( opts.container ) .css({ margin: 0, padding: 0, top: 0, left: 0, position: 'absolute' }) .append( opts.slides ); opts._carouselWrap = wrap; if ( !vert ) wrap.css('white-space', 'nowrap'); if ( opts.allowWrap !== false ) { // prepend and append extra slides so we don't see any empty space when we // near the end of the carousel. for fluid containers, add even more clones // so there is plenty to fill the screen // @todo: optimzie this based on slide sizes for ( j=0; j < (opts.carouselVisible === undefined ? 2 : 1); j++ ) { for ( i=0; i < opts.slideCount; i++ ) { wrap.append( opts.slides[i].cloneNode(true) ); } i = opts.slideCount; while ( i-- ) { // #160, #209 wrap.prepend( opts.slides[i].cloneNode(true) ); } } wrap.find('.cycle-slide-active').removeClass('cycle-slide-active'); opts.slides.eq(opts.startingSlide).addClass('cycle-slide-active'); } if ( opts.pager && opts.allowWrap === false ) { // hide "extra" pagers pagerCutoffIndex = opts.slideCount - visCount; jQuery( opts.pager ).children().filter( ':gt('+pagerCutoffIndex+')' ).hide(); } opts._nextBoundry = opts.slideCount - opts.carouselVisible; this.prepareDimensions( opts ); }, prepareDimensions: function( opts ) { var dim, offset, pagerCutoffIndex, tmp; var vert = opts.carouselVertical; var visCount = opts.carouselVisible || opts.slides.length; if ( opts.carouselFluid && opts.carouselVisible ) { if ( ! opts._carouselResizeThrottle ) { // fluid container AND fluid slides; slides need to be resized to fit container this.fluidSlides( opts ); } } else if ( opts.carouselVisible && opts.carouselSlideDimension ) { dim = visCount * opts.carouselSlideDimension; opts.container[ vert ? 'height' : 'width' ]( dim ); } else if ( opts.carouselVisible ) { dim = visCount * jQuery(opts.slides[0])[vert ? 'outerHeight' : 'outerWidth'](true); opts.container[ vert ? 'height' : 'width' ]( dim ); } // else { // // fluid; don't size the container // } offset = ( opts.carouselOffset || 0 ); if ( opts.allowWrap !== false ) { if ( opts.carouselSlideDimension ) { offset -= ( (opts.slideCount + opts.currSlide) * opts.carouselSlideDimension ); } else { // calculate offset based on actual slide dimensions tmp = opts._carouselWrap.children(); for (var j=0; j < (opts.slideCount + opts.currSlide); j++) { offset -= jQuery(tmp[j])[vert?'outerHeight':'outerWidth'](true); } } } opts._carouselWrap.css( vert ? 'top' : 'left', offset ); }, fluidSlides: function( opts ) { var timeout; var slide = opts.slides.eq(0); var adjustment = slide.outerWidth() - slide.width(); var prepareDimensions = this.prepareDimensions; // throttle resize event jQuery(window).on( 'resize', resizeThrottle); opts._carouselResizeThrottle = resizeThrottle; onResize(); function resizeThrottle() { clearTimeout( timeout ); timeout = setTimeout( onResize, 20 ); } function onResize() { opts._carouselWrap.stop( false, true ); var slideWidth = opts.container.width() / opts.carouselVisible; slideWidth = Math.ceil( slideWidth - adjustment ); opts._carouselWrap.children().width( slideWidth ); if ( opts._sentinel ) opts._sentinel.width( slideWidth ); prepareDimensions( opts ); } }, // transition API impl transition: function( opts, curr, next, fwd, callback ) { var moveBy, props = {}; var hops = opts.nextSlide - opts.currSlide; var vert = opts.carouselVertical; var speed = opts.speed; // handle all the edge cases for wrapping & non-wrapping if ( opts.allowWrap === false ) { fwd = hops > 0; var currSlide = opts._currSlide; var maxCurr = opts.slideCount - opts.carouselVisible; if ( hops > 0 && opts.nextSlide > maxCurr && currSlide == maxCurr ) { hops = 0; } else if ( hops > 0 && opts.nextSlide > maxCurr ) { hops = opts.nextSlide - currSlide - (opts.nextSlide - maxCurr); } else if ( hops < 0 && opts.currSlide > maxCurr && opts.nextSlide > maxCurr ) { hops = 0; } else if ( hops < 0 && opts.currSlide > maxCurr ) { hops += opts.currSlide - maxCurr; } else currSlide = opts.currSlide; moveBy = this.getScroll( opts, vert, currSlide, hops ); opts.API.opts()._currSlide = opts.nextSlide > maxCurr ? maxCurr : opts.nextSlide; } else { if ( fwd && opts.nextSlide === 0 ) { // moving from last slide to first moveBy = this.getDim( opts, opts.currSlide, vert ); callback = this.genCallback( opts, fwd, vert, callback ); } else if ( !fwd && opts.nextSlide == opts.slideCount - 1 ) { // moving from first slide to last moveBy = this.getDim( opts, opts.currSlide, vert ); callback = this.genCallback( opts, fwd, vert, callback ); } else { moveBy = this.getScroll( opts, vert, opts.currSlide, hops ); } } props[ vert ? 'top' : 'left' ] = fwd ? ( "-=" + moveBy ) : ( "+=" + moveBy ); // throttleSpeed means to scroll slides at a constant rate, rather than // a constant speed if ( opts.throttleSpeed ) speed = (moveBy / jQuery(opts.slides[0])[vert ? 'height' : 'width']() ) * opts.speed; opts._carouselWrap.animate( props, speed, opts.easing, callback ); }, getDim: function( opts, index, vert ) { var slide = jQuery( opts.slides[index] ); return slide[ vert ? 'outerHeight' : 'outerWidth'](true); }, getScroll: function( opts, vert, currSlide, hops ) { var i, moveBy = 0; if (hops > 0) { for (i=currSlide; i < currSlide+hops; i++) moveBy += this.getDim( opts, i, vert); } else { for (i=currSlide; i > currSlide+hops; i--) moveBy += this.getDim( opts, i, vert); } return moveBy; }, genCallback: function( opts, fwd, vert, callback ) { // returns callback fn that resets the left/top wrap position to the "real" slides return function() { var pos = jQuery(opts.slides[opts.nextSlide]).position(); var offset = 0 - pos[vert?'top':'left'] + (opts.carouselOffset || 0); opts._carouselWrap.css( opts.carouselVertical ? 'top' : 'left', offset ); callback(); }; }, // core API override stopTransition: function() { var opts = this.opts(); opts.slides.stop( false, true ); opts._carouselWrap.stop( false, true ); }, // core API supplement onDestroy: function( e ) { var opts = this.opts(); if ( opts._carouselResizeThrottle ) jQuery( window ).off( 'resize', opts._carouselResizeThrottle ); opts.slides.prependTo( opts.container ); opts._carouselWrap.remove(); } }; })(jQuery);
227c81ffa93f860685861191febf4797331e85a0f0aed828568e65c12899670e
['afc98c95386640fda2c053875281f66f']
Also, I should have mentioned that I am at a satellite branch in a different state from the main corporate office where my team lead is. I had no choice but to use email or a phone call. I spent a lot of time on the letter trying to make sure it contained the correct reasons for why I think I deserve a raise - how I helped the company's bottom line etc. I emailed this letter.
473054cb38db01bc4315e622bd2ff6d405d58c1fd880bd3650cced780ede6d07
['afc98c95386640fda2c053875281f66f']
Yeah, there seems to be something different about mobile versions of Chrome and Firefox. I tried testing with the special test URLs that work with desktop Chrome, but they don't work with Chrome for Android. Special Firefox test URLs also don't seem to work with Firefox on Android either. There is a bug on the Chrome bug tracker about this: http://crbug.com/438613, let's see what they will say. But Chrome, Firefox and even Safari are supposed to use the same Safe Browsing service: https://en.wikipedia.org/wiki/Google_Safe_Browsing, so that's... interesting. Thanks for raising up this issue!
102411d16c630a364a1482ef4786bae8f06edd3691d8530af2988107441e3c81
['afd7c8dc3a004ca6902f636d23022cdb']
I am facing the same issue. What follows may not be considered an "answer" by some people, but may lead to an answer I think and I've never seen it mentionned on the numerous web pages complaining about this issue : I've noticed that when you open the pdf not with Preview BUT with the built-in previewer from finder (the one you obtain when clicking on SpceBar when file highlighted in the finder) then you can scroll through the pages (using PageDown PageUpp, or Fn+Arrows) and this ugly effect does not show. This is very surprising as I've always assumed (and I'm not alone I guess) that this builtin finder preview was using the same toolkit as Preview, which is not the case apparenlty.
11c1d04b008375596ac9ef4ff472770aa66be84b9aa31913b51d9ce04bf2fd9e
['afd7c8dc3a004ca6902f636d23022cdb']
You don't need any extra modules to do what you need to do. Just edit your new content type and uncheck Published in the Workflow settings section. This will make all new posts of that type unpublished by default. Then, as an adminstrator, go to the content list at /admin/content/node and set it to show only items where status is not published. Edit the unpublished nodes individually to publish them by checking the Publish box under Publishing options. You could even use Drupal 6's core Triggers and Actions modules to have the site send you an email whenever a new video node is created.
548e0866c6e5405bc79028e4913f832244cc96b092090a719f3b4f0c84933bdc
['b0143c2a56cf49019f5d1bc0996be894']
For about 3 yrs i have been using a jam/jelly maker. After a few months of storage, the strawberry&raspberry discolor. I do follow the canning bath directions. The only thing I do not follow is I decrease sugar to 1/2 or 1 cup (vs directions of 2cups). I have tried bottled lemon juice as directions say. Still discolors after 3-4 months. I have my water tested and it always passes the test. I water bath the jars after filling for 10 min as recommended. I’m at a loss and wonder if I’m overlooking something? I appreciate any thoughts!
ce2a666cb3bfd9ff7f6af013ebacc06b65883c67eeb53d05c626765fd91d517d
['b0143c2a56cf49019f5d1bc0996be894']
Thank you so much <PERSON>. I will consider freezing. I’ve never put glass in the freezer before, but worth a try!! I do the boil bath, let them cool, unscrew lids to make sure the seal is good, then store down my cool basement. And the jam thaws good? Hmmm.
f77312ff1cc6474d77346fdf3647595df6bbb24097d0ec1676fe7a91465836f0
['b01a8fc2c57a404ab7226a7dd82f7372']
I have to show list of courses and their information and when users click on the course name, they will be directed to another page which shows more details for that course. So I am using $_GET and $_POST. So this is part of the code in my first file: <tbody> <?php foreach($courses as $data1) { $temp=html_entity_decode($data1['title']); $send= ($data1['prefix'] . "," . $temp); ?> <tr class="<?php echo ($i%2) ? 'even' : 'odd' ?>"> <td><a href="course_details.php?course=<?php echo $send?>"><?php echo $data1['title'];?></a></td> <td> <?php echo $data1['prefix']; ?> </td> <td><?php echo $data1['number'];?></td> </tr> <?php $i++;} }?> </tbody> You can see in part my of code I have used html_entity_decode, and that is because I am working with API and information returned by this API will be structured in a JSON format. So if I have a course with a title which has & in it, like "Systems Planning & Implementation", then I can search for it.(I have a search option, so users can search for a course in the list of the courses they see) Using html_entity_decode has solved the problem. In my other file I use $course_details=$_GET['course']; to receive the data send by the other file. In order to make sure I have received the right data, I use echo $course_details; But I found out for a course like "Systems Planning & Implementation", what the other file receives is "Systems Planning", So I still have problem with & , and $_Get does not send "&" or $_POST does not receive "&". So do you have any suggestion that how can I solve the problem?
3de78d14e1a2f03dca92abacd2fb4dd5d92f1ce20ae38d3ff7e651857c8a1648
['b01a8fc2c57a404ab7226a7dd82f7372']
If I have generic_call: function(path, params){ this.fetch( path, params, function(data){ this.last_results = data; if($('#log_to_console').is(':checked')){ console.log(data); } **$('#url').** $('#results').text(JSON.stringify(data, null, '\t')); } ); }, and for $('#url'), I have a div as follow: <div id="url"> <label>URL Used:</label> </div> if I have base_url: 'https://www.faculty180.com/api.php' and for the part that says:" URL Used: " I want to show the value of base_url, what should I write after: **$('#url').**
c5f4b082c40b28171701e6b02c1805adb3e187c88abcc4d09f4890dccffdb927
['b02175c105084fd7977090d7df84e8b7']
I can not post comments yet, so have to do it this way. Two things I can think off: You say you remove the child from Robots list. So it seems strange that you encounter null values in the list; unless the remove implementation has a mistake? Is it possible that inside the ENTER_FRAME while going trough the robots, robot instances get removed? If so, it might help if you go trough the list starting at the last index. If an instance gets removed, it will not change the items at lower index. Something like: for(var index: int = list.length; index--; ) doSomething(list[index]);
9023a6ef0a060bf67be39c5f1ba6fb6ac02a866842c208d0a01e39c1a0f1b619
['b02175c105084fd7977090d7df84e8b7']
The FocusEvent.FOCUS_IN event contains also a reference to the interactive object losing the focus (relatedObject property). In your code you could change: textbox[i].addEventListener(KeyboardEvent.KEY_UP, k); textbox[i].tabIndex= i; to: textbox[i].addEventListener(KeyboardEvent.KEY_UP, k); textbox[i].addEventListener(FocusEvent.FOCUS_IN, handleFocusIn); textbox[i].tabIndex= i; function handleFocusIn(anEvent: FocusEvent): void { if (anEvent.relatedObject is TextField) { var previousBox: TextField = anEvent.relatedObject as TextField; var currentBox: TextField = anEvent.target as TextField; // etc. } } Like the previous answer said, try to figure out how looping works. Also you can reference the TextField using []: // to reference names_mc.box19_txt using an index var index: int = 19; var textbox: TextField = names_mc['box' + index + '_txt'];
a56f7879f061b6d3b44b0117cae24863d1e9811aa9ccbb58323bf212bd3056e5
['b02244f9f8e74b06a31cc2ba97b76565']
I'm writing a simple website using Flask. When I added time field to the Td class I got sqlalchemy.exc.OperationalError sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table td has no column named time class Td(db.Model): id = db.Column(db.Integer, primary_key=True) text = db.Column(db.String(271), nullable=False) date = db.Column(db.String()) time = db.Column(db.String()) I suppose that in production when you manage a big project it's not an option to drop_all() the whole db each time you add new column. Is there a proper way to add a new column?
1cc861f4741aa177583c5cf81bb770657c5d302c369f89c781977cd7ddddc97d
['b02244f9f8e74b06a31cc2ba97b76565']
I have seen this thread, but I wish to convert, say poetry, into a wallpaper. (something more advanced I suppose) Poetry is usually long, and in order to fit it in one wallpaper (fullHD), there should be some way to break it down into columns, creating a new column, once the height of the image was exceeded. Is there a way to do this via ImageMagick? Or should I edit the text manually, namely: figure out the proper height of the text and how much fits in, break down the text file into multiple text files where appropriate, create an image using each of those text files taking into account the proper gap between columns.
ad693d49f507037793eeadaf0da4c70841f85d2998072129e714a98bf5f06664
['b02a62d25bb94437955d7cae697f1f60']
Consider the two equivalent functions void foo( ) { if( unlikely_case ) return; // foo code } void foo( ) { if( !unlikely_case ) { // foo code } } Obviously, the compiler can't decide which case is more likely -- but I know ahead of time. I feel that I should structure my code in the latter form since it is supports what I know of branch prediction. The issue is this can get ugly void foo( ) { if( !sanity_check[ 0 ] ) return; if( !sanity_check[ 1 ] ) return; if( !sanity_check[ 2 ] ) return; // foo code } vs void foo( ) { if( sanity_check[ 0 ] ) if( sanity_check[ 1 ] ) if( sanity_check[ 2 ] ) { // foo code } } Is there a keyword I can use to let the compiler know which cases are more likely (probably compiler dependant)? If not, are these sanity-check situations something the compiler takes into consideration when optimizing code for branch prediction? Should I just get used to the pyramidal, latter code? For the sake of the question, consider only the most popular compilers like MSVC, GCC, clang, etc.
af350b412d79793a609cdab6451cee4aed720e3fef0ca8b466ab18b21e14ac7a
['b02a62d25bb94437955d7cae697f1f60']
Should I take nttp functions by reference or by "value" (implicit pointer)? template< auto fn > struct c { static constexpr auto functor = fn; }; vs template< auto & fn > struct c { static constexpr auto functor = fn; static constexpr auto && functor = fn; // maybe? }; Or does it not matter? If it is compiler dependent, let the question be about MSVC Usage: c< GetLastError ><IP_ADDRESS>functor( );
cf8f7652bf6ed5e87e502f04c51ca27f0d30b8ba5954be0fe5fc5bdcdb5d64f9
['b02c06631a354ec6b855479c0420168c']
I wondered the same thing. Ultimately, whilst I agree with the general consensus, I wanted to see how it could be done, because I've been in a similar situation myself, where Windows Services were not available to me. All I did was create a new job which, when executed sends a HTTP request to the application itself. For me, I pointed it at a page which simply contained @Datetime.Now.ToString(). The action of sending a HTTP request to itself should be enough to keep the scheduler (and parent worker process) alive. It does not however stop the application from being stopped/recycled without warning. If you wanted a way to handle that, then you'd likely need more than one site running which pings both itself and the other site. This way, if one site goes down, the other can hit it (assuming it's started) to bring it back.
99b95250e8a5e806cb1e773e93cddf1374ee9d62f68abd8af62c6a57b3c38ce1
['b02c06631a354ec6b855479c0420168c']
There are several UARTs on the Raspberry Pi and at least 2 are connected to GPIO pins. So yes, you can connect one of the UARTs on the GPIO pins to the wifi access point. Just make sure that the wifi access point uses 3.3V levels and not 5V levels or you also need a level changer.
2c6a89bb58b1524df34741f1dd9ee733e1b562a05d1f32f53720e0d5e57362a2
['b037195cbdcc455498bed971439f4414']
Dim connString As String = "Data Source=NameOfMachine\InstanceofSQLServer;Initial Catalog=NameOfDataBase;Integrated Security=True" Dim MyCol As String = "NameOfColumn" Dim MyTable As String = "[NameOfTable]" ' or "[Name Of Table]" use brackets if table name contains spaces or other illegal Characters Dim MySql As String = "IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS" & vbCrLf & "WHERE TABLE_NAME = '" & MyTable & "' AND COLUMN_NAME = '" & MyCol & "')" & vbCrLf & "BEGIN" & vbCrLf & "ALTER TABLE [dbo]." & MyTable & " ADD" & vbCrLf & "[" & MyCol & "] INT NULL ;" & vbCrLf & "END" Try ' MsgBox(MySql)- this msg box shows the Query so I can check for errors- Not required for code. Dim dbConn = New SqlConnection(connString)' Note ConnString must be declared in the form class or within this Sub. Connstring is your connection string Dim dbCmd = New SqlCommand(MySql, dbConn) dbConn.Open() dbCmd.ExecuteNonQuery() 'MessageBox.Show("Ready To Load Addendums") dbConn.Close() Catch ex As Exception MsgBox("We've encountered an error;" & vbCrLf & ex.Message) End Try
bcae099b353adac53bf7c1fc2ffd0547909db64a598477f61a7ad9c811f896e1
['b037195cbdcc455498bed971439f4414']
Imports System.Data.SqlClient 'Reference The Sql Client Public Class Form1 ''Make sure to change the connection string below to your connection string this code only works for SQL DataBase. If Your connection String is wrong This will Not Work Dim connString As String = "Data Source=NameofYourSQLServer\SQLEXPRESS;Initial Catalog=NameOfYourDataBase;Integrated Security=True" Dim tblDIV As DataTable Dim daDIV As SqlDataAdapter Dim dsDIV As New DataSet Dim oCon As SqlConnection Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim oCon = New SqlConnection oCon.ConnectionString = connString dsDIV = New DataSet ' Select all Fields and order by ID or Replace * with name of Field daDIV = New SqlDataAdapter("SELECT * FROM NameOfYourTable ORDER BY Id DESC", oCon) '*** Define command builder to generate the necessary SQL Dim builder As SqlCommandBuilder = New SqlCommandBuilder(daDIV) builder.QuotePrefix = "[" builder.QuoteSuffix = "]" Try daDIV.FillSchema(dsDIV, SchemaType.Source, "DIV") daDIV.Fill(dsDIV, "DIV") tblDIV = dsDIV.Tables("DIV") ListBox1.DataSource = tblDIV ListBox1.DisplayMember = "NameOfTheFieldYouWanttoDisplay" Catch ex As Exception MsgBox("Encountered an Error;" & vbNewLine & ex.Message) oCon.Close() End Try End Sub
74b1cd838a1edd4c7891eef589af396ea844a9da613195ddc029c8bdb33aed8f
['b0472d80d80d4081a78bd53ef767d939']
try this code mDialogyes = (Button)mDialogyes. findViewById(R.id.yes); mDialogno = (Button)mDialogyes. findViewById(R.id.no); mDialogyes.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.setFlags(intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addCategory(Intent.CATEGORY_HOME); startActivity(intent); finish(); System.exit(0); } }); mDialogno.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mDialog.dismiss(); } });
e392b2553ecad5bce66a713898bb92989eafc0dcef42b91405a5e94bd9870a61
['b0472d80d80d4081a78bd53ef767d939']
Try this // pass HashMap from one Activity Intent intent = new Intent(this, AboutActivity.class); HashMap<String, Boolean> map = new HashMap<>(); map.put("var",true); Bundle bun = new Bundle(); bun.putSerializable("map", map); intent.putExtra("bundle",bun); startActivity(intent); overridePendingTransition(R.anim.slide_from_right, R.anim.nothing); // get HashMap from another activity Bundle bundle = getIntent().getBundleExtra("bundle"); if(bundle != null){ HashMap<String,Boolean> map = (HashMap<String, Boolean>) bundle.getSerializable("map"); if(map != null){ Log.e("bundle",map.get("var")+""); } }
05086f48abaa9e4bbfe0c580f2f5783942678b8bc4cfae104c1c47e558bafed0
['b04d2d058b984d36ba474c209311b1c7']
The working version of the resize function is as follows: function resize( parent, images ) { // The largest height seen so far. var l = 0; // Loop through all the images to // determine which is the tallest. for ( var i = 0; i < images.length; ++i ) { // Create a variable to hold the current value. // This just means that we can save time on multiple // array access calls. var c = images[i]; // If the current image is actually // visible to the user. if ( c.offsetParent !== null ) // If the largest so far is the biggest then // keep it, otherwise change it to the new // biggest value. l = ( l > c.height ) ? l : c.height; } // If the value of 'l' is 0 then it is likely // that the all the images are hidden. In // which case skip the resizing. if ( l === 0 ) return; // Set the height of the parent to 'l' // this ensures that the parent will resize // even if the window is made smaller. // adding 2 pixels for good luck :P parent.setAttribute( "style", "height:" + (l + 2) + "px" ); }
9405179c0b5f4d3539f8665e860720d3a065b119ca6abcba1afed4b33620abb4
['b04d2d058b984d36ba474c209311b1c7']
I managed to get combineLatest to work, by actually subscribing to the resulting observable. Originally I was doing this: Observable.combineLatest( db.cassette_designs, db.glass, ( cassettes: CassetteData[], glass: GlassData[] ): void => { console.log( cassettes ); console.log( glass ); }); Now I'm doing this: Observable.combineLatest( db.cassette_designs, db.glass ).subscribe( ( data: any[] ): void => { console.log( data ); // cassettes - data[0] // glass - data[1] });
ad5aae89ffb64c77ff365e757d9e4300f32453742a639a636c751aafdf13fbea
['b050c7ddf6d14d4f9ed0685a75a34ddb']
I'm trying to read in an excel file (.xls) via pandas into a data frame as follows: df = pd.read_excel( filename, sheet_name='Sheet1', nrows=6) Unfortunately I get an AssertionError. However if I open the file in excel and then click save, then rerun this works perfectly fine. I've not changed any data, just opened in Excel and save. Has anyone come across this issue before? This is the assertion error I'm getting: AssertionError Traceback (most recent call last) <ipython-input-153-58dcba1b45c3> in <module> 1 df = pd.read_excel( ----> 2 filename, sheet_name='Sheet1', nrows=6) ~\Anaconda3\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs) 206 else: 207 kwargs[new_arg_name] = new_arg_value --> 208 return func(*args, **kwargs) 209 210 return wrapper ~\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in read_excel(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, verbose, parse_dates, date_parser, thousands, comment, skip_footer, skipfooter, convert_float, mangle_dupe_cols, **kwds) 308 309 if not isinstance(io, ExcelFile): --> 310 io = ExcelFile(io, engine=engine) 311 elif engine and engine != io.engine: 312 raise ValueError( ~\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in __init__(self, io, engine) 817 self._io = _stringify_path(io) 818 --> 819 self._reader = self._engines[engine](self._io) 820 821 def __fspath__(self): ~\Anaconda3\lib\site-packages\pandas\io\excel\_xlrd.py in __init__(self, filepath_or_buffer) 19 err_msg = "Install xlrd >= 1.0.0 for Excel support" 20 import_optional_dependency("xlrd", extra=err_msg) ---> 21 super().__init__(filepath_or_buffer) 22 23 @property ~\Anaconda3\lib\site-packages\pandas\io\excel\_base.py in __init__(self, filepath_or_buffer) 357 self.book = self.load_workbook(filepath_or_buffer) 358 elif isinstance(filepath_or_buffer, str): --> 359 self.book = self.load_workbook(filepath_or_buffer) 360 else: 361 raise ValueError( ~\Anaconda3\lib\site-packages\pandas\io\excel\_xlrd.py in load_workbook(self, filepath_or_buffer) 34 return open_workbook(file_contents=data) 35 else: ---> 36 return open_workbook(filepath_or_buffer) 37 38 @property ~\Anaconda3\lib\site-packages\xlrd\__init__.py in open_workbook(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows) 155 formatting_info=formatting_info, 156 on_demand=on_demand, --> 157 ragged_rows=ragged_rows, 158 ) 159 return bk ~\Anaconda3\lib\site-packages\xlrd\book.py in open_workbook_xls(filename, logfile, verbosity, use_mmap, file_contents, encoding_override, formatting_info, on_demand, ragged_rows) 118 bk._sheet_list = [None for sh in bk._sheet_names] 119 if not on_demand: --> 120 bk.get_sheets() 121 bk.nsheets = len(bk._sheet_list) 122 if biff_version == 45 and bk.nsheets > 1: ~\Anaconda3\lib\site-packages\xlrd\book.py in get_sheets(self) 721 for sheetno in xrange(len(self._sheet_names)): 722 if DEBUG: print("GET_SHEETS: sheetno =", sheetno, self._sheet_names, self._sh_abs_posn, file=self.logfile) --> 723 self.get_sheet(sheetno) 724 725 def fake_globals_get_sheet(self): # for BIFF 4.0 and earlier ~\Anaconda3\lib\site-packages\xlrd\book.py in get_sheet(self, sh_number, update_pos) 712 sh_number, 713 ) --> 714 sh.read(self) 715 self._sheet_list[sh_number] = sh 716 return sh ~\Anaconda3\lib\site-packages\xlrd\sheet.py in read(self, bk) 1107 saved_obj_id = None 1108 elif rc == XL_NOTE: -> 1109 self.handle_note(data, txos) 1110 elif rc == XL_FEAT11: 1111 self.handle_feat11(data) ~\Anaconda3\lib\site-packages\xlrd\sheet.py in handle_note(self, data, txos) 1985 # string length). 1986 # Issue 4 on github: Google Spreadsheet doesn't write the undefined byte. -> 1987 assert (data_len - endpos) in (0, 1) 1988 if OBJ_MSO_DEBUG: 1989 o.dump(self.logfile, header="=== Note ===", footer= " ") AssertionError:
b63613f5ed5fdd97441e016a2cd3cd7f978a3a5fabe0b4a8ec0123aabed06b06
['b050c7ddf6d14d4f9ed0685a75a34ddb']
Programming Problem. I have a starting volume (in MW) and I need to reach a target Volume (in MW) in a specified amount of time. The ideal solution is to generate a linear line between the points to calculate rate required. However we can only go from the starting rate to the target rate using specified ramp rates: Rate 1 - MW/min from any starting volume to the Elbow Volume 1 Elbow Volume 1 - volume at this point Rate 2 - MW/min from Elbow Volume 1 to Elbow Volume 2 Elbow Volume 2 - volume at this point Rate 3 - MW/min from Elbow Volume 2 to target volume So as an example I could have the following: Rate 1 = 10MW/min. Elbow Volume 1 = 100MW Rate 2 = 5MW/min Elbow Volume 2 = 105MW Rate 3 = 35MW/min Exzample rates This means I can start at any volume before 100MW and get to 100MW @ 10MW/min. I can then get to 105MW @ 5MW/min. I can then achieve any volume greater than 105MW at a rate of 35MW/min. So if the start volume is 75MW and target volume is 800MW with a time difference of 30 mins is this achievable: Starting from target volume at 750MW I can get to 105MW in 19.9 mins: volume delta = 800MW - 105MW = 695MW time taken = 695MW / 35(MW/min) = 19.9 mins I can get from 105MW to 100MW in 1 mins volume delta = 105MW - 100MW = 5MW time taken = 5MW / 5(MW/min) = 1 min I can get from 100MW to 75MW in mins: volume delta = 100MW - 75MW = 25MW time taken = 25MW / 10(MW/min) = 2.5 mins Time taken in total = 19.9mins + 1min + 2.5mins = 23.4mins Since 23.4mins < 30mins then this is possible I can program the above steps to verify the above but looking for a efficient way which I may be missing. The way I have coded this in c# is as follows: Get starting and target volumes. If Elbow Volume 2 >= start volume and Elbow Volume 2 <= target volume then passing through Elbow Volume 2: Calculate volume delta between target and elbow volume 2. Divide by rate 3 to give T1 Calculate volume delta between elbow volume 1 and max(start volume, elbow volume 2). Divide by rate 2 to give T2. If Elbow Volume 1 >= start volume and Elbow Volume 1 <= target volume then passing through Elbow 1: Calculate volume delta between start and elbow volume 1. Divide by rate 1 to give T3. Sum T1, T2 and T3 and verify that is less then time between start and target volume. I believe this is working but looking to see if there is a better solution out there.
19dc621c537ff80f6d87ac5c6a999e31649c83025a0a04682d52c45e1358715b
['b05404a04f7d4b2c940c793893b4e2cd']
This is how HTTP live streaming is designed to work. It will progressively choose higher or lower quality streams based on the strength of the internet connection. If the connection is not fast enough the "last resort" is to continue to play audio but no video. The only way to recover the video image in this case is to improve the speed of the internet connection.
8fc2478bdca6ad7df94c4a58728b7f289e3f5b9903f1679ab89dde95a324138e
['b05404a04f7d4b2c940c793893b4e2cd']
Your view controller that you are changing to probably is not returning yes to the following function for upsideDown -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { } if your destination view controller does not already have this function in it you'll want to add it and return yes for all the orientations you want to support (sounds like probably all). If you do want to support all orientations you can just return yes from this function and that should probably fix your problem.
29d88eb19dc4ee5883da0c1b027d96aee52eed9c0381e28ba4a0a4e0343e5d9a
['b057f139a3d94c698ed11572d4597cf0']
You can't avoid postbacks, ASP.NET works with them. When you click the save button, the page does postback and the Load event fires. In that event, you have to rebuild the page as before you clicked Save (put the textboxes). If you don't do it, the textboxes aren't there no more and no text can be saved. Edit: gives unique names to your textboxes, it seems non-sense, but ASP.NET need to hooks on names
9fb2d09b66b3e2e0f4a15fff3b1e60e029db5f9b08be64d7191a21dd5db08f45
['b057f139a3d94c698ed11572d4597cf0']
Here it is how the class should be: public class Storage { public int a { get; set; } public int b => a + 5; public int c { get; set; } public void Met1() { this.a -= 10; this.c = this.a; } public void Met2() { this.a -= 10; this.c = this.a; } public void Met3() { Console.WriteLine("{0}", this.a); this.c = this.a; Met1(); Met2(); if (this.a > 10) { Met3(); } } } Here it is how you can use it: static void Main(string[] args) { Storage storage = new Storage(); storage.a = 100; Console.WriteLine("Original a value: {0}", storage.a); Console.WriteLine("b value: {0}", storage.b); Console.WriteLine("c value: {0}", storage.c); storage.Met1(); Console.WriteLine("After met1: {0}", storage.a); Console.WriteLine("b value: {0}", storage.b); Console.WriteLine("c value: {0}", storage.c); storage.Met2(); Console.WriteLine("After met2: {0}", storage.a); Console.WriteLine("b value: {0}", storage.b); Console.WriteLine("c value: {0}", storage.c); storage.Met3(); Console.WriteLine("After met3: {0}", storage.a); Console.WriteLine("b value: {0}", storage.b); Console.WriteLine("c value: {0}", storage.c); Console.ReadKey(); //storage.b += 1; //Console.WriteLine("b value: {0}", storage.b); } Please note that if b is equal to a + 5, you cannot assign a value to b.
dea937b60648cfdf43b6197b2ec54a234155027a3523e4065a34e44378be1bef
['b07c2f2c1c8d4561abc4802a80fea221']
I need to remove a range of elements from an array but I can't figure out how. I tried this for loop where start is that start of the range and end is the end of the range. for (i=0;i<n;i++){ a1[start+i] = a1[end+i+1];; }
209219ae2e00eff2d3b7cf0314409d2b9445ce3eb551ae961740c17be0049846
['b07c2f2c1c8d4561abc4802a80fea221']
I need to remove a range of elements from an array but I can't figure out how. I tried this for loop where start is the start of the range and end is the end of the range. int main(void) { int n, n2, i, start, end, index; int a1[n]; int a2[n2]; printf("Enter the length of the array#1: "); scanf("%d", &n); printf("Enter the elements of the array#1: "); for (i = 0; i < n; i++){ scanf("%d", &a1[i]);} printf("Enter the length of the array#2: "); scanf("%d", &n2); printf("Enter the elements of the array#2: "); for (i = 0; i < n2; i++){ scanf("%d", &a2[i]);} printf("Enter the start and end indexof array #1 to be removed: "); scanf("%d %d", &start, &end); int a3[(end-start)+1]; printf("Enter the position(index)of the array #2 to be added before: "); scanf("%d", &index); for (i=0;i < (n - end - 1);i++){ a1[start + i] = a1[end + i + 1]; a1[end + i + 1] = 0; } printf("\n"); printf("array1: "); for (i=0;i < (n);i++){ printf("%d", a1[i]); printf(" "); }
ba50b3a03635a10e3d5703874a78e3076427da8f7d84b817bca0578bf5caa7af
['b082358d7eee4d4fbe0488bc80c4b3c8']
I'm not countering your answer, I'm accepting it. Now in my case the entire /etc directory is empty post fsck and there are around 300 file fragments dumped in /lost+found :( . I've decided to reload the OS as manually getting everything back is not worth the effort. Thanks.
510a888d2343cad1f53c29164dc5b032b8fcaf044c0ee4ccd6bfdada4b359573
['b082358d7eee4d4fbe0488bc80c4b3c8']
Hmmm...It did not! I tried on another laptop, that could not find MBR. I formatted it and made it bootable via another program ("Universal USB Installer" this time) which warned me during the process that an error occured and drive may not be bootable. So looks like the drive has developed someproblem (though data is accesible) and I need to find another pen drive and come back here with errors if any.
d7d7b2e8646ce8877f26d1588e45e0a3e0cbd2e405fbac6a1ae6813e6ae0d76f
['b08dcc1c715d467383e96f53162b106f']
I've looked things up a little bit more and couldn't really find the exact solution matching my problem on a Dell-Laptop but I've read of some people having similar problems with toshiba's batteries and finally found a way to get mine correctly detected. All I needed to do was add a kernel parameter at pc-startup. To do this follow these steps: type in a terminal -> sudo nano /etc/default/grub locate this line -> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" add acpi_osi=Linux param -> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux" save and exit the editor update grub -> sudo update-grub right click the KDE system tray and check "battery monitor" in the additional items (you can also configure it to show on "auto" mode or "always"; auto shows it only when the pc is running on battery) reboot Notes: what acpi_osi=Linux does is telling the BIOS that the running O.S. is/will be linux, just that step6 was needed because that item didn't get included by default since the system thought no battery was available Conclusions: Adding acpi_osi=Linux to the kernel parameters perfectly fixes my battery detection problem, if you have the exact same laptop model as mine it will surely work for you too; it might also work for the other Inspirons laptops belonging to the 7000 serie as well. Hope this answer can help.
8a099dc6871ca723d7efa2347b54db9eb926f0d1654d3d5cbd5bb113eba7bb31
['b08dcc1c715d467383e96f53162b106f']
I'm running Kubuntu 14.04.1 LTS AMD64 on my Dell Inspiron 14" 7437; it is a fresh and fully updated installation. What happens when I turn on my PC without the power cord attached is that KDE systray battery icon shows the battery as "not present" even though it certanly is; then if I try to connect the power adapter, it suddenly realizes about the battery and correctly displays its charge level, at that point I can disconnect the adapter and it will keep showing the correct info about the battery levels and everything ... So, the thing is that I just can't boot my PC without connecting the power adapter but that's quite annoying when I am not home or if I have no power outlet available around me because I can't know my battery charge level... How do I fix this ?
e0b3d80611e070d22d9ced795e1931c97fe2b23ca9adefe0dc8b00abd0ec1657
['b09179d1a5f1434d82c9eecae6b8927d']
I have a rails app hosted on Heroku. Part of the app involves writing some data to a CSV and then renaming the file The code is pretty simple and looks something like this CSV.open(file_path, "a") do |csv| csv << some_data end File.rename(file_path, new_file_path) When I run this code in the rails console, the file is renamed and when I read it, everything seems good. However, when I exit the console, the changes do not persist. When I re-enter the console, the file has reverted to its original state. Any idea what's going on? Thanks
3767b627cc35d21c18237180db34f4bfbcc11876b4b3ca68fb6672b26f4b55f3
['b09179d1a5f1434d82c9eecae6b8927d']
I'm currently using the example data on console.neo4j.org to write a query that outputs hierarchical JSON. The example data is created with create (Neo:Crew {name:'Neo'}), (Morpheus:Crew {name: 'Morpheus'}), (Trinity:Crew {name: '<PERSON>'}), (Cypher:Crew:Matrix {name: '<PERSON>'}), (Smith:Matrix {name: 'Agent <PERSON>'}), (Architect:Matrix {name:'The Architect'}), (Neo)-[:KNOWS]->(Morpheus), (Neo)-[:LOVES]->(Trinity), (Morpheus)-[:KNOWS]->(Trinity), (Morpheus)-[:KNOWS]->(Cypher), (Cypher)-[:KNOWS]->(Smith), (Smith)-[:CODED_BY]->(Architect) The ideal output is as follows name:"Neo" children: [ { name: "<PERSON>", children: [ {name: "<PERSON>", children: []} {name: "<PERSON>", children: [ {name: "Agent <PERSON>", children: []} ]} ] } ] } Right now, I'm using the following query MATCH p =(:Crew { name: "Neo" })-[q:KNOWS*0..]-m RETURN extract(n IN nodes(p)| n) and getting this [(0:Crew {name:"Neo"})] [(0:Crew {name:"Neo"}), (1:Crew {name:"Morpheus"})] [(0:Crew {name:"Neo"}), (1:Crew {name:"Morpheus"}), (2:Crew {name:"Trinity"})] [(0:Crew {name:"Neo"}), (1:Crew {name:"Morpheus"}), (3:Crew:Matrix {name:"Cypher"})] [(0:Crew {name:"Neo"}), (1:Crew {name:"Morpheus"}), (3:Crew:Matrix {name:"Cypher"}), (4:Matrix {name:"Agent <PERSON>"})] Any tips to figure this out? Thanks
aab4072e70ea98e91f58d588bdfb1aba6b3b358902e68efd9e899d2c2e5e7909
['b096058e75b54ffba4ac92aea661ac18']
The solution was to avoid using data-content but instead pass the html string to the popover call as a value in content <script type="text/javascript" language="JavaScript"> $(document).ready(function() { function getMessageAjax(uniqid) { var notes = ""; $.ajax({ type: "POST", url: "ajax.php", data: { action: 'getNotes', uniqid: uniqid, cache: false }, success: function(data) { if (data != 'NULL') { var theValues = $.parseJSON(data); var notesHTML = '<ul>'; $.each(theValues, function(key, value) { notesHTML += '<li>'+value['n_kort']+'</li>'; }); notesHTML += '</ul>'; var html = $('<img src="images/icons/icon-info.gif" class="notepopover" />'); $('#'+uniqid).append(html); html.popover({ placement: "bottom", trigger: "hover", content: notesHTML, html : true }); } } }); } $('.notitieIndicatie').each(function(i, obj) { getMessageAjax(this.id); }); });
70569fc07e52230a9434bf7fe6ab96d60efcdead563fd35b72b4f67410e85071
['b096058e75b54ffba4ac92aea661ac18']
I use the feature of selecting a year with a dropdown. I use it to set birthdays of people at least 18 years old. So far it works perfectly. I have set it up using theseg parameters: $('#datepicker').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy', minDate: '-100Y', maxDate: '-18Y' }); However I'd like to have year navigation. Is it possible to add a next/previous year button? Thanks in advance for any help!
cc53f6dd0ee881fc01d954eba0d3b0ee1e54e0836b8fac113bfed8791d730c4f
['b0e1c444f670454b93e28a49b774bdbb']
If I understand your question correctly, I think using filter from the dplyr package is a good bet. Determine unique values for third column: levs <- unique(data$broader.condition) Filter data for a particular condition and plot: require(dplyr) fdata <- filter(data, broader.condition == levs[1]) plot(fdata$LOS, fdata$ADMISSION_AGE_YEARS, pch=19, xlab= 'LOS', ylab= 'AGE', main= paste0(levs[1])) Or run through a loop to plot all conditions in separate plots: for (i in 1:length(levs)) { temp <- filter(data, broader.condition == levs[i]) plot(temp$LOS, temp$ADMISSION_AGE_YEARS, pch=19, xlab= 'LOS', ylab= 'AGE', main= paste0(levs[i])) } Alternatively you could easily use ggplot2 to plot all conditions on the same plot with different colors.
fb1baee7372231f08437fa5643a7051e8b573769026092ae590fee1c8b95786f
['b0e1c444f670454b93e28a49b774bdbb']
While I never solved this problem initially (turns out I didn't need to) I just happenned on this (4 years later) and the answer seemed apparent to me. One solution would be to use the logit function to transform the input (in this case, 0.5 to 1 would need to used rather than 0 to 1, but this could be scaled as well. Since R doesn't like Inf (result of logit(1)), a small value has to be subtracted from 1. This is then scaled by 1000 (chosen based on some fiddling) to scale from parabola to rectangle. sc_fun <- function(x) { if (x == 1) { x1 <- x - 0.0000000000001 } else { x1 <- x } SC <- boot<IP_ADDRESS>logit(x1) * 1000 return(SC) } SC <- sc_fun(0.5) x_scale_fun = x * (y + SC) y_scale_fun = y * (y + SC) plot(x_scale_fun, y_scale_fun, pch='.') SC <- sc_fun(1) x_scale_fun = x * (y + SC) y_scale_fun = y * (y + SC) plot(x_scale_fun, y_scale_fun, pch='.')
6afbb96f7e37b820e970e8bf83295005304f4bc105b9ca758ca2ccff8a2bc117
['b0e50c77e0b74e68b9197a4ded49086f']
I have been working on a Cordova project for both iOS and Android. As part of the project as we will need to build a number of projects from a basic template. I have done this by creating a template for the actual cordova project and also as part of it I pulled the cordova-ios-master code base for when we add the iOS platform. So we use our own cordova-ios-master due to some small modifications we needed to add. With some of the plugins we have added / created we need to access SDK's / API's from some third party developers (this is mainly for some push notification services). Normally when we create the project and have added the platform we then need to add the linked frameworks using Xcode. However I can see that within the cordova-ios-master there is the template Xcode project. I was hoping I could add the linked frameworks within this project so that they are already added when we first create the project and add the custom iOS platform. What seems to be happening though is if I add the linked library into the template Xcode project and then save it. Once I then re-add that platform to the cordova project instead of the Xcode project being named after the cordova project name, it seems to have messed the re-naming of the Xcode project. Below shows how the Xcode project normally appears when you add the libraries manually after adding the platform So if i modify the Xcode template in cordova-ios-master, shown below.... You can see it already has a libCordova.a added. I add one more and re-save the project. But then when I add the platform to my project again from this source, i open the Xcode project for it and whilst my library is added, the project was named "myproject" but i can't choose to run it as the project selection seems to appear as "PROJECT_NAME" as opposed to being named and usable as "my project".... Im fairly new to mac's and Xcode so maybe I'm doing something basic wrong. Any suggestions or ideas would really help, I hope this post makes sense, it is a bit complex. Thanks again <PERSON>
5ce3fe98fc567a99dd167e985acf36e187bc05766f964d6f8c9c4749500b1b37
['b0e50c77e0b74e68b9197a4ded49086f']
Most of the time you can just do "save as", Flash seems to keep a few copies of your library for your undo history and forgets to strip this out when you do a normal save, doing "saves as" will reduce it massively, Ive seen flash files go from 300mb to 500kb using this technique.
35b38973510702ca2f4d2dc15aab40f7bcd7f37ca48aabdd3839f576b63a961d
['b0e597f719734526872868e981a857ff']
We have an application here which is using postsharp to wrap certain methods within a transaction aspect derived from MethodInterceptionAspect. We use NHibernate 2.0 as an ORM for the application. There is a failure within this block of code, public override void OnInvoke(MethodInterceptionArgs args) { using (TransactionScope transaction = CreateTransactionScope()) { args.Proceed(); transaction.Complete(); } } that results in the following error: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) This only seems to happen for calls to save, and not delete or get calls. I was wondering if anyone had encountered anything similar ever?
14f964eded3c8660393eab1357cf25ab7f55f6e3a948fd71804640554a41112c
['b0e597f719734526872868e981a857ff']
I've got a situation here where I have a central selenium grid hub, and several RC's running on my gogrid account. When I access it to run tests, it basically queues all the incoming test requests and executes them serially on only one of the RC's, instead of spreading them out to use available RC's. The tests come from multiple projects, so I'm not looking to parallelize the tests themselves, just to split the requests that come from multiple projects across the multiple RC's. From everything I've read, it seems like selenium grid should be doing this already, yet I only see one RC used to run every single test. Is there something I'm missing?
c59b4c6571b72f98d15555bd1733ec10e498ef4384c3010c62906db94da49dde
['b0ec551c89cd41eda11207884630b5dd']
This is straight forward with dplyr's case_when. I am not sure if it meets your need of "one line of code for it" though. month <- c(1,2,3,4,5,6,7,8,9,10,11,12) df <- data.frame(month = month) df2 <- df %>% mutate(Quarter = case_when( #Quarter 1. month %in% c(1,2,3) ~ "First", #Quarter 2. month %in% c(4,5,6) ~ "Second", #Quarter 3. month %in% c(7,8,9) ~ "Third", #Quarter 4. month %in% c(10,11,12) ~ "Fourth") )
0d8003b4f95af056e842be8f7b159a9f75bb9b6edb4b02404f203457e9830ec6
['b0ec551c89cd41eda11207884630b5dd']
I need to perform some rowwise operations with the help of pmap variants but I can't do so when it comes to passing the list of arguments (that is the ".l" argument) to a function that's nested within another function. I've tried various things including passing the name of the arguments and the dot dot dot syntax all to no avail. I need to know if there's a way to do this as I need to extend this to more complicated functions. Let's say I have the following data frame and that I would like to paste the first two columns from each row. I can easily do that with the following code: dff <- data_frame( first = c("A", "B"), second = c("X", "Y"), third = c("L", "M") ) df_easy <- dff %>% mutate(joined_upper = pmap_chr(list(first, second), function(...) paste(..., sep = "&"))) df_easy #> # A tibble: 2 x 4 #> first second third joined_upper #> <chr> <chr> <chr> <chr> #> 1 A X L A&X #> 2 B Y M B&Y However, if I would like to expand this so that I can lower case the first two letters prior to merging them, my attempt fails. I would like to see if I can get dff3. # df_hard <- dff %>% # mutate(joined_smaller = pmap_chr(list(first, second), function(...) paste(tolower(...), sep = "&"))) dff3 <- data.frame( first = c("A", "B"), second = c("X", "Y"), third = c("L", "M"), joined_smaller = c("a&X", "b&Y") ) dff3 #> first second third joined_smaller #> 1 A X L a&X #> 2 B Y M b&Y
46ac6ec32f4249f9861dd95860ccae45437894b3b0945cdecc7416aa9398f79f
['b0ecf8fa78904c44a4adae80b73c05ab']
For anyone looking for this in the future, get the V8 source: https://code.google.com/p/v8-wiki/wiki/UsingGit and look in src/messages.js. They're right at the top of the file. You'll have to do a search for the name of the error to find it's place in the source code though. On linux or in cygwin, you can use for example grep -R 'unexpected_token' .
4a9c32e19f75d0ef306848708fc4b77546a02b56baaaf5706bdb89a35124c03e
['b0ecf8fa78904c44a4adae80b73c05ab']
They say optimise for time, so I guess we're safe to abuse space as much as we want. In that case, you could do an initial pass on the 10000 strings and build a mapping from each of the unique characters present in the 10000 to their index (rather a set of their indices). That way you can ask the mapping the question, which sets contain character 'x'? Call this mapping M> ( order: O(nm) when n is the number of strings and m is their maximum length) To optimise in time again, you could reduce the stdin input string to unique characters, and put them in a queue, Q. (order O(p), p is the length of the input string) Start a new disjoint set, say S. Then let S = Q.extractNextItem. Now you could loop over the rest of the unique characters and find which sets contain all of them. While (Q is not empty) (loops O(p)) { S = S intersect Q.extractNextItem (close to O(1) depending on your implementation of disjoint sets) } voila, return S. Total time: O(mn + p + p*1) = O(mn + p) (Still early in the morning here, I hope that time analysis was right)
79d62c7872aac3e272b5c6f3f0b06c43e1e3b137a14c8ab256056b2e160633ed
['b10b2544e698458f813e1fb13e3bb443']
so I have a div with navigational links (set up using ul/li and a href within the li's). Below that I have 4 other div's. I only want 1 div shown at a time, they will then switch based on the users selection of the navigational LI's I've used a similar setup on a different page, and have tried to port it over to my current page but to no avail... JSFIDDLE Please see the above jsfiddle for the HTML/CSS/JS involved. HTML: <div id="content"> <div class="man-banner"></div> <div class="banner-nav" id="tabs"> <ul class="tabs" style="padding-left: 0px"> <li class="active"><a href="#wrapper#container#content#tab-content#home"><span>Home</span></a></li> <li><a href="#findvehicle" rel="find_your_vehicle"><span>Find Your Vehicle</span></a></li> <li><a href="#downloads" rel="downloads"><span>Downloads</span></a></li> <li><a href="#support" rel="support"><span>Support</span></a></li> </ul> </div> <div id="tab-content"> <div id="home" class="tab_content"> <PHONE_NUMBER> </div> <div id="findvehicle" class="tab_content"> abasdjfniasjfnasdf </div> <div id="downloads" class="tab_content"> asdfniadhnfiasdn890384834854854jnrjrjr </div> <div id="support" class="tab_content"> asdfniadhTHIS IS SUPPORT </div> </div> </div> Any help is welcomed, I am still learning (aren't we always), so with any fixes/tips, please detail why it works, or what i did wrong that's making this not work. (if that makes sense!) Thanks again for your help!
eeb214fc43e880493df90a3b1f7e5f4e3e3930b746487628ed47da0be0cee57e
['b10b2544e698458f813e1fb13e3bb443']
I believe this question has been answered before but unfortuantely the answer provided isn't working for me. (I am fairly new to Jquery/Javascript) I'm using this jsfiddle #1 to try and solve my problem. Here's my HTML: <div id="EU-selector"> <p>For EU:</p> <div class="dropdown" id="arrowdown"> <select name="eu-model" id="eu-model"> <option value="">Select your model:</option> <option value="1">Beetle</option> <option value="2">Caddy4</option> <option value="3">CC</option> <option value="4">E-Golf</option> <option value="5">Eos</option> <option value="6">Golf 7</option> <option value="7">Golf Cabrio</option> <option value="8">Golf GTI</option> <option value="9">Golf R</option> <option value="10">Golf Sportsvan</option> <option value="11">Golf Variant</option> <option value="12">Jetta</option> <option value="13">Passat</option> <option value="14">Polo</option> <option value="15">Scirocco</option> <option value="16">Sharan</option> <option value="17">T6</option> <option value="18">Tiguan</option> <option value="19">Touran</option> </select> <div class="eu-year"> <div class="beetle"> <select class="beetle-year"> <option value="">Select your year:</option> <option value="1">2015</option> </select> </div> <div class="caddy4"> <select class="caddy4-year"> <option value="">Select your year:</option> <option value="1">2015</option> </select> </div> </div> </div> </div> So basically, when you choose a model, it will then show the 'year' dropdown. I do wish to add another dropdown (3rd tier) for 'Systems' but I want to get over this hurdle first. I've added in my CSS in this jsfiddle #2 Also, the CSS for .dropdownarrow is supposed to flip the down arrow image (couldn't find out how to upload - maybe you can't?) to an up arrow on click, but stay 'active' until you click off the dropdown menu (or select an option - to then go to 2nd dropdown). Here's the JS I've included within the HTML code (I will move it to it's own .js file later) $(document).ready(function() { $('#eu-model').bind('change', function() { var elements = $('div.eu-year').children().hide(); var value = $(this).val(); if (value.length) { elements.filter('.' + value).show(); } }).trigger('change'); }) Can anyone advise to where I'm going wrong? All help is very much appreciated! Thanks, <PERSON>
2c7cdf4c8214a634b935db2234d0354c10083eab9eb5f03fae29ad24aa09878b
['b10c635f332c429fb25d166a8e3e5d05']
It seems that this in the msgbox callback isn't an element (in other words, the img variable is an empty array. Try to put the var img declaration right into the onclick listener. $(".btn-delete").live("click", function(){ var img = $(this).closest(".galleria-image").find("img"); Did it help?
38b5f6d1ae1b06a48663b693bd3da79c446f40456b4739f050e7c1bbe48ff6e7
['b10c635f332c429fb25d166a8e3e5d05']
Does $myArray contain string data? If so, the json_encode function, while not context sensitive, prints the double quotation mark, which ends the onclick attribute value. You can fix it either by using single quotes instead of double for the onclick value or (better solution) use PHP function htmlspecialchars. <a href="javascript:;" onclick="test(<?php echo htmlspecialchars(json_encode($myArray)); ?>)">test</a>
09240945911529134102177a80a939d438b309aeb1a957e6086814a9eada6a38
['b117acf4dfc14ff7b8dbc2f9c87873eb']
Cannot reset a stack with following use cases. Let assume Screen A is a root, and navigate to Screen B, Then while navigating to Screen C, I want the stack to have A->C instead of A->B->C. If a stack has A->B->C and I want to rest the stack with root screen as C. Please help on this use cases
c980a4212d1c2abde33546ef5bbd8786a00fd22b0f0d01af4911786bfd356421
['b117acf4dfc14ff7b8dbc2f9c87873eb']
I need to set the checkout repo path for the GitLab runner to the docker or other machine instead repo machine. Is it possible in Gitlab CI/CD? Example: Repo path - https://xxx.gitlab.com Docker runner machine Name - XXX_Runner Check-out repo-name needs to be - smb://XXX_Runner/Users/XXX/builds or anything maps this machine name with path.
d127ee05fa230e27d89ada6abad92a288b1cc313799480a6ba9b10a8d717e7e0
['b1198d1f77a04c379b6b2984d5224c5c']
You could workaround the problem by not using the ssh protocol with the git server, but instead the git or http protocol. One reason for the above message can be using a folder called "ssh" instead of ".ssh" (note the dot). Some colleague of mine experienced that, and this can easily happen when using Windows explorer, as it will silently remove the dot, when creating a folder called ".ssh". You have to use the command line instead.
8a69b1a8292095c2ce931a9d66cbce28cdb35ae2f0cfb1116791e9951a6e0df2
['b1198d1f77a04c379b6b2984d5224c5c']
Throw away your selfmade view, implement the console factory extension point instead to create new console sub windows in the existing console view. Afterwards implement the console pattern match extension point to find and link text segments in the console output. Implementing a full view in Eclipse that behaves like an already existing view is always wrong. All of the existing views in the eclipse platform have extension points to change and enhance them. Nobody really wants to have 5 different console views being shown in a perspective.
15989137a7a3f68dfe0019bd48e59439f16383adfac6eb9f88b6e0e34f8b0733
['b12df3572fb747eea3655e87c158d8e0']
I am trying to have something like the image below in my PHP page. (The links are in the comments. I was unable to post them here properly) Once I enter the keyword and hit the "plus" it should appear in the table, along with the color to the right. The sequence of colors will be predetermined. If I enter a keyword again and hit the "plus" again, the keyword should appear just below the earlier keyword int the table. For the time being I am assuming the table consists of 5 rows and there are less than or equal to 5 keywords. Also I want to have a submit button at the bottom that when clicked should send all the keywords now present to a PHP file. I have a form with the action attribute set to a PHP file. The table and the keyword input field are to be a part of a form. I prefer using javascript and not PHP for many complications. Is there a way I can store all the keywords and then send it to the PHP file once the form is submitted? Any help would be greatly appreciated.
57eca6dc0a17c92fa2228821b5e6fbc0346d8f4ed4135a74de988f84819a17d5
['b12df3572fb747eea3655e87c158d8e0']
I have an R script that takes in a dataset and a list of keywords. It then creates a plot based on how many times each of the keywords occur in the dataset, and saves it as a png image. Now, I want to make the keyword list dynamic, i.e. I want the keywords to be user inputs. Somehow, in the environment I am working in, it so happens that once the user has entered a list of keywords, I execute the R script and present the user with the plot. Now when the user enters some more keywords, they are appended to the previous list and since the complete list of keywords are sent to the R script, it performs the complete task again. It is obvious that it is doing a lot of unnecessary work of finding the keywords that were there in the first run too. For example, in the first run, list of keywords:- "One", "Two", "Three". In the second run, list of keywords:- "One", "Two", "Three", "Four", "Five", "Six" In the second run, it wastes a lot of time working on keywords "One", "Two" and "Three". Since the dataset will be huge and so will the number of keywords, it will take a lot of time to execute. My question is, is there a way I could prevent this, retain the previous plot and modify the previous plot to present the new keywords as well?
1d0206db52766f233ed3577eee5c0538806c5dd7e77384d650884cb5aa2bc71c
['b1400f67251344c4985bc9baf7ab8c3b']
No, the proof has a flaw if you have assumed that a1 to an are bases of A and a(n+1) to a(k) are bases of B because it is very well possible that they have some common bases, and so you need to eliminate the dependent vectors and re-state the statement with the remaining bases as a combination of bases of A and B.
26616ff6a2aa6b09b8c06d2599162e3095b12bd5bae0e0bb89493bf6d1edbd0b
['b1400f67251344c4985bc9baf7ab8c3b']
I know that the solutions of linear differential equations can be added with any scalar coefficients and it is quite easy to prove too. What I am not able to understand is if we have an equation as follows:- $$\frac{du}{dt} + a\frac{du}{dx} = \mu_2\frac{d^2u}{dx^2} + \mu_3\frac{d^3u}{dx^3} + \mu_4\frac{d^4u}{dx^4} + ...$$ Can we individually solve the equation for$$\frac{du}{dt} + a\frac{du}{dx} = \mu_2\frac{d^2u}{dx^2}$$ and $$\frac{du}{dt} + a\frac{du}{dx} = \mu_3\frac{d^3u}{dx^3}$$ and so on and simply add the solutions due to each of these. I have encountered this situation while solving discretised wave equation but I feel that splitting the RHS might change the solution completely. Kindly tell me whether the approach is correct or not? If yes, then why and if no, then also why?
383b3838d7b807e2a943629ae8b4e362b7a4cebc64246b04725f57c11e291b8c
['b14a88eb8f6f41cc99b629299d5a543d']
I'm messing with the Linux kernel (4.14.0), specifically the page cache, but I am unable to trigger the page cache writeback mechanism. I thought that all file I/O goes through the page cache, but the code for writeback doesn't seem to be called. I inserted some printk statements around page_check_dirty_writeback() (mm/vmscan.c around line 930), but none of them seem to show up. I've tried 2 methods to trigger page writeback. I wrote a program that simply creates a text file and writes to it, and I also tried running dd if=/dev/zero of=testfile.txt bs=1M count=10 && sync from https://www.thomas-krenn.com/en/wiki/Linux_Page_Cache_Basics. Am I missing something, is the page cache different in 4.14.0 (am I reading old documentation?) Also, if available, where is the best place to ask questions about the kernel? Is it here?
df835599fb5b34790ce38fbeae75e2b86b052fcdc6f26a316e3947e810ca50a7
['b14a88eb8f6f41cc99b629299d5a543d']
I am trying to write a C library, and, in short, I need to maintain a cache between the application and underlying non-volatile memory. Linux already does this with a page cache. It would be useful for me to use this instead of creating my own cache. From what I understand, the OS periodically syncs the contents of the page cache to storage. Is it possible for me to turn off automatic syncing/flushing to disk within the page cache in Linux? Perhaps on a per-application basis?
dba34d60421cee60edf01eb75998aec07e734d8d3dc5e5bfa24e13f5278b3c1c
['b1556cadfde844d08017cdaaec3e48d1']
to be clear on your points. **1** Only use html in the page text edit window? **2** In my case, the added script (see above) in the page text edit window does not appear to be stripped since the new feature/plugin is functional when viewing the page outside of the editing mode. **3** I'll have to experiment with the procedure you proposed, <PERSON>. Is that standard practice or a working hack? Thanks for the input.
62982d006b6387b14a7294b367ba4435daf477638ce1db33378d8485e88dcdf2
['b1556cadfde844d08017cdaaec3e48d1']
Here is what worked for me. I disabled it in Firefox add-ons (Tools, Add-ons). It would not let me uninstall it, so I closed Firefox and searched my entire c drive for babylon. I came across a folder labeled babylon and deleted it, as well as a .jss file. Once those were deleted I started Firefox again, and it was gone from my add-ons list.
5669974302534de1ac63f42b4b59eb6a452c7d1a57d40cce2128dbb2b44cfe78
['b1687a159d514321bce81899d5f48073']
thanks for the quick response. If I'm understanding correctly (and borrowing heavily from the cross validated page on TOST), I run t-tests in excel hypothesizing a difference of +/- delta, where delta is my chosen limit in the same unit as the mean, I get a t stat to which I can compare to the 't critical one-tail'. I'm not sure I follow the description of alpha: if I run both of these tests with alpha = 0.05, is my overall alpha 0.1?
cefd46a62cd9c37201a90a328218da695c9fcc1c8d741af9110dd969d0c3a92a
['b1687a159d514321bce81899d5f48073']
I have fixed in-car install of a Nexus 7 (5.1.1) using Timur's kernel. For years this has been working fine - turn on ignition,and the tablet boots straight to the home screen (or last activity it was doing). I only take the table out to charge every so often, I DO NOT alter settings - I'm happy with them. Now, suddenly, the tablet boots to the Swipe/Notification screen - this is a royal p-i-t-a. If I don't react quickly enough the screen turns off and I have to take the tablet out of the dash in order to access the power button. No updates have been applied to the tablet, I'm sure of it. All accessibility options are turned off. Noticed Security is set to swipe - but I haven't set this. How did I disable it? Thanks Not sure if this a coincidence, but only seemed to happen after I had changed the car battery....
9a9a1e1675238bbdadde4ec06786f5b63fc762be3414829676e96f3e9983c063
['b172713d45b243999ded87a6c8ce09b8']
Is it possible to change domain name for images like for example, here is path to my images: https://example.com/public/-path-to-image is it possible to change it to for example: https://example2.com/public/-path-to-image but still serve images from example.com? I want to hide real path so that users see example2.com instead of example.com and block direct access to my images. Can this be done when using HTTPS on server?
ee1b6573c25e4b50c28a52c0553eac71cf98adcd2eab3618ef72018cd0e91ddb
['b172713d45b243999ded87a6c8ce09b8']
Guys I want to add shorted links from ouo .io to my wordpress site. I woudl like to use their API: You can also use our simple API to shorten your link. The below link will generate a new shorten link and print out in a blank page, it is very easy to inject this API to your application. http://ouo.io/api/WYTlzR4X?s=yourdestinationlink.com I am adding links by additional filed (op1) in post: <a href="<?php echo get_sub_field('op1'); ?>" rel='nofollow' target="_blank" class="prv"> I want to get that link shorted, because now I use it like: <a href="http://ouo.io/s/WYTlzR4X?s=<?php echo get_sub_field('op1'); ?>" rel='nofollow' target="_blank" class="prawyklik"> what I get is: http://ouo.io/s/WYTlzR4X?s=https://link-added-to-op1.com and I want it to be: http://ouo.io/39pkesT I want to hide real links and show shorted. Please tell me how can I do it to work this way ?
52003678260352625c50c6310cd323d285a20ef55698783bce4af5cfb789a31a
['b17a9682d82d4860ac2ecdb600950bf8']
I'm very new to Python, so I apologize for any mistaken terminology. I am trying to use matplotlib to plot data that I get from a CSV file. I've read that matplotlib only accepts timing data passed to it in the format created by strptime(). My problem arises from the fact that the time data is given to me in the format HH:MM since midnight on the day of data collection. The wrinkle is that instead of giving me the actual time in seconds, it uses a decimal fraction of a minute to represent seconds. I would like to have sub-minute resolution in my data, so how can I turn a datum like 04:26.9 into the more conventional 04:26:54 when passing each datum to strptime(). Thanks in advance :)
314fe8c4e8e94a685883f9a540a0e60141ee01653411a7df09d3cc3ae0fb6c1f
['b17a9682d82d4860ac2ecdb600950bf8']
I have a csv file with ~2.3M rows. I'd like save the subset (~1.6M) of the rows which have non-nan values in two columns inside the dataframe. I'd like to keep using pandas to do this. Right now, my code looks like: import pandas as pd catalog = pd.read_csv('catalog.txt') slim_list = [] for i in range(len(catalog)): if (pd.isna(catalog['z'][i]) == False and pd.isna(catalog['B'][i]) == False): slim_list.append(i) which holds the rows of catalog which have non-nan values. I then make a new catalog with those rows as entries slim_catalog = pd.DataFrame(columns = catalog.columns) for j in range(len(slim_list)): data = (catalog.iloc[j]).to_dict() slim_catalog = slim_catalog.append(data, ignore_index = True) pd.to_csv('slim_catalog.csv') This should, in principle, work. It's sped up a little by reading each row into a dict. However, it takes far, far too long to execute for all 2.3M rows. What is a better way to solve this problem?
b9e7923dbfd1a42fee6c1943a5ca22987d8e7c4b08253fff835f43639d0e3f95
['b17ae07944164724903948b40c64d58d']
Thanks to <PERSON> and <PERSON> for pointing me in the correct direction. I'll answer my own question since I've figured out how to do this. There are $9^{d-1}8$ integers of length $d$ that don't have a single number (e.g. integers without 2 in the decimal representation). The smallest of these is $10^{d-1}$, so their reciprocals are bounded above by $9^{d-1}8 \times 10^{1-d} = 8 \times (9/10)^{d-1}$. Summing over $d$, this is a geometric series that converges to 80. Therefore the original sum converges.
370c43e48ca08309f0871c781fbf448d55d0d4466cd8ebb7eadc17d863bee6b8
['b17ae07944164724903948b40c64d58d']
The hint given is to look at the <PERSON> expansion at every point in space. It's not immediately clear to me how to proceed with this. If I calculate out the equation of the tangent plane at a point $(x,y,z) = (a,b,c)$ with $$\nabla F(a,b,c) \cdot ((x,y,z) - (a,b,c)) = 0$$ where $F(x,y,z) = 3x^2 - 2xy + 2y^2 - z$ and I substitute in $c = 3a^2 - 2ab - 2b^2$, I get a very nasty equation. I can also calculate the <PERSON> expansion of $f(x,y) = 3x^2 - 2xy + 2y^2$, which to the second degree or above is just that polynomial itself, and I don't really see how that helps.
9ac6c62e6ab2e5bafc76b1e19f55ca4f63334daa332399c15b8452e1d80aa1f6
['b18aa9bfdcda424795d66808bb1c6fe2']
What do you actually want to return to the user once the application exits RestJsonHelloWorldFlow1 flow? I think as <PERSON> said your problem is the tag. I managed to solve the exception by removing the tag, and convert the payload into an object exactly after the HTTP inbound endpoint. Config XML <flow name="RestJsonHelloWorldFlow1" doc:name="RestJsonHelloWorldFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="credit/new" doc:name="HTTP" mimeType="application/json" /> <json:json-to-object-transformer doc:name="JSON to Object" returnClass="com.creditmobile.domain.Request" /> <component class="com.creditmobile.domain.TransactionResponse" doc:name="Java"/> <object-to-string-transformer doc:name="Object to String"/> </flow> basically you have 1) An HTTP inbound endpoint which is set to request-response 2) immediately convert the JSON to Object 3) Then I have created a java component to perform the required processing; by creating a class which implements org.mule.api.lifecycle.Callable. Got the transaction code from the payload and set the overridden method to return an object of type string public class TransactionResponse implements Callable { @Override public Object onCall(MuleEventContext eventContext) throws Exception { // Type casts payload to object Request Request requestObject = (Request) eventContext.getMessage().getPayload(); int code = Integer.valueOf(requestObject.getTransactionCode()); String reply = ""; switch (code) { case 1: reply = "New"; break; case 2: reply = "Delete"; break; } return reply; } } 4) Then i terminated the flow by adding the Object to String component, Or place the Object to JSON component if you wish to return a JSON object to the user.
24ecafa4f05f6cd007bdc062596a7be72af07e0e47d424775751b5d577133fb8
['b18aa9bfdcda424795d66808bb1c6fe2']
Solved and thank you I changed BodyStyle to "Bare" So my serivce interface is as follows: [OperationContract] [WebInvoke(UriTemplate = "AddNewLocation", Method="POST", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] string AddNewLocation(NearByAttractions newLocation); Then implemented my client as follows: MemoryStream ms = new MemoryStream(); DataContractJsonSerializer serialToUpload = new DataContractJsonSerializer(typeof(NearByAttractions)); serialToUpload.WriteObject(ms, newLocation); WebClient client = new WebClient(); client.Headers.Add(HttpRequestHeader.ContentType, "application/json"); client.UploadData(GetURL() + "AddNewLocation", "POST", ms.ToArray()); I used WebClient.UploadData instead of UploadString.
10150ddc51d068c0492350cf75b0100d88ea8469859b43bf77a3fb97a7f30ce6
['b1a52c8e20fa48b08bc7e5bdbd0b1146']
Since line numbers change as your file evolves, it's better to insert your new code before or after existing string expressions. Inside your template generator, you can do something like this: inject_into_file 'config/application.rb', :before => " end" do "\n config.logger = Logger.new(config.paths.log.first, 50, 1048576)\n\n" end Note, you can use :after if :before doesn't meet your needs.
b2336df16cb2c1223fe5e97c1c6506faba77460f2675716075843ada99799cbb
['b1a52c8e20fa48b08bc7e5bdbd0b1146']
Assuming you mean configuration data for the application, here's what I do: I create a config/app_config.yml file with my config information, like this: site_name: This awesome site support_email: <EMAIL_ADDRESS> Then, at the top of config/application.rb (right below the first 'require' statement), I add this: # Load application-specific configuration from app_config.yml require 'yaml' APP_CONFIG = YAML.load(File.read(File.expand_path('../app_config.yml', __FILE__))) Now, any time I need to access the configuration data, I can get to it via the APP_CONFIG hash, like so: html = "For support, please e-mail #{APP_CONFIG['support_email']}" Note, the above is for Rails 3. For rails 2, instead of loading the config in application.rb, you would put the statements into config/preinitializer.rb. See http://asciicasts.com/episodes/226-upgrading-to-rails-3-part-2 for more details.
4aa6337d7b8818c5641e7f34026f26224e4b4a9f7db6ae1e1129a88d8efa953b
['b1aa70a5bf0849c7948902afa8da6573']
I'm currently developing a website, one of my first bootstrap websites. Facing a problem that I've been trying to solve for a few hours now. I'm placing a divider or separator that I made in photoshop (png image) on the edge of a section. It looks like this on desktop size: https://www.dropbox.com/s/qxf7dheb0k79q2b/Screenshot%202014-09-30%2023.02.50.png?dl=0 But on smaller screens this happens: https://www.dropbox.com/s/w4je7milallfrqn/Screenshot%202014-09-30%2023.10.50.png?dl=0 I'm sure it due to my bad CSS. Here is my html and css: <section class="hero-section text-center"> <img class="separator img-responsive"src="images/separator.png"> <div class="container"> <h1>Download Now</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <hr> <button class="btn btncta">Download Now</button> <p class="small">*Needed for developers</p> </div> </section> CSS: .separator{ display: block; margin-left: auto; margin-right: auto; position: relative; top:318px; } Any way I could fix this? Is it using a image for divider outdated (probably is)?
924aaae03957ab7ff087b2ee98d5358e7231226c314d26e527a4c4f59a711b27
['b1aa70a5bf0849c7948902afa8da6573']
I am having a bunch of problems with pointers and dynamic arrays here. I have a function that I call, that does a bunch a stuff, like removing an ellement from the dynamic array , which leads me to reallocating memory to one of those dynamic arrays. The problem is I call functions within functions, and I can't return all my values properly to the Main. Since I can't return 2 values, how can I do this? structure1* register(structure1 *registerArray,structure2 *waitingList, int counter){ //Bunch of code in here registerArray = realloc(inspecao, (counter)+1); waitingList = eliminate(waitingList, 5, counter); //Doesn't matter what it does really return registerArray; } structure1* eliminate(structure1 *arrayToEliminateFrom, int positionToEliminate, int *counter){ //The code for this doesn't matter //All I do is eliminate an ellement and reallocate it arrayToEliminateFrom = realloc(arrayToEliminateFrom, (*counter-1)*sizeof(structure1)) return arrayToEliminateFrom; } As you can see , I don't know how to return the pointer to the waitingList dynamic array to the Main. How can I do this? I have searched everywhere. Help
f82acda9d9ff59f052c1613b016d39ff6967ace9b209a0280e1dd8e8425b34cf
['b1b086b08ecc4b488e653c11e9b4c10e']
Still top result in google, but for me the solution in a loop was to use a control code of `\033[2K` which will erase the current line.. All i had to do was prepend it to my print statement. This way you only clear a line before you write to it.. Works well in some situations.
02f8ff3e7970e47f6843f1fef961ae89fb5e62af3ddd60993f1e78db76869460
['b1b086b08ecc4b488e653c11e9b4c10e']
<PERSON>'s answer is great. Here it is in javascript: function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; } function map(value, fromSource, toSource, fromTarget, toTarget) { return (value - fromSource) / (toSource - fromSource) * (toTarget - fromTarget) + fromTarget; } function getColour(startColour, endColour, min, max, value) { var startRGB = hexToRgb(startColour); var endRGB = hexToRgb(endColour); var percentFade = map(value, min, max, 0, 1); var diffRed = endRGB.r - startRGB.r; var diffGreen = endRGB.g - startRGB.g; var diffBlue = endRGB.b - startRGB.b; diffRed = (diffRed * percentFade) + startRGB.r; diffGreen = (diffGreen * percentFade) + startRGB.g; diffBlue = (diffBlue * percentFade) + startRGB.b; var result = "rgb(" + Math.round(diffRed) + ", " + Math.round(diffGreen) + ", " + Math.round(diffBlue) + ")"; return result; } function changeBackgroundColour() { var count = 0; window.setInterval(function() { count = (count + 1) % 200; var newColour = getColour("#00FF00", "#FF0000", 0, 200, count); document.body.style.backgroundColor = newColour; }, 20); } changeBackgroundColour();
26033c5307c01ff2520ebba8def16e3c7e22a368609d90f913e6342afc0bed94
['b1b4df739c8d474fbada2cd2d8df4b03']
хочу на весь хостинг или на конкретный сайт установить ограничение по IP таким образом, чтобы при обращении к файловой системе с признаком "ЗАПИСЬ" (т.е. пытаются записать, загрузить или изменить какие-то файлы любыми каналами, через любые порты, кроме браузеров и порта 80, 8080 и аналогичным им) высылался email на почту админу со ссылкой подтверждения запрашивающего доступ IP (и доп.информацией по этому IP). Этот IP после клика по ссылке подтверждения записывается в список разрешенных (запрещено всё, кроме разрешенных). как это сделать? есть варианты? в какую сторону копать?
7890e794347670be1c3099493733c7f4f4138f2b2523d1d0b7fbd90b006d9cd5
['b1b4df739c8d474fbada2cd2d8df4b03']
I have Ubuntu installed on my system. Now I have a project to do using Visual Studio in C#. I want to know whether I can install Windows inside a Virtual Box and then install Visual Studio. Will I be able to develop Csharp application in a virtual environment? Will the Virtual Box support the running of Visual Studio software? Thanks in advance.
c2c10a7e896cf0001fa659f40afaa3fe34670b6e0c29b35631e468aecf493f3d
['b1ce5c64e14e4cebb7a76b3a6c642feb']
when i click search no result come i tried to search by name but no result i used filterable but i dont no the reason only recyclerview all name appear in activity not the name that i selected i tried everything and hope find solution for that RecyclerView.Adapter <ClientAdapter.ClientHolder> implements Filterable{ ArrayList <name> mylist; Context context; ArrayList<name> arraylist;; public ClientAdapter (ArrayList<name>mylist,Context context){ this.mylist=mylist; this.context=context; } @Override public ClientHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view= LayoutInflater.from(context).inflate(R.layout.clientexp,parent,false); ClientHolder holder=new ClientHolder(view); return holder; } @Override public void onBindViewHolder(ClientHolder holder, int position) { holder.img.setImageBitmap(convertToBitmap(mylist.get(position).getImage())); holder.Name.setText(mylist.get(position).getName().toString()); final int idd=mylist.get(position).getId(); final String id=Integer.toString(idd); holder.layout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Bundle bundle=new Bundle(); Intent intent=new Intent(context,DeletePerson.class); bundle.putString("id",id); intent.putExtras(bundle); view.getContext().startActivity(intent); } }); } @Override public int getItemCount() { return mylist.size(); } @Override public Filter getFilter() { return new Filter() { @Override//charsequance حروف مسلسله protected FilterResults performFiltering(CharSequence charSequence) { String charString=charSequence.toString(); if(charString.isEmpty()) { arraylist=mylist; }else { ArrayList<name>filteredlist=new ArrayList<>(); for(name filtername:mylist) { if(filtername.getName().toLowerCase().contains(charString.toLowerCase())) { filteredlist.add(filtername); } } arraylist=filteredlist; } FilterResults filterResults=new FilterResults(); filterResults.values=arraylist; filterResults.count =arraylist.size(); return filterResults; } @Override protected void publishResults(CharSequence charSequence, FilterResults filterResults) { arraylist=(ArrayList<name>)filterResults.values; notifyDataSetChanged(); } }; } public class ClientHolder extends RecyclerView.ViewHolder { TextView Name; LinearLayout layout; ImageView img; public ClientHolder(View view) { super(view); Name=(TextView)view.findViewById(R.id.name); layout=(LinearLayout)view.findViewById(R.id.linear); img=(ImageView)view.findViewById(R.id.imgid); } } private Bitmap convertToBitmap(byte[] b){ return BitmapFactory.decodeByteArray(b, 0, b.length); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.search, menu); // Associate searchable configuration with the SearchView SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.action_search) .getActionView(); searchView.setSearchableInfo(searchManager .getSearchableInfo(getComponentName())); searchView.setMaxWidth(Integer.MAX_VALUE); // listening to search query text change searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { // filter recycler view when query submitted adapter.getFilter().filter(query); return false; } @Override public boolean onQueryTextChange(String query) { // filter recycler view when text is changed adapter.getFilter().filter(query); return false; } }); return true; } @Override public boolean onOptionsIte`enter code here`mSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_search) { return true; } return super.onOptionsItemSelected(item); }}
8f2c149fca7dc35d450db1269224dfe4eb4b0012ef807d88abd1f164738368b1
['b1ce5c64e14e4cebb7a76b3a6c642feb']
now i am trying to get my current location but i cant get it only one location 37.4219983,-122.084 this is location from any where i cant get my true location and this is my code private void getDeviceLocation(){ mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this); try{ if(mLocationPermissionsGranted){ final Task location = mFusedLocationProviderClient.getLastLocation(); location.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if(task.isSuccessful()){ Location currentLocation = (Location) task.getResult(); current_lat=currentLocation.getLatitude(); current_lng=currentLocation.getLongitude(); Log.e("currentLocation",current_lat+"....."+current_lng); moveCamera(new LatLng(current_lat,current_lng), 15f); mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { mMap.clear(); MarkerOptions markerOptions=new MarkerOptions(); markerOptions.position(new LatLng(latLng.latitude,latLng.longitude)).title("disance"); float[]results=new float[10]; Location.distanceBetween(current_lat,current_lng,latLng.latitude,latLng.longitude,results); markerOptions.snippet("ditance ="+results[0]); mMap.addMarker(markerOptions); } }); mMap.clear(); }else{ Toast.makeText(add_center_map.this, "unable to get current location", Toast.LENGTH_SHORT).show(); } } }); } }catch (SecurityException e){ } } private void moveCamera(LatLng latLng, float zoom){ mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom)); }
04c2834204c751541f57e8a35104c5a6e7bc72a49ba9f83b6f0840f8ffcc6b00
['b1d5173e6127497fa1010153aab7d367']
I am trying to set my environment variables for the Apache webserver as it is not the correct Perl package. I followed the recommendation of one of the answers on Server Fault for updating the httpd file and adding the environment variables and it still isn't working. After I updated the httpd file I bounced the httpd process as well. On the command line the correct PATH is being used for Perl. Can anyone offer any guidance? Error in apache error.log file: [pid 29460] [client <IP_ADDRESS>:57768] AH01215: install_driver(Informix) failed: Can't locate DBD/Informix.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 7) The correct location of Perl where Apache should check for Perl Modules /usr/bin/perl Updated /etc/sysconfig/httpd file #Configuration of variables for webserver export INFORMIXDIR=/opt/informix export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/tools export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts PATH=$PATH:$HOME/bin:$INFORMIXDIR/bin:$LD_LIBRARY_PATH export PATH Other environment variables OS Package: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 CONTEXT_DOCUMENT_ROOT = /var/www/cgi-bin/
b7bd543f8000a9b3b66827ef6e8c91f58fd02f0348afc47ea936f13f704b25a6
['b1d5173e6127497fa1010153aab7d367']
Thanks. Ok I don't have that file under /etc/httpd. I'll see if our SA might know? That link wasn't too clear for me. Okay I'll work on setting the environment variables in the CGI script then. Was thinking it was just something we could set just like in the bash profile for all users.
d48a919436b923088f7ac2e13d55e5aa81151402a81af9467fa48c8523e8bbbe
['b1e09e5b9cac43dbaf084217a91d1956']
While populating Tree Grid data using ejDataManger, CRUD actions will be handled using inbuilt Post (insert), Put (update), Delete requestType irrespective of CRUD URL’s. So, no need to bind ‘removeUrl’ for deleting records. And, in the provided code example parameter is passed in the URL to fetch data hence the reported issue occurs. Using ejQuery’s addParams method we can pass the parameter in URL. You can find the code example to pass the parameter using Tree Grid load event and the parameter is retrieved in server side using DataManager. [html] var dataManager = ej.DataManager({ url: "api/Values", adaptor: new ej.WebApiAdaptor() }); $("#treeGridContainer").ejTreeGrid({ load: function (args) { // to pass parameter on load time args.model.query.addParams("keyId", 48); }, }); [controller] public object Get() { var queryString = HttpContext.Current.Request.QueryString; // here we can get the parameter during load time int num = Convert.ToInt32(queryString["keyId"]); //.. return new {Items = DataList, Count = DataList.Count() }; } You can find the sample here for your reference. Regards, Syncfusion Team
25e9457b6707f80827654200a7249ad48d0e95cc9d9737462a44e8e29d3a8eaf
['b1e09e5b9cac43dbaf084217a91d1956']
By using “refreshRow” public method we can refresh the specific row in TreeGrid. Please find the code example below: function actionComplete(eventArgs) { var treeObj = this, //To get the index of newly added row addedRow = treeObj.model.selectedItem; if (eventArgs.requestType === 'addNewRow') { //Newly Added Record is obtained here , which can be updated to database var addedRecord = eventArgs.addedRow; $.ajax({ type: "POST", data: { Name: addedRecord.TaskName }, dataType: "json", url: "/TreeGrid/Add",//Add is Server side method success: function (result) { addedRow.TaskId = addedRow.item.TaskId = result; //To refresh the newly added row treeObj.refreshRow(treeObj.model.updatedRecords.indexOf(addedRow)); }, }); } } Please find the sample from below location Sample Regards, Syncfusion Team
80bd2987cef5827f9f3d5eab84484855dac0951fe33306a0c762be594bfd3fdc
['b1e5d8bc77b54705a1df6dd734bfc71d']
I'm using the BEST package in R as a proxy for the frequentist t-test to measure the difference in means between two groups. However this process is VERY slow, and will simply not converge for the tests that I am trying to run. Is there another method that can work for this? I'm mainly looking for a Bayesian equivalent to a standard t-test.
3d127b5b99c2289a8b42a9abed55f1f5f4c41a9abca33496a72f26c087278920
['b1e5d8bc77b54705a1df6dd734bfc71d']
Interesting. That sort of "rule of thumb" from your newspaper career is the kind of thing I'm curious about. By the way, the app already downloads only the right resolution for the device's native res, and it's stored locally. It's not meant to be fully offline-capable, but it does try to be a little clever about things. Still, if no perfect match for its resolution is available on the server, it has to pick the next best thing, and that's where the "acceptable upscaling" could be relevant. Currently it errs on the side of downloading too-large images.
b13dd3a3ca669cae8e97c8c45a4e537a161b383b84595dc48c3bad364b50aa94
['b1e6c18ec11c400fae03c0b5bb520b35']
The issue is it doesn't work! Things may have changed over the years. I tried putting media queries inside the selectors, at least Firefox complains its an invalid property name. Here's what MDN says: The @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule. It can only be nested inside another conditional group at-rule.
c539c84ebdc34ac46947b2971390378b4c309da3b000a1c80b141099eeb19a59
['b1e6c18ec11c400fae03c0b5bb520b35']
Thanks. I noticed some strange behavior: initially all the variables in `/etc/default/locale` were set to `nl_BE.UTF-8` except `LANG`, which was set to `en_US.UTF-8`. The command `sudo update-locale LC_TIME=en_US.UTF-8` did what I expected. But when I tried to set the regional format in the Ubuntu settings window, `locale` was still the same as before.
fcf1a2ff275d498785c518cb04fe2bd470e6cdb1ac28f3478831ebded8a25ff2
['b1f33b03261c4b0fb08853ecf480655c']
I have a list of sequences to be found in the sequencing data. So I run a for loop to find the match sequences in a dataset, and used Counter() to get the maximum sequences. But I found the Counter() function would add previous loop data, not as separate one. ls = ['AGC', 'GCT', 'TAC', 'CGT'] dataset.txt like a bunch of sequences of "AGTAGCTTT", "AGTTAGC"...... def xfind(seq): ls2 = [] with open(dataset.txt, 'r') as f: for line in f: if seq in line: ls2.append(line) import collections from collections import Counter cnt = Counter() for l in ls2: cnt[l] += 1 print (cnt.most_common()[0]) for l2 in ls: xfind(l2) The results look like: ('AGTAGCTTT", 2) ('AGTAGCTTT", 5) It should be: ('AGTAGCTTT', 2) ('GCT...', 3)
264335eadf1aa35a1bf8c12825a6e9e595730b32818d0f28ec0b10127ce4a553
['b1f33b03261c4b0fb08853ecf480655c']
I download sequences and want to handle the data in python. The first question is formatting the sequences. The sequences like this in below. Each sequence begin with ">", and the protein sequence is in the separate line. Before align the sequence. I need to get all the sequence (strings) for one line. I have tried "str.startswith", but it does not work. And I google, some people say it could be done with regular expression. Anybody can help me with this sequence. Many thanks. '>A/Nayarit/InDRE21/2017_EPI1215815 DTLCIGYHANNSTDTVDTVLEKNVTVTHSVNLLEDKHNGKLCKLRGVVPLHLGKCNIAGWILGNPECESLSTARSWSYIV ETSNSDNGTCYPGDFINYEELREQLSSVSSFERFEIFPKTSSWPNHDSNKGVTAACPHAGAKSFYKNLIWLVKKGNSYPK LNQTYINDKGKEVLVLWGIHHPPTTADQQSLYQNADAYVFVGTSRYSKKFKPEIATRPKVRDQEGRMNYYWTLVEPGDKI TFEATGNLVVPRYAFTMERNAGSGIIISDTPVHDCNTTCQTPEGAINTSLPFQNVHPITIGKCPKYVKSTKLRLATGLRN VPSIQSRGLFGAIAGFIEGGWTGMVDGWYGYHHQNEQGSGYAADLKSTQNAIDKITNKVNSVIEKMNTQFTAVGKEFNHL EKRIENLNKKVDDGFLDIWTYNAELLVLLENERTLDYHDSNVKNLYEKVRNQLKNNAKEIGNGCFEFYHKCDNTCMESVK NGTYDYPKYSEEAKLNREKIDGVKLESTRIYQILAIYSTVASSLVLVVSLGAISFWMCSNGSLQCRICI '>A/Ontario/RV2895/2018_EPI1215825 DTLCIGYHANNSTDTVDTVLEKNVTVTHSVNLLEDKHNGKLCKLRGVAPLHLGKCNIAGWILGNPECESLSTARSWSYIV ETSNSDNGTCYPGDFINYEELREQLSSVSSFERFEIFPKTSSWPNHDSNKGVTAACSHAGAKSFYKNLIWLVKKGNSYPK LNQTYINDKGKEVLVLWGIHHPPTTADQQSLYQNADAYVFVGTSRYSKKFKPEIATRPKVRDQEGRMNYYWTLVEPGDKI TFEATGNLVVPRYAFTMERNAGSGIIISDTPVHDCNTTCQTPEGAINTSLPFQNVHPITIGKCPKYVKSTKLRLATGLRN VPSIQSRGLFGAIAGFIEGGWTGMVDGWYGYHHQNEQGSGYAADLKSTQNAIDKITNKVNSVIEKMNTQFTAVGKEFNHL EKRIENLNKKVDDGFLDIWTYNAELLVLLENERTLDYHDSNVKNLYEKVRTQLKNNAKEIGNGCFEFYHKCDNTCMESVK NGTYDYPKYSEEAKLNREKIDGVKLESTRIYQILAIYSTVASSLVLVVSLGAISFWMCSNGSLQCRICI '>A/Ontario/RV2906/2018_EPI1215828 DTLCIGYHANNSTDTVDTVLEKNVTVTHSVNLLEDKHNGKLCKLGGVAPLHLGKCNIAGWILGNPECESLSTARSWSYIV ETSNSDNGTCYPGDFINYEELREQLSSVSSFERFEIFPKTSSWPNHDSNKGVTAACPHAGAKSFYKNLIWLVKKGNSYPK LNQTYINDKGKEVLVLWGIHHPPTTADQQSLYQNADAYVFVGTSRYSKKFKPEIATRPKVRDQEGRMNYYWTLVEPGDKI TFEATGNLVAPRYAFTMERNAGSGIIISDTPVHDCNTTCQTAEGAINTSLPFQNVHPVTIGKCPKYVKSTKLRLVTGLRN VPSIQSRGLFGAIAGFIEGGWTGMVDGWYGYHHQNEQGSGYAADLKSTQNAIDKITNKVNSVIEKMNTQFTAVGKEFNHL EKRIENLNKKVDDGFLDIWTYNAELLVLLENERTLDYHDSNVKNLYEKVRNQLKNNAKEIGNGCFEFYHKCDNTCMESVK NGTYDYPKYSEEAKLNREKIDGVKLESTRIYQILAIYSTAASSLVLVVSLGAISFWMCSNGSLQCRICI '>A/Nova Scotia/RV2907/2018_EPI1215830 DTLCIGYHANNSTDTVDTVLEKNVTVTHSVNLLEDKHNGKLCKLGGVAPLHLGKCNIAGWILGNPECESLSTARSWSYIV ETSNSDNGTCYPGDFINYEELREQLSSVSSFERFEIFPKTSSWPNHDSNKGVTAACPHAGAKSFYKNLIWLVKKGNSYPK LNQTYINDKGKEVLVLWGIHHPPTTADQQSLYQNADAYVFVGTSRYSKKFKPEIATRPKVRDQEGRMNYYWTLVGPGDKI TFEATGNLVVPRYAFTMERNAGSGIIISDTPVHDCNTTCQTAEGAINTSLPFQNVHPVTIGKCPKYVKSTKLRLATGLRN VPSIQSRGLFGAIAGFIEGGWTGMVDGWYGYHHQNEQGSGYAADLKSTQNAIDKITNKVNSVIEKMNTQFTAVGKEFNHL EKRIENLNKKVDDGFLDIWTYNAELLVLLENERTLDYHDSNVKNLYEKVRNQLKNNAKEIGNGCFEFYHKCDNTCMESVK NGTYDYPKYSEEAKLNREKIDGVKLESTRIYQILAIYSTVASSLVLVVSLGAISFWMCSNGSLQCRICI
48a94ba7009a6058d96f6dceda7cc928bfeda809b7d610b924fa4fd8084fa6eb
['b1f3c9a238ab4786a604c8585ed01816']
I have put G729 library files in my android project but that codec is not shown in GUI. I have try to find G722 for reference but there are so many files for that. So can some one help me to get exact location where I have to add code to enable G729? Any help or suggestion would be appreciable.
7bddddd454a9a87bbb1ebcffd93a1cce10cbca4da9596833b7d2d426137a1fa9
['b1f3c9a238ab4786a604c8585ed01816']
I am using angular js and using and I want to reload grid after every 5 seconds. My angular js code for build grid is as bellow: App.controller('NGTableCtrl', NGTableCtrl); function NGTableCtrl($scope, $filter, ngTableParams, $resource, $timeout, ngTableDataService) { 'use strict'; // required for inner references var vm = this; var data = [ {name: "<PERSON>", age: 50, money: -10 }, {name: "<PERSON>", age: 43, money: 120 }, {name: "<PERSON>", age: 27, money: 5.5 }, {name: "<PERSON>", age: 29, money: -54 }, {name: "<PERSON>", age: 34, money: 110 }, {name: "<PERSON>", age: 43, money: 1000 }, {name: "<PERSON>", age: 27, money: -201 }, {name: "<PERSON>", age: 29, money: 100 }, {name: "<PERSON>", age: 34, money: -52.5 }, {name: "<PERSON>", age: 43, money: 52.1 }, {name: "<PERSON>", age: 27, money: 110 }, {name: "<PERSON>", age: 29, money: -55 }, {name: "<PERSON>", age: 34, money: 551 }, {name: "<PERSON>", age: 43, money: -1410 }, {name: "<PERSON>", age: 27, money: 410 }, {name: "<PERSON>", age: 29, money: 100 }, {name: "<PERSON>", age: 34, money: -100 } ]; // SELECT ROWS vm.data = data; vm.tableParams3 = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data.length, // length of data getData: function ($defer, params) { // use build-in angular filter var filteredData = params.filter() ? $filter('filter')(data, params.filter()) : data; var orderedData = params.sorting() ? $filter('orderBy')(filteredData, params.orderBy()) : data; params.total(orderedData.length); // set total for recalc pagination $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); // EXPORT CSV var data4 = [{name: "<PERSON>", age: 50}, {name: "<PERSON>", age: 43}, {name: "<PERSON>", age: 27}, {name: "<PERSON>", age: 29}, {name: "<PERSON>", age: 34}, {name: "<PERSON>", age: 43}, {name: "<PERSON>", age: 27}, {name: "<PERSON>", age: 29}, {name: "<PERSON>", age: 34}, {name: "<PERSON>", age: 43}, {name: "<PERSON>", age: 27}, {name: "<PERSON>", age: 29}, {name: "<PERSON>", age: 34}, {name: "<PERSON>", age: 43}, {name: "<PERSON>", age: 27}, {name: "<PERSON>", age: 29}, {name: "<PERSON>", age: 34}]; vm.tableParams4 = new ngTableParams({ page: 1, // show first page count: 10 // count per page }, { total: data4.length, // length of data4 getData: function($defer, params) { $defer.resolve(data4.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); // SORTING vm.tableParams = new ngTableParams({ page: 1, // show first page count: 10, // count per page sorting: { name: 'asc' // initial sorting } }, { total: data.length, // length of data getData: function($defer, params) { // use build-in angular filter var orderedData = params.sorting() ? $filter('orderBy')(data, params.orderBy()) : data; $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }); // FILTERS vm.tableParams2 = new ngTableParams({ page: 1, // show first page count: 10, // count per page filter: { name: '', age: '' // name: 'M' // initial filter } }, { total: data.length, // length of data getData: function($defer, params) { // use build-in angular filter var orderedData = params.filter() ? $filter('filter')(data, params.filter()) : data; vm.users = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()); params.total(orderedData.length); // set total for recalc pagination $defer.resolve(vm.users); } }); } If I am using setTimeout inside the function then it is not refreshing new values. Any help/suggestion would be appreciated.
babf68f231dbdf217f8d5ce1190242af517e5974eb5cea4285e0127e585a2547
['b1f766c1444e4e34b4ea12c92521c613']
I want to dynamically generate the field names inside a iteration over a queryset. obj = tblFoo.objects.all() for obj in queryset for item in array print obj.item The array has the filed names for the tblFoo using obj.item gives an error the key doesn't exists, and using a string like, 'obj.' + item gives me the required string but it doesn't get the expected value. Can anyone tell me how is this suppose to be done?
86577fe47b66e49ec28b9878b7e4c0e337c43627bb321960e30ecb64f8d23a2e
['b1f766c1444e4e34b4ea12c92521c613']
Ok here's the deal, I need to get data from Github API say gists from multiple repositories. I don't want to save any data, should I implement streams or is there some other way? in either cases what are the modules I can use to achieve this? There is a per hour rate limit for the calls to the API. Also how should the rate limiting be handled, I have had a look at _.throttle of lodash but didn't get a fair idea how can that be useful.
6b4c1ee05112596c49f2e76faa23ec768a79977ad4a896f31ea9bfe021c7e541
['b1fb2eb8d1b942319f22dee6c000cf30']
I've just recently installed the latest Android SDK (Android 4.1 API16) and the latest Eclipse (Juno Release). When I open up the sample Android projects (via File > New > Project > Android > Android Sample Project) I get a bunch of errors in the code for many of the samples. Most of them are "The method ** must override a superclass method". There are also a lot of "The constructor ** is deprecated". How can I get these errors to go away so that I can run the apps?
556b5c7d0696e0fcbcd243b7d358678f80d4c4ef9fe0ab777bd21601b12f0431
['b1fb2eb8d1b942319f22dee6c000cf30']
Is there a way to use Xpath to parse text between two SETS of tags? For example, see example: <div class="par"> <p class="pp"> <span class="dv">1 </span>Blah blah blah blah. <span class="dv">2 </span> Yada yada yada yada. <span class="dv">3 </span>Foo foo foo foo. </p> </div> <div class="par"> <p class="pp"> <span class="dv">4 </span>Hmm hmm hmm hmm. </p> </div> I want to parse to get an array like below by getting the text between the sets of SPAN tags: array[0] = "Blah blah blah blah."; array[1] = "Yada yada yada yada."; array[2] = "Foo foo foo foo."; array[3] = "Hmm hmm hmm hmm."; Can I use DOMDocument to do this simply? If not, what is the best way to achieve this? Please note that there may be or tags in the middle of the sentences. Such as: ...<span class="dv">5 </span>Uhh uhh <a href="www.uhh.com">uhh</a> uhh. <span class="dv">6 </span>...
b56118eebb40c3d592ef54db3a3aa582a65b0510c8a9e05e5cae3b622f22c993
['b20916ee979e4137a5849df60dfb741b']
I am using the SeatGeek API to pull some data for sporting events. The results of the call I get show 145,000+ results returned in the metadata: meta : {u'per_page': 10, u'total': 145419, u'geolocation': None, u'page': >1, u'took': 7} in_hand : {} When I look at the "Pagination" section of the API documentation, it gives examples of how to format the syntax in order to see more results per page, or to return a different page than the first one: $curl 'https://api.seatgeek.com/2/venues?per_page=25&page=3' But I can't get it to call successfully with the authorization I've been given from SeatGeek: $curl https://api.seatgeek.com/2/events?client_id=MYCLIENTID&client_secret=MYCLIENTSECRET I have tried using curl and python requests. I have tried putting the pagination syntax first and the "clientid/secret" second. I've tried putting the "clientid/secret" first. I've emailed the mods for the API to no avail. This is the first API call I've ever made, so I'm sure there's some tiny formatting error I'm making. The calls return successfully when I'm not using pagination. I just can't view more than one page of the results, and I'd like to view everything. Thank you.
3a3264833de93aacaabb0ec68573c61a549c335d3b79de36c8ec88d7b80513a9
['b20916ee979e4137a5849df60dfb741b']
I'm trying to write a pyspark df to Snowflake using a function I've written: def s3_to_snowflake(schema, table): df = get_dataframe(schema, table, sqlContext) username = user password = passw account = acct snowflake_options = { "sfURL" : account+".us-east-1.snowflakecomputing.com", "sfAccount" : account, "sfUser" : username, "sfPassword" : password, "sfDatabase" : "database", "sfSchema" : schema, "sfWarehouse" : "demo_wh" } sc._jsc.hadoopConfiguration().set("fs.s3.awsAccessKeyId", "KeyId") sc._jsc.hadoopConfiguration().set("fs.s3.awsSecretAccessKey", "AccessKey") ( df .write .format("net.snowflake.spark.snowflake") .mode("overwrite") .options(**snowflake_options) .option("dbtable", table) .option('tempDir', 's3://data-temp-loads/snowflake') .save() ) print('Wrote {0} to {1}.'.format(table, schema)) This function has worked for all but one of the tables I've got in my datalake. This is the schema of the table I'm trying to write. root |-- credit_transaction_id: string (nullable = true) |-- credit_deduction_amt: double (nullable = true) |-- credit_adjustment_time: timestamp (nullable = true) The error I'm getting looks like Snowflake is taking issue with that DoubleType column. I've had this issue before with Hive when using Avro/ORC filetypes. Usually it's a matter of casting one datatype to another. Things I've tried: Casting (Double to Float, Double to String, Double to Numeric–this last one per the Snowflake docs ) Rerunning DDL of the incoming table, trying Float, String, and Numeric types One other thing of note: some of the tables that I've transferred successfully have columns of DoubleType. Unsure of what the issue with this table is.
fca3129d1510413d72e0437f6b8b7c460100701ee6a5e5cd75313e0af1685c51
['b20e091f732c44a9ad04b8f659118969']
I have been using sails.js on a project which will show posts near a users location, however while I have had no trouble in finding references and tools to geocode an address I cannot find any information on finding these by distance from another set of coordinates, the way you would using regular mongodb. my places model is: module.exports = { attributes: { longitude: { type: 'float', required: true }, latitude: { type: 'float' }, country: { type: 'string' }, city: { type: 'string' }, stateCode: { type: 'string' }, zipcode: { type: 'string' }, streetName: { type: 'string' }, streetNumber: { type: 'string' } } }; How would i compose a find of this model in order to find and sort by distance within a set range?
bb7388bf4793ec16c830fd755ad48ccdd448b4a6552bb4cd636443760b56d55f
['b20e091f732c44a9ad04b8f659118969']
I am getting this error from mysql: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long) *pi()/180 / 2), 2) ))as distance FROM wp_places_locator dest having dista' at line 1 when using this query: set @orig_lat=121.9763; set @orig_lon=37.40445; set @dist=10; SELECT *,3956 * 2 * ASIN(SQRT(POWER(SIN((@orig_lat -abs(lat)) * pi()/180 / 2),2) + COS(@orig_lat * pi()/180 ) * COS(abs(lat) *pi()/180) * POWER(SIN((@orig_lon - long) *pi()/180 / 2), 2) ))as distance FROM wp_places_locator dest having distance < @dist ORDER BY distance limit 10\G; the code is adapted from here: http://arubin.org/files/geo_search.pdf to search my database for geolocation coordinates near coordinates it will recieve and sort them in order of distance from the recieved coordinates. any help would be really appreciated.
bfaa8a3469169a56c9041664153c076e7d9478bb996200f32c9c1240b884019e
['b215632900324f3bbd70bcb929de59be']
I have an app which has 2 activities. The main activity has a list view of items. The other activity is a form to add a new item, which will later be viewed in the main activity. Is it possible in some setup phase after first launch to generate a key pair from an entered in password and then use the public key to encrypt the form data entered in to the add item activity, and then later when viewing the items require the user to enter in the same password to decrypt the data. I am trying to avoid storing the private key needed to decrypt the password anywhere and recreate this decryption key from the entered in password. I am also trying to avoid having to enter in the password each time a new item is added, which is why I was hoping to use the public key to encrypt the data, as this can be stored. Any help on this will be greatly appreciated.
0a8b5a8ce6f2dcd0edfa6d5217b444bc1b6c697a3b02141e68eacebcc2f3f5c2
['b215632900324f3bbd70bcb929de59be']
I have an application that downloads data in a background service and I want to be able to update an activity UI if they are currently running the application or trigger a Notification if they are not. How do I know if the application is currently in the foreground? I could register a BroadcastReceiver inner class in the activity and trigger this if its in the foreground otherwise uses notification but I don't know how I can check what action to take. Thanks for any replies.
73ac998314c6bcbb9e15db3f5cf1595f96b5346db7dccf478c6fc03cf4c30448
['b22090e97e9f474880d9257684a2f60c']
The "error" pylint reports on PyQT import is because since PyQT has some C++ or some C in it, pylint cannot easily and automatically introspect the PyQt module and determine if your code correctly imports bits of that 3rd party module. To solve that, there is an plugin project to pylint called pylint-brains into which one can specify ways of introspecting specific modules (or faking their introspection). It would be nice to have a contribution that would remove the "E" of this pretty common import. For the ImportError, as discussed in the comments, I believe either you have to re-install PyQt for this version of python or PyQt is not yet compatible with 3.3, or something in your pythonpath is wrong.
56d6c072d5b6e8d3b3dd4c1173599b292610a6ae274dbc7a61441700e2f7c703
['b22090e97e9f474880d9257684a2f60c']
I am importing some RDF dumps into Virtuoso Open Source edition (6.x). I was wondering if there is a performance difference between importing different serializations of the same data (I have NT/N3/XML available). While I'm at it : has anyone seen import performance differences when using Striping on a single disk ?
aab700fecbd3d5f273913579cea847892c7b8109d8bbb27c4755c1dd18981f46
['b236538f5698419ea0b3affbeace9d69']
It's right below in the doc link that you provided: You may customize the error messages used by the form request by overriding the messages method. This method should return an array of attribute / rule pairs and their corresponding error messages. So, put this in your Request: public function messages() { return [ 'password.required' => 'The password field is required.', 'password_confirmation.required' => 'The password confirmation field is required.', ]; }
632120357e532d5619d5a22d27ee920be4975d7ad4f739e5c5e94543c7dd95d9
['b236538f5698419ea0b3affbeace9d69']
Well, I think your going in the right direction. Definitely a boolean field (a flag) private for the model Party. I wouldn't create a groups_invitations table. Rather, when a group is invited - create an invitation for every user belonging to that group. I think it's just easier that way. As for the users_invitations table... maybe try to include that in the users_parties table(if you want to strictly follow Cake's conventions - it should actually be parties_users). Something like: id party_id user_id coming (boolean) When a user is invited to a private party, you create a link (a record) between him and the party, it is up to him to change coming to true. As for public parties - the user creates a link(a record) when declaring arrival (setting coming to true). For adding (and deleting) HABTM records, see this great behavior. Well, taking a second to think about it - maybe including invitations in the join table isn't the best idea - too complicated I guess. Looking forward to some comments on that, since I'm torn.
d4d77504e121a35eedddb9912138890e6fd4bb4622c49b4777cb8af9705cdc78
['b241b3ea4459494389e024b2c7c37698']
I know this question has been asked in a variety of formats, but not QUITE my situation, so I'm asking it again (sorry)... I have a Docker environment on my Windows 10 machine. There is a file on the remote Docker "server" that I want to copy to my local Windows machine. I can open a remote prompt to my Docker Container and the file 'OrderConfTest.pdf' is there: [CSERVER]: PS C:> dir Directory: C:\ Mode LastWriteTime Length Name d----- 2/5/2020 12:05 PM databases d----- 2/5/2020 12:05 PM driversetc d----- 1/23/2020 10:59 AM git d----- 1/22/2020 3:33 PM driversetc d----- 2/5/2020 12:05 PM host d----- 3/10/2019 9:54 AM inetpub d-r--- 3/10/2019 12:28 PM Program Files d----- 3/10/2019 12:28 PM Program Files (x86) d----- 2/5/2020 12:05 PM Run d----- 3/10/2019 12:28 PM Test Assemblies d----- 1/23/2020 12:53 PM TestToolKit d----- 3/10/2019 7:39 PM UpgradeToolKit d-r--- 3/10/2019 9:54 AM Users d----- 2/5/2020 12:06 PM Windows -a---- 2/6/2020 9:38 AM 22470 OrderConfTest.pdf My local machine name is LAMIS-RS-A91 I am then entering this command: [CSERVER]: PS C:> Copy-Item "C:\OrderConfTest.pdf" -Destination "\LAMIS-RS-A91\c$\" Result is: The network path was not found + CategoryInfo : NotSpecified: (:) [Copy-Item], IOException + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand I also tried Copy-Item -path "C:\OrderConfTest.pdf" -Destination "\LAMIS-RS-A91\c$\" Copy-Item -path "C:\OrderConfTest.pdf" -Destination "\LAMIS-RS-A91\c$" Copy-Item "C:\OrderConfTest.pdf" -Destination "\LAMIS-RS-A91\c$" Any ideas or suggestions, anyone? Thanks <PERSON>
86b4a532221ee0db213a8e79599cb731b74a48cee527e144129e4ee22ffbb436
['b241b3ea4459494389e024b2c7c37698']
I'm trying to build an SSRS report where the dataset is "presented" to SSRS through the application (Microsoft Dynamics NAV2009). The concept of the report is simple - it's a list of pieces of equipment - computers, cellphones, etc. The table has a "related to equipment" field. So Equipment ID "CELL01" may have a "Related to equipment ID" = "Computer 123". And Equipment ID "CAR456" may also have a "Related to equipment ID" = "Computer 123". I want to create a report that lists each piece of equipment, and below it, any "related equipment". Many of the pieces have no related pieces, so the listing needs to look like this: COMPUTER001 Dell Latitude 4mb RAM COMPUTER002 Dell Latitude 16mb RAM COMPUTER123 Dell Latitude 8mb RAM Related Equipment CELL01 Nokia Cellphone CAR456 2011 Ford Taurus COMPUTER135 Sony Laptop 12gb RAM CELL01 Nokia Cellphone CAR456 2011 Ford Taurus Note that the "related items" is only unidirectional - the related items need only to be reported under the "Related to" equipment, and not vice-versa. I have done some due diligence and investigated recursive hierarchies. It appears that this method depends on every "child" having a "parent". In my case, most "children" are "NULL", i.e. most equipment does not have a "related to equipment" id. So if I try to create the list from the bottom up and use recursive hierarchies, in the example below, only the COMPUTER123 and its children would be listed. None of the the other "Parent" records (e.g. COMPUTER001) have any children. Has anyone done an SSRS report similar to this? In "Pure" SQL, this would be akin to having a query using a left outer join, and listing the fields in the primary record even if the JOIN'ed results were NULL, e.g. a list of all salesmen with their orders booked for the week: Select s.Name, i.Invoice_No, i.Invoice_Amt from Salesperson s LEFT OUTER JOIN Invoice i on s.SalespersonID = i.SalespersonID If Salesperson "<PERSON>" didn't make any sales this week, but Salesperson "<PERSON>" made 3 sales and Salesperson "<PERSON>" made 2 sales, You might expect a result something like this: Name Invoice_No Invoice_Amt Bruno 1287 200.00 Bruno 1289 400.00 Joe NULL NULL Sam 1281 65.00 Sam 1283 450.00 Sam 1286 175.00 So how would you construct a Report where the output would be: <PERSON> Invoices: 1287 200.00 1289 400.00 Joe Sam Invoices: 1281 65.00 1283 450.00 1286 175.00 Any suggestions would be appreciated. <PERSON>
6fae98432ef96f294a0abe74c8b734d8ec5f56414eb12462003f8f40675dd5e4
['b288964bec9c417bad66c2f2bd4c4f0d']
Thanks for responding. I have solved the issue by matching the installer with qualifications to the role requirements, and establishing a count of the number of qualifications per installer that matched. This data was then matched by role and count of qualifications required. Eg: role has 2 qualifications, and that is matched to installers who had 2 matching qualifications. Thanks
a81c38ceb3fce7f10dedaab9793e7320e43cac49c331a06166d411aa9da4e935
['b288964bec9c417bad66c2f2bd4c4f0d']
I have been struggling to find a solution to the following. I have a list of installers, who possess a variety of qualifications. The installers are in on table, and the qualifications I am tracking are in another. Currently there are 12 different qualifications, and each installers can have between 0 and 12 to their name. Separately I have a list of clients, who when having work done for them require a minimum level of qualification per installer. This is set up through a client table, a type of work table, and qualification table. ( Same table as above so that both sides of the data refer to the same lists. eg: Client A, has Roofing Work done. In order to work on his roofs, each installer must x out of 12 qualifications listed in the qualifications table. I am getting stuck on obtaining a list of installers whose qualifications specifically meet or exceed that required by the client. The qualifications are specific, in that an installer could have 11 out of the 12 qualifications, however if he does not possess one that is specifically required, he cannot go forward to do the work. The installer to Qualifications table is 1:many. I do not want to limit the list of qualifications as these may change or increase over time. Any guidance forthcoming would be much appreciated.
25524145a7ea3d269db8a11c64bd79054f6a46063036e3b765cd4ee4a77c6ead
['b2b3eb71a2b3428bb378cccafac79503']
I generated json file in the following format (Hope that it will help you) : { "countries": [ { "code": "+7 840", "name": "Abkhazia" }, { "code": "+93", "name": "Afghanistan" }, { "code": "+355", "name": "Albania" }, { "code": "+213", "name": "Algeria" }, { "code": "+1 684", "name": "American Samoa" }, { "code": "+376", "name": "Andorra" }, { "code": "+244", "name": "Angola" }, { "code": "+1 264", "name": "Anguilla" }, { "code": "+1 268", "name": "Antigua and Barbuda" }, { "code": "+54", "name": "Argentina" }, { "code": "+374", "name": "Armenia" }, { "code": "+297", "name": "Aruba" }, { "code": "+247", "name": "Ascension" }, { "code": "+61", "name": "Australia" }, { "code": "+672", "name": "Australian External Territories" }, { "code": "+43", "name": "Austria" }, { "code": "+994", "name": "Azerbaijan" }, { "code": "+1 242", "name": "Bahamas" }, { "code": "+973", "name": "Bahrain" }, { "code": "+880", "name": "Bangladesh" }, { "code": "+1 246", "name": "Barbados" }, { "code": "+1 268", "name": "Barbuda" }, { "code": "+375", "name": "Belarus" }, { "code": "+32", "name": "Belgium" }, { "code": "+501", "name": "Belize" }, { "code": "+229", "name": "Benin" }, { "code": "+1 441", "name": "Bermuda" }, { "code": "+975", "name": "Bhutan" }, { "code": "+591", "name": "Bolivia" }, { "code": "+387", "name": "Bosnia and Herzegovina" }, { "code": "+267", "name": "Botswana" }, { "code": "+55", "name": "Brazil" }, { "code": "+246", "name": "British Indian Ocean Territory" }, { "code": "+1 284", "name": "British Virgin Islands" }, { "code": "+673", "name": "Brunei" }, { "code": "+359", "name": "Bulgaria" }, { "code": "+226", "name": "Burkina Faso" }, { "code": "+257", "name": "Burundi" }, { "code": "+855", "name": "Cambodia" }, { "code": "+237", "name": "Cameroon" }, { "code": "+1", "name": "Canada" }, { "code": "+238", "name": "Cape Verde" }, { "code": "+ 345", "name": "Cayman Islands" }, { "code": "+236", "name": "Central African Republic" }, { "code": "+235", "name": "<PERSON>" }, { "code": "+56", "name": "Chile" }, { "code": "+86", "name": "China" }, { "code": "+61", "name": "Christmas Island" }, { "code": "+61", "name": "Cocos-Keeling Islands" }, { "code": "+57", "name": "Colombia" }, { "code": "+269", "name": "Comoros" }, { "code": "+242", "name": "Congo" }, { "code": "+243", "name": "Congo, Dem. Rep. of (Zaire)" }, { "code": "+682", "name": "Cook Islands" }, { "code": "+506", "name": "Costa Rica" }, { "code": "+385", "name": "Croatia" }, { "code": "+53", "name": "Cuba" }, { "code": "+599", "name": "Curacao" }, { "code": "+537", "name": "Cyprus" }, { "code": "+420", "name": "Czech Republic" }, { "code": "+45", "name": "Denmark" }, { "code": "+246", "name": "<PERSON>" }, { "code": "+253", "name": "Djibouti" }, { "code": "+1 767", "name": "Dominica" }, { "code": "+1 809", "name": "Dominican Republic" }, { "code": "+670", "name": "East Timor" }, { "code": "+56", "name": "Easter Island" }, { "code": "+593", "name": "Ecuador" }, { "code": "+20", "name": "Egypt" }, { "code": "+503", "name": "El Salvador" }, { "code": "+240", "name": "Equatorial Guinea" }, { "code": "+291", "name": "Eritrea" }, { "code": "+372", "name": "Estonia" }, { "code": "+251", "name": "Ethiopia" }, { "code": "+500", "name": "Falkland Islands" }, { "code": "+298", "name": "Faroe Islands" }, { "code": "+679", "name": "Fiji" }, { "code": "+358", "name": "Finland" }, { "code": "+33", "name": "France" }, { "code": "+596", "name": "French Antilles" }, { "code": "+594", "name": "French Guiana" }, { "code": "+689", "name": "French Polynesia" }, { "code": "+241", "name": "Gabon" }, { "code": "+220", "name": "Gambia" }, { "code": "+995", "name": "Georgia" }, { "code": "+49", "name": "Germany" }, { "code": "+233", "name": "Ghana" }, { "code": "+350", "name": "Gibraltar" }, { "code": "+30", "name": "Greece" }, { "code": "+299", "name": "<PERSON>" }, { "code": "+1 473", "name": "<PERSON>" }, { "code": "+590", "name": "Guadeloupe" }, { "code": "+1 671", "name": "Guam" }, { "code": "+502", "name": "Guatemala" }, { "code": "+224", "name": "Guinea" }, { "code": "+245", "name": "Guinea-Bissau" }, { "code": "+595", "name": "Guyana" }, { "code": "+509", "name": "Haiti" }, { "code": "+504", "name": "Honduras" }, { "code": "+852", "name": "Hong Kong SAR China" }, { "code": "+36", "name": "Hungary" }, { "code": "+354", "name": "Iceland" }, { "code": "+91", "name": "India" }, { "code": "+62", "name": "Indonesia" }, { "code": "+98", "name": "Iran" }, { "code": "+964", "name": "Iraq" }, { "code": "+353", "name": "Ireland" }, { "code": "+972", "name": "Israel" }, { "code": "+39", "name": "Italy" }, { "code": "+225", "name": "Ivory Coast" }, { "code": "+1 876", "name": "Jamaica" }, { "code": "+81", "name": "Japan" }, { "code": "+962", "name": "<PERSON>" }, { "code": "+7 7", "name": "Kazakhstan" }, { "code": "+254", "name": "Kenya" }, { "code": "+686", "name": "Kiribati" }, { "code": "+965", "name": "Kuwait" }, { "code": "+996", "name": "Kyrgyzstan" }, { "code": "+856", "name": "Laos" }, { "code": "+371", "name": "Latvia" }, { "code": "+961", "name": "Lebanon" }, { "code": "+266", "name": "Lesotho" }, { "code": "+231", "name": "Liberia" }, { "code": "+218", "name": "Libya" }, { "code": "+423", "name": "Liechtenstein" }, { "code": "+370", "name": "Lithuania" }, { "code": "+352", "name": "Luxembourg" }, { "code": "+853", "name": "Macau SAR China" }, { "code": "+389", "name": "Macedonia" }, { "code": "+261", "name": "Madagascar" }, { "code": "+265", "name": "Malawi" }, { "code": "+60", "name": "Malaysia" }, { "code": "+960", "name": "<PERSON>" }, { "code": "+223", "name": "<PERSON>" }, { "code": "+356", "name": "Malta" }, { "code": "+692", "name": "Marshall Islands" }, { "code": "+596", "name": "<PERSON>" }, { "code": "+222", "name": "Mauritania" }, { "code": "+230", "name": "Mauritius" }, { "code": "+262", "name": "Mayotte" }, { "code": "+52", "name": "Mexico" }, { "code": "+691", "name": "Micronesia" }, { "code": "+1 808", "name": "Midway Island" }, { "code": "+373", "name": "Moldova" }, { "code": "+377", "name": "Monaco" }, { "code": "+976", "name": "Mongolia" }, { "code": "+382", "name": "Montenegro" }, { "code": "+1664", "name": "Montserrat" }, { "code": "+212", "name": "Morocco" }, { "code": "+95", "name": "Myanmar" }, { "code": "+264", "name": "Namibia" }, { "code": "+674", "name": "Nauru" }, { "code": "+977", "name": "Nepal" }, { "code": "+31", "name": "Netherlands" }, { "code": "+599", "name": "Netherlands Antilles" }, { "code": "+1 869", "name": "Nevis" }, { "code": "+687", "name": "New Caledonia" }, { "code": "+64", "name": "New Zealand" }, { "code": "+505", "name": "Nicaragua" }, { "code": "+227", "name": "<PERSON>" }, { "code": "+234", "name": "Nigeria" }, { "code": "+683", "name": "Niue" }, { "code": "+672", "name": "Norfolk Island" }, { "code": "+850", "name": "North Korea" }, { "code": "+1 670", "name": "Northern Mariana Islands" }, { "code": "+47", "name": "Norway" }, { "code": "+968", "name": "Oman" }, { "code": "+92", "name": "Pakistan" }, { "code": "+680", "name": "Palau" }, { "code": "+970", "name": "Palestinian Territory" }, { "code": "+507", "name": "Panama" }, { "code": "+675", "name": "Papua New Guinea" }, { "code": "+595", "name": "Paraguay" }, { "code": "+51", "name": "Peru" }, { "code": "+63", "name": "Philippines" }, { "code": "+48", "name": "Poland" }, { "code": "+351", "name": "Portugal" }, { "code": "+1 787", "name": "Puerto Rico" }, { "code": "+974", "name": "Qatar" }, { "code": "+262", "name": "Reunion" }, { "code": "+40", "name": "Romania" }, { "code": "+7", "name": "Russia" }, { "code": "+250", "name": "Rwanda" }, { "code": "+685", "name": "Samoa" }, { "code": "+378", "name": "San Marino" }, { "code": "+966", "name": "Saudi Arabia" }, { "code": "+221", "name": "Senegal" }, { "code": "+381", "name": "Serbia" }, { "code": "+248", "name": "Seychelles" }, { "code": "+232", "name": "Sierra Leone" }, { "code": "+65", "name": "Singapore" }, { "code": "+421", "name": "Slovakia" }, { "code": "+386", "name": "Slovenia" }, { "code": "+677", "name": "Solomon Islands" }, { "code": "+27", "name": "South Africa" }, { "code": "+500", "name": "South Georgia and the South Sandwich Islands" }, { "code": "+82", "name": "South Korea" }, { "code": "+34", "name": "Spain" }, { "code": "+94", "name": "Sri Lanka" }, { "code": "+249", "name": "Sudan" }, { "code": "+597", "name": "Suriname" }, { "code": "+268", "name": "Swaziland" }, { "code": "+46", "name": "Sweden" }, { "code": "+41", "name": "Switzerland" }, { "code": "+963", "name": "Syria" }, { "code": "+886", "name": "Taiwan" }, { "code": "+992", "name": "Tajikistan" }, { "code": "+255", "name": "Tanzania" }, { "code": "+66", "name": "Thailand" }, { "code": "+670", "name": "<PERSON>" }, { "code": "+228", "name": "<PERSON>" }, { "code": "+690", "name": "Tokelau" }, { "code": "+676", "name": "Tonga" }, { "code": "+1 868", "name": "Trinidad and Tobago" }, { "code": "+216", "name": "Tunisia" }, { "code": "+90", "name": "Turkey" }, { "code": "+993", "name": "Turkmenistan" }, { "code": "+1 649", "name": "Turks and Caicos Islands" }, { "code": "+688", "name": "Tuvalu" }, { "code": "+1 340", "name": "U.S. Virgin Islands" }, { "code": "+256", "name": "Uganda" }, { "code": "+380", "name": "Ukraine" }, { "code": "+971", "name": "United Arab Emirates" }, { "code": "+44", "name": "United Kingdom" }, { "code": "+1", "name": "United States" }, { "code": "+598", "name": "Uruguay" }, { "code": "+998", "name": "Uzbekistan" }, { "code": "+678", "name": "Vanuatu" }, { "code": "+58", "name": "Venezuela" }, { "code": "+84", "name": "Vietnam" }, { "code": "+1 808", "name": "Wake Island" }, { "code": "+681", "name": "Wallis and Futuna" }, { "code": "+967", "name": "Yemen" }, { "code": "+260", "name": "Zambia" }, { "code": "+255", "name": "Zanzibar" }, { "code": "+263", "name": "Zimbabwe" } ] }
83fff8d2de00b9dc271d0d11592afa28b9916f9b81484ccf024d4315f2139875
['b2b3eb71a2b3428bb378cccafac79503']
I am facing with Unit testing for the first time and I would like to know what is the best approach for the following scenario. I am using Mockito for the tests. The following test is for logic(Presenter) layer and I am trying to verify certain behaviors of the view. App classes The method of the Presenter that need to be include in the test: public void loadWeather() { CityDetailsModel selectedCity = getDbHelper().getSelectedCityModel(); if (selectedCity != null) { getCompositeDisposableHelper().execute( getApiHelper().weatherApiRequest(selectedCity.getLatitude(), selectedCity.getLongitude()), new WeatherObserver(getMvpView())); } else { getMvpView().showEmptyView(); } } WeatherObserver: public class WeatherObserver extends BaseViewSubscriber<DayMvpView, WeatherResponseModel> { public WeatherObserver(DayMvpView view) { super(view); } @Override public void onNext(WeatherResponseModel weatherResponseModel) { super.onNext(weatherResponseModel); if (weatherResponseModel.getData().isEmpty()) { getMvpView().showEmptyView(); } else { getMvpView().showWeather(weatherResponseModel.getData()); } } } BaseViewSubscriber (Default DisposableObserver base class to be used whenever we want default error handling): public class BaseViewSubscriber<V extends BaseMvpView, T> extends DisposableObserver<T> { private ErrorHandlerHelper errorHandlerHelper; private V view; public BaseViewSubscriber(V view) { this.view = view; errorHandlerHelper = WeatherApplication.getApplicationComponent().errorHelper(); } public V getView() { return view; } public boolean shouldShowError() { return true; } protected boolean shouldShowLoading() { return true; } @Override public void onStart() { if (!AppUtils.isNetworkAvailable(WeatherApplication.getApplicationComponent().context())) { onError(new InternetConnectionException()); return; } if (shouldShowLoading()) { view.showLoading(); } super.onStart(); } @Override public void onError(Throwable e) { if (view == null) { return; } if (shouldShowLoading()) { view.hideLoading(); } if (shouldShowError()) { view.onError(errorHandlerHelper.getProperErrorMessage(e)); } } @Override public void onComplete() { if (view == null) { return; } if (shouldShowLoading()) { view.hideLoading(); } } @Override public void onNext(T t) { if (view == null) { return; } } } CompositeDisposableHelper (CompositeDisposable helper class): public class CompositeDisposableHelper { public CompositeDisposable disposables; public TestScheduler testScheduler; @Inject public CompositeDisposableHelper(CompositeDisposable disposables) { this.disposables = disposables; testScheduler = new TestScheduler(); } public <T> void execute(Observable<T> observable, DisposableObserver<T> observer) { addDisposable(observable.subscribeOn(testScheduler) .observeOn(testScheduler) .subscribeWith(observer)); } public void dispose() { if (!disposables.isDisposed()) { disposables.dispose(); } } public TestScheduler getTestScheduler() { return testScheduler; } public void addDisposable(Disposable disposable) { disposables.add(disposable); } } My test: @Test public void loadSuccessfully() { WeatherResponseModel responseModel = new WeatherResponseModel(); List<WeatherModel> list = new ArrayList<>(); list.add(new WeatherModel()); responseModel.setData(list); CityDetailsModel cityDetailsModel = new CityDetailsModel(); cityDetailsModel.setLongitude(""); cityDetailsModel.setLatitude(""); when(dbHelper.getSelectedCityModel()).thenReturn(cityDetailsModel); when(apiHelper.weatherApiRequest(anyString(), anyString())).thenReturn( Observable.just(responseModel)); dayPresenter.loadWeather(); compositeDisposableHelper.getTestScheduler().triggerActions(); verify(dayMvpView).showWeather(list); verify(dayMvpView, never()).showEmptyView(); verify(dayMvpView, never()).onError(anyString()); } When I try to run the test, I get NullPointer, because new WeatherObserver(getMvpView()) is called, and in the BaseViewSubscriber errorHandlerHelper is null because getApplicationCopomnent is null. As well NullPointer is thrown in the static method AppUtils.isNetworkAvailable() for the same reason. When I try to comment these lines, the test is OK. My questions are: Should I use Dagger for the Unit test as well or? If yes please give me example for my test. Should I use PowerMockito for the static method AppUtils.isNetworkAvailable()? If yes, is it ok just because of this method to use PowerMockito Runner @RunWith(PowerMockRunner.class)?
25c2af661bcbe13e98e7384712aed04f84156e9919ca15048c33e653ecccd117
['b2bf336c4df44bd79fbccee75fa9f2a0']
I follow the example of https://ci.apache.org/projects/flink/flink-docs-release-1.0/apis/batch/libs/ml/multiple_linear_regression.html but in the example the fit function only need one param,but in my code , fit require three params, mlr.fit(training, fitParameters, fitOperation); I thought fitParameters may be a alternative for setIterations(),setStepsize() but what is fitOperation?
dd6ddb796bd8c2b628fc88f1b8c5da824bed1e6450749e9cc5b27fa82459e4c9
['b2bf336c4df44bd79fbccee75fa9f2a0']
I am using jmx to monitoring kafka topic. val url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://broker1:9393/jmxrmi"); val jmxc = JMXConnectorFactory.connect(url, null); val mbsc = jmxc.getMBeanServerConnection(); val messageCountObj = new ObjectName("kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,topic=mytopic"); val messagesInPerSec = mbsc.getAttribute(messageCountObj,"MeanRate") using this code I can get the MeanRate of "mytopic" on broker1. but I have 10 brokers,how can I get the "mytopic"'s MeanRate from all my brokers? I have try "service:jmx:rmi:///jndi/rmi://broker1:9393,broker2:9393,broker3:9393/jmxrmi" got an error :(
45450bd3d133f0df0af487fbc233349b91bc3ae22c15fd3aa6d30269f33f713f
['b2c1699e3e674c2c97a8d2e4c3ad2b1d']
I have a USB stick which has no drive letter assigned because its only partition is encrypted with VeraCrypt. Before removing the stick from my computer physically, of course I first dismount the volume in VeraCrypt. Now since the device has no drive letter assigned, there is no entry for it in the removable media list that pops up when clicking the corresponding tray icon. However, you can select "Open Devices and Printers", select the device there and remove it. I have two questions: Do I need to remove it this way after having dismounted it in VeraCrypt? I need to make as certain as possible that this device does not have incomplete data written to it or becomes otherwise corrupted. Therefore, so far I have always removed it via "Devices and Printers" before actually pulling it out of the slot. To remove the stick via "Devices and Printers", administrative privileges are required. Is there a way around this other than giving the device a drive letter? I would like to be able to do this without elevation, but I also do not want to give the drive a letter because Windows becomes eerily keen on formatting any drive that doesn't look familiar.
8952ff8f1f198fa4d5b90c96a2f116c7bbf4a109932687298744e0b7f6a3dd1f
['b2c1699e3e674c2c97a8d2e4c3ad2b1d']
I'm not sure how much similarity there in the errors but I get the error below using hurdle(). Error in solve.default(as.matrix(fit_zero$hessian)) : <PERSON> routine dgesv: system is exactly singular: U[1,1] = 0 In my case, the error happens only when I specify the weights=weight_var. Using a normalized weight (weights= weight_var/mean(weight_var)) solved my problem.
4eff160d12b7bfd4eb085627d58598bf92d557ade3713993b84c93942c1661c2
['b2d3308087d8462a88cbed190371bd25']
In my winforms project,for a particular form i have nearly 10 controls for firstname,lastname,age,Occupation etc..(including textbox,dropdown list) and a SAVE button I have created class representing data source for these controls and implemented validation method in the same class which takes of validation for each property and throws validation message. Problem is raises when i want to set focus on a control which throws validation error in UI. How i can implement this.Passing a control back to class is bad practice. Do i need to change the way i have implement validation at class level? Any suggestion/links?
aa63fb0ca436523f6c3901a5c363062b640c1cd8357ad6b8afe1cf32a8df98f0
['b2d3308087d8462a88cbed190371bd25']
I have sequential steps needs to be executed..lets say: step1--once it is done--execute step2 step2--once it is done--execute step3 step3--once it is done--execute step4 step4--once it is done--execute step5 step5 These steps need to be executed without UI blocking(calling async).. Need your suggestion how this can be done using TPL-task parallel library
cf7c71cb12f59e2158e2196e3b2ab32a22f60a73b14c1ddc38f38f8ed674cccd
['b2dd4c22dbea4033887294fae40cf8a7']
I got the following XML content <root> <node1>Hi from node 1</node1> text not encapsulated in node <node2>Hi from node 2</node2> <node3>content....<node3/> </root> The question is : how to get all content before node3, even those not encapsulated in a node using XPath version 1.0 or 2.0 ?
e8ab38088fbd61e93e9ba26775d6dc78aea44c79802fce0f1cd5eea7d5809769
['b2dd4c22dbea4033887294fae40cf8a7']
I am trying to transform a table to a csv file then download it, but I faced an issue while using Blob to download the csv document. The code snippet I am using to download the csv file is: var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); The issue is that the csv file is not downloading with the name I am assigning to the file. It uses a randomly generated name and with no extension. example of the file name after being downloaded: 43af43ac-7491-44ed-a779-a6c8f1972b1a. I was able to fix this by removing the append() remove() functions. Consequently, I have two questions: 1- Why the issue is happening, and what is the best solution? 2- Why to append elem to the body of the HTML? And why the code worked after removing it?
652c015370bbb63c05a6ae0c79ae5d3a5d57d303cf4d81e82f9c887431bb7f9f
['b2f139ea15f74337a0dfa454b861a56a']
Though an older post I though I'd glue my own answer to this question as I bumped into the same challenge earlier this year. I wrote a library for the handling of PEM keys, encryption, decryption, signing and signature verification. There's an complete example solution attached to it (Load-Encrypt-Decrypt-Save), so you should be able to be up running in no-time. https://github.com/jrnker/CSharp-easy-RSA-PEM Cheers, <PERSON>
b06840afc33cdb9dcfd8c1f2b44acc4cbf91740d06e7e0579ad0a3b753861164
['b2f139ea15f74337a0dfa454b861a56a']
Old post, but maybe it will help someone anyway ;) In my case I got this every time I examined the first variable while debugging. Annoying as hell as I due to the nature of the work restart the debugger often. This was cause by that the location where my Visual Studio 2017 files were saved, was a cloud drive and it actually had to sync the files before showing the data. The solution was to mark that whole folder "Always keep on this device". Cheers,
774f9be9594d3dc6756cd5f2ac2c6a4fe1c2a30926a523ddf6451b0dd21c3d74
['b2f4f48a523e4dcf93eeba899290de23']
I started a new job in a company that loves using the word, "enterprise." As such, everything they've written is in Java. I come from a very web-development heavy background, mainly working with LAMP stacks. Now, up until three days ago I knew nothing about Java other than people used it and that it is a programming language. Googling up on it, the Java language itself seems simple enough. However, when people say, "Java" it seems they are referring to more than just the language, such as the various frameworks and application servers. It's a little over-the-top, and am having some trouble getting up to speed with "Java." An upcoming project involves me creating an exposed REST API for one of the products. Seems easy enough. However, I have some questions about how to proceed.... I'm working with JBoss AS for the first time; not sure if there's an equivalent in PHP so I can understand what JBoss does exactly, but I suspect there's a "proper" way of doing things. Here's what I was thinking of doing: 1) Created a package with a single servlet, like so: package com.awesome.myrestapi; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HiggiltyServlet extends HttpServlet { private static final long serialVersionUID = 1L; public HiggiltyServlet() { super(); } public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); // @todo ideally, do something more RESTfully useful and less vindictive out.println( "<html><body>HAHA! all ur api requests are belong to us</body></html>" ); out.close(); } } 2) As you can see, I was thinking of just overriding the service method to serve my REST API requests. 3) Updated my web.xml file accordingly, so that the url-pattern would match "higgilty", thus making my URL endpoint something like.... http://localhost/awesomeproject/higgilty Now, I feel like I might be doing something wrong. Am I going about this the right way, or am I totally off the mark? Any help is greatly appreciated.
9f8fa309fd6e2f64b0af4e0c1eba701b34023cbf91aa1c7ec8c06925fcf20673
['b2f4f48a523e4dcf93eeba899290de23']
Добрый день. Подскажите как можно прочитать файл (любой. текстовый, картинку, исполняемый и т.п.) и записать прочитанное в переменную. а затем, записать из этой переменной обратно в файл, что бы получился исходных рабочий файл. я приблизительно понимаю что нужно выполнить двоичное чтение файла, но вот как именно сохранить прочитанное в переменную, что бы потом из нее можно было восстановить исходный файл - не понимаю. data = open('file.exe', 'rb').read() storage = str(data) так я, к примеру, получаю текстовое представление прочитанных байт. Но не понимаю как правильно их записать в другой файл что бы в итоге получился исходный файл. мне не обязательно хранить прочитанное в текстовом виде, можно и в массиве и как угодно. чем компактнее будет запись, тем лучше. копировать файл не предлагать =) мне нужно как бы "зашить" файл в скрипт, что бы при необходимости можно было из питоновского скрипта восстановить файл.
6d476640a5604147bc7e76a6b4fd221437fb1da55c09d2a1cb03d92fc4a27a56
['b2f576fd04e1490088794eef2954ee18']
ok. I'm a complete beginner. Do I put the zener diode and the small transistor in series, both in the receiver, and that will let me: keep my range without dimming the LED, and prevent LED blow-out from the LED getting too close to the transmitter coil? (again, I'm a complete beginner (so please treat me like I'm stupid, it will be helpful, not insulting) and this is my first real project)
6d96ab92ee64573a47e3cf803c0034a47e88fb02c0d0ddfca188f6261802b590
['b2f576fd04e1490088794eef2954ee18']
I had the same issue with my 2006 MacBook 1181a after I upgraded the router in my apartment and installed an extender. I tried everything to no avail. Then I went into to admin page of my network and changed my password and it is working just fine now! Hopefully it will stay that way. I had only numbers as my passcode before, now i have numbers and letters. Maybe that had something to do with it? Good luck and I hope this helps!!
2ff7d0ee7f008f2004c8ad9847394dd585d6fc95515b0620c4c10c7a85127186
['b30a30c614204bb89d6b10c3b6109470']
I would like to darken the background image of a div with filter:brightness. It works well but obviously it darkens the whole div, not only the image. How can i do to darken only the background image with CSS ? I would like to have some white text on it. Here is my code : #about_header { background: url(../img/background/spa_02.jpg) no-repeat center center fixed; filter: brightness(20%); -webkit-filter: brightness(20%); -moz-filter: brightness(20%); -o-filter: brightness(20%); -ms-filter: brightness(20%); height:400px; display: table; position: relative; width: 100%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } #about_header h1{ color: white; } <section id="about_header"> <div class="container text-vcenter"> <div class="row"> <div class="col-sm-12"> <div> <h1>Contact us</h1> </div> </div> </div> </div> </section>
560be2d64de2cfc9ac4bb1888b16e9bba71953281b7c9d96e34efc20822972d6
['b30a30c614204bb89d6b10c3b6109470']
I would like to append a hero image into an HTML section. But the problem is this image doesn't take the whole page as intended when it is wrapped into a section. For exemple <div id="home"> <div class="text-vcenter"> <h1>Reunion Qualité</h1> <h2>Meeting Manager</h2> <svg height="10" width="605"> <line x1="0" y1="0" x2="611" y2="0" style="stroke:rgb(255,255,255);stroke-width:3" /> </svg> <h3>Namur-Belgium</h3> </div> </div> Will work, but <div> <div id="home"> <div class="text-vcenter"> <h1>Reunion Qualité</h1> <h2>Meeting Manager</h2> <svg height="10" width="605"> <line x1="0" y1="0" x2="611" y2="0" style="stroke:rgb(255,255,255);stroke-width:3" /> </svg> <h3>Namur-Belgium</h3> </div> </div> </div> Won't. Why ? How can i fix this ? Here is the CSS linked regarding the Hero image : html, body { height: 100%; width: 100%; font-family: 'Quicksand', sans-serif; } #home { background: url(../img/qualite_01.jpg) no-repeat center center fixed; color: #f6f8f8; display: table; height: 100%; position: relative; width: 100%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
0d0fd343a5fdae1d01c6e4b82bdffc7bcb187d7d73e30f4d8f02630edfb7cb02
['b3279f96f77d49f6a05747d3de9327b7']
I got it working. As mentioned above, underscore was causing the problem. It was quite silly on my part that I did not check that. In C# code aid was declared as long. Since string with underscore cannot be deserialized to long I was getting exception. I copied the xml response from Facebook into a xml file then did xsd Facebook.xml and xsd Facebook.xsd to get Facebook.cs. I compared generated cs file with the one I have and saw that aid was declared as String in generated cs and long in my file.
356052c42e5e591bdc919a8ab1e619e75e637fa15fb3d8af3bc14df661152f41
['b3279f96f77d49f6a05747d3de9327b7']
I am trying to write a facebook app using Facebook C# sdk 5.1.1. The app should let the users to upload a picture to a Facebook page. I was able to write the app where only the admins of the page are able to upload the picture but not users. Even if the user has liked that page I am not able to do it. I know its possible because on iPhone or from web site you can visit a page and write something on wall or share a photo. But I am not able to figure out how to do it using Facebook API.
de4cb7dfd932e43baed89e1e3b50ea4215b46d3844ed71ab6f6bc40bbe6c6833
['b330a18d46534ece9b63a80d75b94177']
After doing rs.initialize() on two repica instances (aws ubuntu 16.04) and mongo 4.0.1 I get the following SegFault which I assume happens during replicaset recovery. Is it a mongo 4.0 known issue? Thank you in advance Stack trace is as follows : W NETWORK [LogicalSessionCacheReap] Unable to reach primary for set rs0 F - [rsSync-0] Invalid access at address: 0x18 F - [rsSync-0] Got signal: 11 (Segmentation fault). NETWORK [LogicalSessionCacheReap] Unable to reach primary for set rs0 F - [rsSync-0] Invalid access at address: 0x18 F - [rsSync-0] Got signal: 11 (Segmentation fault). mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x55cc778e0051] mongod(+0x237D269) [0x55cc778df269] mongod(+0x237D8D6) [0x55cc778df8d6] libpthread.so.0(+0x11390) [0x7f3e2d4b6390] libpthread.so.0(pthread_mutex_lock+0x4) [0x7f3e2d4aed44] mongod(_ZN5mongo17FreeMonController8_enqueueESt10shared_ptrINS_14FreeMonMessageEE+0x40) [0x55cc763cb6b0] mongod(_ZN5mongo17FreeMonController27notifyOnTransitionToPrimaryEv+0x8A) [0x55cc763cb98a] mongod(_ZN5mongo4repl39ReplicationCoordinatorExternalStateImpl34_shardingOnTransitionToPrimaryHookEPNS_16OperationContextE+0x2C6) [0x55cc76219a36] mongod(_ZN5mongo4repl39ReplicationCoordinatorExternalStateImpl21onTransitionToPrimaryEPNS_16OperationContextEb+0xF3) [0x55cc7621c1d3] mongod(_ZN5mongo4repl26ReplicationCoordinatorImpl19signalDrainCompleteEPNS_16OperationContextEx+0x1D9) [0x55cc7625e9d9] mongod(_ZN5mongo4repl8SyncTail17_oplogApplicationEPNS0_11OplogBufferEPNS0_22ReplicationCoordinatorEPNS1_14OpQueueBatcherE+0xC48) [0x55cc76306738] mongod(_ZN5mongo4repl8SyncTail16oplogApplicationEPNS0_11OplogBufferEPNS0_22ReplicationCoordinatorE+0x189) [0x55cc76307209] mongod(+0xD95756) [0x55cc762f7756] mongod(_ZN5mongo8executor22ThreadPoolTaskExecutor11runCallbackESt10shared_ptrINS1_13CallbackStateEE+0x1B3) [0x55cc77163b43] mongod(+0x1C0222B) [0x55cc7716422b] mongod(_ZN5mongo10ThreadPool10_doOneTaskEPSt11unique_lockISt5mutexE+0x14C) [0x55cc770d649c] mongod(_ZN5mongo10ThreadPool13_consumeTasksEv+0xBC) [0x55cc770d699c] mongod(_ZN5mongo10ThreadPool17_workerThreadBodyEPS0_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x96) [0x55cc770d7386] mongod(+0x248D600) [0x55cc779ef600] libpthread.so.0(+0x76BA) [0x7f3e2d4ac6ba] libc.so.6(clone+0x6D) [0x7f3e2d1e241d]
14ce4fa1c1450302a24802ef3b804fa6579453b2da32e54bbcd3df90c9a3b281
['b330a18d46534ece9b63a80d75b94177']
After posting on the Highstock forum and consequently having an issue posted on github, I found that it was because of the default value of the gapSize option. According to the docs; gapSize : Number Defines when to display a gap in the graph. A gap size of 5 means that if the distance between two points is greater than five times that of the two closest points, the graph will be broken. In practice, this option is most often used to visualize gaps in time series. In a stock chart, intraday data is available for daytime hours, while gaps will appear in nights and weekends. Defaults to 5. Setting gapSize to null fixes the problem.
c3391df8a9041d3c99d99a66a0460c2a586637068e6976aeb9f87e9d0cd45480
['b33c081776814bac9d037cbff3fe4be3']
Well, 15 million rows isn't incredibly large by today's standards. I'm pretty sure your main concern should be hardware. Get your hands on as much disk performance (SSD's) and RAM as you can. Another problem that you'll probably have to deal with is the sheer number of queries you can handle at a given time. It's likely that you'll have to move to a master/slave config so that READ queries can run against the slaves while the WRITE queries run against the master. For any more specific answers, you're going to have to provide a lot more detail.
af9613d55ce0e347b61011c4ae03ea14875fffa6254acdf846d012d42a4550de
['b33c081776814bac9d037cbff3fe4be3']
4k phones are still new in the market, but I suppose it's only a matter of time the tech becomes more widespread. Should I be concerned when it comes to designing responsive websites? Is there any other unit of measure that I should use that's not px to avoid issues in the future or are my worries unfounded?
d02d5aefece7965216f65742f48aef06f9c333374d353d86c70b39ccb5f6a1c2
['b356ca048c75495ab3ff9f9878b91539']
I'm using EF6 with Visual Studio 2015, database-first. I would like to add a navigation property to the complex type generated for a table-valued UDF, using the (int) value of one of its columns. After a couple of hours tearing my hair out over this, I'm starting to believe that this is either simply not possible, or the way to do it is so convoluted it's not worth the hassle. Is it supported at all?
568f464263e58260fd69b1a03f44c8a2e518b1d0a42f4d1057918ba2a808f499
['b356ca048c75495ab3ff9f9878b91539']
I'll post the answer instead of deleting it in case it can help someone else. Or maybe someone will post an improvement or correction. This expression causes EF to retrieve the data using a single SQL statement. var userRoles = cx.Users.SelectMany(u => u.Roles.Select(r => new { userID = u.UserID, roleID = r.RoleID })). ToLookup(o => o.userID, o => o.roleID); You have to use an anonymous type and not KeyValuePair<string, string> here, because LINQ projection won't understand that. And for reference, how to push EF's SQL into your unit tests' output to eyeball it - public YourDatabaseNameEntities() : base("name=YourDatabaseEntities") { #if TRACE this.Database.Log = s => System.Diagnostics.Trace.WriteLine(s); #endif } which can be persistantly included in your generated code via the associated .tt file.
de71b1f4c847f4775d5112e709563ac8a55eaeedd3852cd8445e585c93d54f49
['b3610f088111419287cdc809108a44c6']
Im new to command line stuff and I was trying to install Homebrew in order to install gstreamer on my Mac. I was following instructions and got to the point where brew doctor gave me a list of errors about the things in /usr/local. After reading that OS X doesnt use that directory I rm -rf the directories in local. Since then brew doctor returns command not found and if I try to reinstall Brew the terminal just hangs. $ /usr/bin/ruby -e "$(/usr/bin/curl -fksSL http://ow.ly/aAiPj" > IS there anyway to fix this?
d386fac20adb509aa5f9cf4f6afe7e45687f4d19ed668a67fa9b1efc77079b07
['b3610f088111419287cdc809108a44c6']
В таком случае сразу выполняется main() И бот в итоге не работает. while True в конце кода заставляет бота переприсоединяться к longpoll. Если этого не прописать и бот не будет никому писать в течении ~25 секунд, вся консоль IDLE будет в ошибке через ~25 секунд, что удалённый хост разорвал соединение.
a25200ebd46708bf7dacd346e4ff5ac1650a15b352cf03f58f7f0cfad202bd4d
['b377e050468d4c5e93c6e779207aae16']
<PERSON> **if** is a big word. Using $n! = n(n-1)!$ leaves one chasing ones tail: to understand $0!$, I need to understand $(-1)!$. If we use $n! = (n+1)!/n$ then we can make sense of this through permutations: if we know how many ways there are to arrange 5 people then we can find how many ways to arrange 4 people by deleting a person: $4! = 5!/5$.
74dc250e32ce7bd4845df85a426fff06a3c9951532963793d13d33c2912f6402
['b377e050468d4c5e93c6e779207aae16']
also, the average damage of a 5-th level lightning bolt dealing 10d6 damage is 10*3.5 = 35, not 30. You can't just halve the maximum result, since that doesn't take into account that you cannot possibly roll less than 10 damage - since all of the 10 dice you're rolling will grant at least 1 damage each.
7616fca0ffec55730f89540d92035c3e985855bfe1d5d195b26764070a8c823f
['b378571b900e4da5b6232ff78d52a292']
Absolutely A phylactery need only be any item possessing an interior space into which arcane sigils of naming, binding, immortality, and dark magic are scribed in silver. People have interior space. In their skulls, in their stomachs, in their bones, really all over if you have the right mindset. So the only thing stopping a person from being a phylactery is that phylacteries are made from items. Liches, however, have spells from the wizard list. Including both True Polymorph and Flesh to Stone - both of which can turn creatures into objects (items) for an indefinite period of time. So it's absolutely possible. But as a discerning Lich, I have some more requirements to make it feasible. A phyl-lackey has several benefits over the traditional version - it can follow you like an underling, it can actually defend itself, and it can even flee a dangerous situation. However, it can also wander off and get lost, captured, or killed. Now the obvious solution to this is to find someone who's got a perpetual death wish. Like <PERSON>! They love dying. And even better, it's totally free to bring them back - via Clone or even True Resurrection if you take the time to go... convince... a Cleric to help out. You just have to tangle up your phylactery magic with their soul to make sure both come back to you. Just imagine the look on your enemies faces. They've got your phylactery, they kill the guy, they research up some ancient magic to dispel your soulbinding, and whoosh! Off flies the soul of the recently departed back to you, phylactery safe and sound in his new body. Boy it's gotta suck to be mortal.
8de276dee1a97964465f87604c8301efde4d832ae761632bd3b2c1474158c8b6
['b378571b900e4da5b6232ff78d52a292']
Over an algebraically closed field, the answer is yes. I assume that by "linear group" you mean a smooth affine algebraic group scheme. Such a group has a filtration whose quotients (modulo finite group schemes) are successively a unipotent group, a torus, and a semisimple group, so it is only a question of checking each of these cases.
c4c2d295fbba50a171159cb2df7d2080afabfe666dfdb00c92103ac19ed43c0f
['b3799995bff6442fb588d3876b5d388f']
Even if an overflow occurs in the register windows that are backed up in RAM, surely Sun thought of a way to protect those from being written by user processes... Also as for Java, everyone knows it is very vulnerable to attack. It just may be designed for safety, but it was implemented very poorly. JIT compilation should not be relied on--- you're executing data after all.
41d14d4c298a9ed27deaa2756a12a4c1262c32aacd25d5bcf81ce10617f1d992
['b3799995bff6442fb588d3876b5d388f']
The idea with omitting .php is that if attackers don't know what language you're using, they can't as easily assess what vulnerabilities exist that are language specific e.g. it may turn out that a function commonly used in PHP is buggy in version x.y.z and the creepy guys at Hacking Team know this.
8a33736adc0d49270a0eaf562524b3afb7c02148a4d14c28b0675224462025a9
['b38a54c1825a4637a978eb62e007a0ed']
I am using a plugin named anchorific.js to create named anchors and corresponding menu on the fly from h3 tags. To get it working in a .net page I had to move the div containing the menu so it was the last item on the page. Now I want to move the div elsewhere, but running .append() after the anchorific code won't work. What can I do to move this element?
cc227d807b63097e168e630962ae749e579b0cbd6715a41571b9bad95f39b5a8
['b38a54c1825a4637a978eb62e007a0ed']
I want to hide an HTML element when the page loads, then fade it in with a CSS transition. My plan is to set the opacity to 0, and then use a CSS animation to transform it to 1. But I am worried that the content will remain hidden in old browsers that can't handle CSS transitions. Is there a safer way to hide the content? Or to exclude this code from browsers that can't handle it?
ac05724ecbf7b9842dafe42d019705048412e8346131c089eac270e84045b8e6
['b38f6b24073c4d3db59f301a5455d7fe']
For everyone who is reading this in the Future... I've found the problem and solved the issue. But first things first, what did I do? I double checked pihole running and working by asking for the DNS IP of Google nslookup google.com <IP_ADDRESS> Which gave me the Output Server: <IP_ADDRESS> Address: <IP_ADDRESS>#53 Non-authoritative answer: Name: google.de Address: <IP_ADDRESS> And here I saw my DNS Address <IP_ADDRESS>#53 and especially noticed the Port 53 which is clearly the Standard DNS Port So I asked myself if this Port is allowed in my ufw (firewall) and ran following command sudo ufw status verbose Which gave me the Output To Action From -- ------ ---- 51820/udp ALLOW IN Anywhere 22 ALLOW IN Anywhere 51820/udp (v6) ALLOW IN Anywhere (v6) 22 (v6) ALLOW IN Anywhere (v6) Anywhere on eth0 ALLOW FWD <IP_ADDRESS>/24 on wg0 And here I finally saw, that the Port 53 wasn't allowed to be reachable from the outside inside of the network ... lol ... So I fired up the command sudo ufw allow 53 and after that my WireGuard PiHole DNS started working :) I hope this was helpfull for anyone addressing the same issue. ~Cheers
047de31a38e974afcb87bb9b972519aac553d7a89a988d5a3cd3a1ec82d969b9
['b38f6b24073c4d3db59f301a5455d7fe']
As <PERSON> already said, you missed a return in line 8, so that you correct code should look like this: def reverse(my_list, index=0): if index == len(my_list) // 2: # The program will return the list as soon as it reaches the middle entry return my_list elif index < len(my_list) / 2: temp = my_list[index] my_list[index] = my_list[(len(my_list) - 1) - index] my_list[(len(my_list) - 1) - index] = temp return reverse(my_list, index + 1) def main(): myList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] print(str(myList)) print(str(reverse(myList))) if __name__ == '__main__': main()
c978799a0df4ca53e30e3380374ea8314d07a3a8faa86f8335a608bb1c6b7d74
['b397493b3e4542d085c458fc7f76866a']
Replace your scripts values with these, and try again: "scripts": { "ios": "react-native run-ios", "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "test:e2e":"npm run test", "test:e2e:build":"npm run build" // THIS SCRIPT WILL STILL BREAK FOR YOU }, The last two are the important ones! You need to prefix a script command with npm run or yarn if the script references another script in your package.json. So instead of a script calling navicotrackapp test it would call npm run test OR yarn test. NOTE: In you example it looks like the terminal is failing on the script navicotrackapp build. Know that you do not have a build script defined so if you replace the script with npm run build it will still fail. You'll need to add a build script in if you want it to work! "scripts": { "ios": "react-native run-ios", "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", "build": // DO SOMETHING HERE!!!!, "test:e2e":"npm run test", "test:e2e:build":"npm run build" },
e9d63c1e0c5c644041f8537900987da33b704d6282034b0208df69442807817a
['b397493b3e4542d085c458fc7f76866a']
You might think about just having multiple configuration files for eslint instead of trying to handle environment changes in a single file. According to the docs: https://eslint.org/docs/user-guide/command-line-interface#basic-configuration You can just call eslint with the -c or --config flags and pass in the extra config file. This will merge a base config file with the file passed in the flag An example for two lint scripts: eslint --config ./dev-config.js **/*.js eslint --config ./prod-config.js **/*.js
4c4fbbcf96f42c4997ea192bb27a64ef77ad8c3572b7660b790c80112b8280a5
['b397db771e5a48e1b2d94e92d17e10b6']
Is azure blob object replication creating blob storage events? The use case is to replicate blobs between azure regions/subscriptions. When the blob arrives at the target storage account, Snowpipe should be notify via event grid and storage queue (as in here). After setting object replication, event grid and queue, I can see files arriving, but no event seems to be generated. Only if I manually delete a blob or create one, events are pushed to queue. My first guess is that object replication is not creating event, but maybe there is another issue with this setup?
4509da00de2ab3540587b55c342a20bdb36204a475ef2d5f849b2f24e853ff07
['b397db771e5a48e1b2d94e92d17e10b6']
When enabling sql server vulnerabilityAssessments feature using arm template, following error is thrown when storage account has a firewall on. "error": { "code": "InvalidStorageAccountCredentials", "message": "The provided storage account shared access signature or account storage key is not valid." } } Template part: { "type": "Microsoft.Sql/servers/securityAlertPolicies", "apiVersion": "2017-03-01-preview", "name": "[concat(variables('sqls01Name'), '/Default')]", "dependsOn": [ ], "properties": { "state": "Enabled", "emailAddresses": "[variables('emailActionGroupAddresses')]", "emailAccountAdmins": false } }, { "type": "Microsoft.Sql/servers/vulnerabilityAssessments", "apiVersion": "2018-06-01-preview", "location": "westeurope", "name": "[concat(variables('sqls01Name'), '/Default')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', variables('defenderSa'))]" ], "properties": { "storageContainerPath": "[concat('https://',variables('defenderSa'),'.blob.core.windows.net/vulnerability-assessment/')]", "storageAccountAccessKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('defenderSa')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]", "recurringScans": { "isEnabled": true, "emailSubscriptionAdmins": false, "emails": "[variables('emailActionGroupAddresses')]" } } }, { "name": "[variables('defenderSA')]", "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2019-06-01", "location": "westeurope", "properties": { "accessTier": "Cool", "allowBlobPublicAccess": false, "supportsHttpsTrafficOnly": true, "networkAcls": { "bypass": "AzureServices", "virtualNetworkRules": [{ "id": "[variables('subnetId')]", "action": "Allow" }], "ipRules": [ ], "defaultAction": "Deny" } }, "dependsOn": [ ], "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "StorageV2", "tags": { } } I notices that when enabling the feature from portal following communicate is displayed: You have selected a storage that is behind a firewall or in a virtual network. Please be aware that using this storage will create a managed identity for the server and it will be granted 'storage blob data contributor' role on the selected storage. The assignment is indeed created and the assessment works, however when I try to replicate this in arm template with following code it still fails. { "type": "Microsoft.Storage/storageAccounts/providers/roleAssignments", "name": "[concat(variables('defenderSA'),'/Microsoft.Authorization/',guid(variables('sqls01Name')))]", "apiVersion": "2018-09-01-preview", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts',variables('defenderSA'))]" ], "properties": { "roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", "principalId": "[reference(resourceId('Microsoft.Sql/servers',variables('sqls01Name')),providers('Microsoft.Sql', 'servers').apiVersions[0],'Full').identity.principalId]" } }
eae85d11b2919b26662aae9cbb3716b3896192f307687aab8ede6bce9e8e4abb
['b3995c1643084c6f9af5e535b9996265']
From my limited understanding,my best chance right now would be to request an ITIN either as "Nonresident alien required to get an ITIN to claim tax treaty benefit" or "Nonresident alien filing a U.S. federal tax return". My Italian brain suggests that the first could be meant as "I would be eligible to claim tax treaty benefit if I had a US-based income", but that is probably wrong... I guess I could find some freelance work with someone in the US (I'm a programmer) and request an ITIN in relation to that income, but it seems not worth it if I'm moving in 8 months or so.
0940f68998f8d03cf5aa4bcfffbd2cb4c98cfffdf7cff6c21e6092956ba106fc
['b3995c1643084c6f9af5e535b9996265']
I've edited to decrease the content of things that I already have to make my confusion more clear. Showing this by <PERSON> is "not allowed" which is why I'm confused on this. So, considering 1 to n, is it now more of a uniform distribution and I can continue with the mean and variance from that distribution? All I know of MLE is that I "think" that the uniform distribution would be suitable. I am certainly clueless on how considering the ranks for time periods would change this.
b2b6882092cbf81daa947c3d04e2fcd7e1c2aa67a681fb5fca1ac434ae42f0ea
['b3a68c81fd8f4fd080d919d06d6390db']
Tried to do this in one line for ages; as <PERSON> said, you need to use double quotes to specify the filter so that it substitutes the string; I also found you have to use the DateTime ToFileTime method to make sure the DateTime object is sent as an LDAP FileTime tick time format that Get-ADComputer -Filter needs: Get-ADComputer -Filter "enabled -eq 'true' -and lastLogonTimestamp -gt '$((Get-Date).AddDays(-90).ToFileTime())'" -Properties LastLogonTimeStamp -SearchBase "CN=Computers,DC=some,DC=domain,DC=com" Enjoy!
2284ec13882550bb35f392c84223554550dd231e17230b00f0d7ee2c5b2871ca
['b3a68c81fd8f4fd080d919d06d6390db']
Might want to use the following key instead: HKEY_CURRENT_USER\Software\SyncEngines\Providers\OneDrive This includes the following registry values: UrlNamespace: (SharePoint site URL) MountPoint: (local driver location) It does appear to include old values which are no longer synced - but it shouldn't be too hard to check against HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts\Business1\ScopeIdToMountPointPathCache or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager for paths that are being actively synced.
92e1cedc8809e993a1592b791c8739ea725e3b71e2c5c417cfd3d68cd4b2cd4f
['b3a8bd08004e4d258109655762b31dba']
I'm continue to learn retrofit and want to handle the response from server. Structure of response from Postman { "succeeded": false, "errors": [ { "code":"DuplicateUserName", "description":"User name 'XXX' is already taken." }, { "code": "PasswordTooShort", "description": "Passwords must be at least 6 characters." }, { "code": "PasswordRequiresLower", "description": "Passwords must have at least one lowercase ('a'-'z')." }, { "code": "PasswordRequiresUpper", "description": "Passwords must have at least one uppercase ('A'-'Z')." } ] } code of POST Call<RegisterResponseModel> register(@Body UserJSONModel user); RegisterResponseModel private String succeeded; private ArrayList<String> errors; I tried to use List, ArrayList and just String and evenn serialize: @SerializedName("errors") @Expose But regardless of the attempts I receive something what should be success=false and error list ‹ í˝`I–%&/mĘ{JőJ×ŕtˇ€`$Ř�@ěÁ�Íć’ěiG#)«*�ĘeVe]f@Ě흼÷Ţ{ď˝÷Ţ{ď˝÷ş;ťN'÷ß˙?\fdlöÎJÚÉž!€ŞČ?~|?"~ńGÍz:ÍóY>űčŃyV6ů裼®«şůčŃ÷~ńGÓj–ô裧ëUYLł6˙ŞÉëŮ"˙hôŃ,o¦u±j‹jI-đEş¤oŇŹ_eçă´hҬ¬ólvť¶ŮŰ|9ţč—|˙—
81a77af29a94c90424dc31c0230e123967be75df1b40510fafc78d07b913a157
['b3a8bd08004e4d258109655762b31dba']
On my android app I have location points (latitude and longitude) with some info connected to them (but itsn't important here). I want to get centroids coordinate for that dataset with a conditions that distance between centroid and all points in cluster are less than 500m (1000m diameter). The size of each cluster is irrevelant but i do not know how to estimate number of clusters and what library use for that task. I found several answears here but mostly based on R, python or GoogleAPI but my app assume no internet connection that's why i use shortest distance not based on any maps.
20b04ce8e615ea4136585e62f8e22a8a498eadfc959343cc04cdfd5e71cee440
['b3ac417d47724130a4c5237083828e68']
I'm trying to rework several forms and there are several sections where I have a typical "Was xxxx Required?" Yes/No radio boxes. If they choose YES I want the box below to open up requiring them to enter more info. I'd like to use one JQuery function if I could that would work for each of those rather than a separate function for each question needing it. I also have a question where they choose whether the person involved is an Employee or Guest. Thanks to a lot of good posts here I was able to figure out Hiding the Guest DIV until selected but I haven't figured out yet how to do the same for the Employee DIV, and I just found out I need to add a 3rd set of questions for a Vendor. This is the working code that shows the Guest section $(document).ready(function() { $("div.desc").hide(); $("input[name$='Victim']").click(function() { var test = $(this).val(); $("div.desc").hide(); $("#" + test).show(); }); }); Along with <p> Who was involved in this incident? &nbsp &nbsp <input name="Victim" type="radio" value="Guest" required >Guest &nbsp; &nbsp; <input name="Victim" type="radio" value="Employee" > Employee &nbsp; &nbsp; <div id="Guest" class="desc"> <p> Some questions here ... Can anyone point me along to getting the additional code working? TIA
c6d0e2f6b8645b222161465da8c9ed463153bcd448605966c55a3e60669ed704
['b3ac417d47724130a4c5237083828e68']
I have a form that users will be filling in partially. Once they have made all their selections I want to render the page as is to PDF and then have it sent as email. I just can't seem to wrap my head around the tutorials and examples for it. Currently I have jquery and jspdf referenced in my head section <script type="text/javascript" src="http://code.jquery.com/jquery-3.1.0.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script> And this is my current function script - basically what's outlined in dozens of pages on here and elsewhere <script type="text/javascript"> $(function() { var specialElementHandlers = { '#editor': function (element,renderer) { return true; } }; $('#cmd').click(function () { var doc = new jsPDF(); doc.fromHTML($('#target').html(), 15, 15, { 'width': 170,'elementHandlers': specialElementHandlers }); }); doc.output("dataurlnewwindow"); }); }); </script> Next I start my form and have a DIV containing the entire page that I want rendered <body> <form action="" method="post"> <div id="target"> Followed by all the form inputs, then I close the DIV and have the button that should generate the PDF </div> <p> <button id="cmd">Generate PDF</button> </p> </form> </body> </html> I get nothing. No matter what I've done. The most I've gotten playing around with it is a blank page but no content. Any help steering me in the right direction would be greatly appreciated!
42d1271260408633f8c1bbb5517d47ad90e1d5e0da6e19c3bcb0067a14646649
['b3b68d840db84a1587aff86814f846d0']
I'm downloading a Fairplay HLS video with AVAssetDownloadTask and persisting the decryption key. After the download completes successfully I try to create an urlasset with the local url but after loading the asset into an avplayer it doesn't play. The same video plays when online so the decryption key is retrieved and persisted correctly. What I noticed that the AVAssetResourceLoaderDelegate is not getting called offline so basically the player is not retrieving the decryption key. Anyone have any idea what could be wrong ?
ba94ffa2b80fa812acfee7920a00c4716d7cc58ba5a656fdda59b8c9b3340952
['b3b68d840db84a1587aff86814f846d0']
I have an application in which one of the modules consists of a UIWebView in which articles are shown as HTML pages. The problem is the articles could contain basically any outside link to images, videos other articles (from other providers), even adult content. In short it can contain links to unmoderated content. Is it safe to open these links in the the applications UIWebView or are there some rules on what can be loaded in an applications? Should I just not open those links in the application and just open it with safari?
7952d5cbc4d6e16791288ea8850cceb58f291e81b33e98f35ed21499eba78823
['b3bd7ad565f64f93868715c011c94722']
I am facing issue while launching my selenium script for edge browser. I followed below steps- Pre-Condition- I had Edge Legacy-Version 40 already installed on my system 1. Installed Edge Chromium Version LATEST-83... 2. Ran the automation selenide script on edge browser, it downloaded and used web driver version 83.... 3. Our frameowrk is built like that it downloads the latest webDriver version at run time from github.bonagracia 4. Edge Legacy was replaced by Edge Chromium post installation and I could not access Edge Legacy 5. Due to some manual evaluation on my system, had to use Edge legacy so un-installed Microsoft Edge Chromium, but could not proceed ahead much, because there was some configuration change to be done at system level 6. Now, re-installed Microsoft edge chromium, but post re-installation I can access both Edge Legacy & Edge Chromium separately. 7. The automation scripts is now taking edge legacy-Version 40.... as the browser instead of edge chromium-Version 83.0.. & downloading this version from github.bonagracia. Alternative- Tried to disable the edge legacy in system properties, as cannot uninstall this software, because it is by default installed with Windows 10, but still that does not work. Selenide script is still downloading edge legacy web driver during runtime instead of edge chromium. How can I ensure that my Edge legacy is disabled post installation of edge chromium and automation script uses the web driver manager for edge chromium rather than edge legacy. Please suggest on this.
ded367697753eea57a7d6727211dc8a5e3e45078523327a6dbd0c111e9a345c8
['b3bd7ad565f64f93868715c011c94722']
I have a scenario to Upload Folder in my app, which is currently automated using Robot Class in Selenium. The challenge I am facing is while running the code on Remote system, my code fails coz, multiple other programs are also executing in parallel and Keyboard mouse movement are only performed on active window by Robot class. Need Suggestion to fix this limitation or any other alternative to handle Upload function in selenide which is more robust.
68614d09fb70910c5b7d2b2cde1143eea5ea93334d92c303d77582ad76f1c440
['b3c2937801014457a372d746d56ac286']
Debes hace uno de JOIN para traer los datos y puede ponerle un alias a las tablas para que se mas corta la consutla y mas legible: select u.name as usuario,a. asignatura as asignatura, uni.cuatrimestre as cuatrimestre from usuario a inner join unicars uni on (uni.id_uni = u.id_uni) --aqui hacemos la union entre las tablas por su llave foranea <PERSON> join asignaturas on (a.id=uni.id_asig) --aqui hacemos la union entre las tablas por su llave foranea El nombre de la universidad no lo veo por ninguna parte
ce6aac17414ebd7e23c3fea8d3699ee9e01f8d0700f0879445471b404b188844
['b3c2937801014457a372d746d56ac286']
Tengo un mapa cargado con Mapbox pero no encuentro la manera de cambiar el estilo por defecto trae un street map, aqui esta en codigo xml de la vista: <com.mapbox.mapboxsdk.maps.MapView android:id="@+id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" mapbox:mapbox_cameraTargetLat="40.73581" mapbox:mapbox_cameraTargetLng="-73.99155" mapbox:mapbox_styleUrl="mapbox://styles/mapbox/streets-v10" mapbox:mapbox_cameraZoom="11" /> Creería que es styleUrl pero no encuentro en la documentación para cambiarlo tipo satélite por ejemplo
4c407f5f515febe4721bc679bc2d55eb01eb098619c67c4c8c5170a431b868a2
['b3c3c355e8404f8fab9c5852487880d5']
An example of how my JSON data is like: $scope.a = [{ "email": "keval@gmail", "permissions": { "upload": "1", "edit": "1" } }, { "email": "new@aa", "permissions": { "upload": "1", "edit": "1" } }]; I want to post the same, and here's my approach: $http({ method: 'POST', url: 'backend/savePermissions.php', data: { mydata: $scope.a }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) .success(function(data) { console.log(data); }); And the PHP is to take the request and respond: echo $_POST['mydata']; I tried JSON.stringify before the call and json_decode while echoing it back; still didn't work. Been trying all the possibilities I can think of, and what I find on the web/other questions, but still not working.
9479bb53840135a11b14d28468e8885d5fac4972ebc2a104882255ac08c122cb
['b3c3c355e8404f8fab9c5852487880d5']
In Angular, you need nested scopes. So, your ng-model needs to be fixed to: <input type="number" ng-model="mynumber.val" class="border-input" /> And then in your controller, you define the mynumber object and then use your variable wherever required: $scope.mynumber = {}; alert($scope.mynumber.val); I've created a Codepen if you want to test the working code.
935413784f8cb8ce12fba2cb58680f4e3550bf23dcb29a6c339572cb14f77726
['b3cca1b3e27043aaa8f7ae01ed7700a0']
Really like stories like these, thanks for chiming in! I presume this was some time ago? What did you write? I'm going to get the Psion back out for a play and see if I can't be inspired to plug away at a few chapters of my own.
6f4e81ee588fa43bc2ce2039221ed173009feb9dfa1dae4172c1f5dd65e90bff
['b3cca1b3e27043aaa8f7ae01ed7700a0']
I have just tried analysing my webshop: www.tekompagniet.dk using a chrome-extention, and it seems like a css and js minification would do a great job. However, I have troubles doing this without getting a lot of bugs. I have tried fooman speedster before, but get some weird as looking pictures... any ideas?
6cac8999d2a38e23176394f277f5abc5992714ac1aa6e3f420a520788ee261b6
['b3dab69c646b41658d3dbf94c1e1472d']
I am trying to create a couple of reports from data on another Excel worksheet based on the value in a drop down list. I am using the MATCH and INDEX functions and have created Named Ranges of the columns of data. I am able to get the first value I want in the report but none of the others, even though when I debug by evaluating the formula it points to the right cell but still displays #REF! instead of the actual value from the referenced cell. I'll do my best to make this clear: In "POST_Data" worksheet I have 4 columns titled Course Name, Course Length, Attendee and Date Attended. Currently I have 33 rows of data (plus the header row) but I need the reports to be dynamic since new data will be added from time to time. I have created Dynamic Named Ranges of the data using the OFFSET function (e.g. for the Course Name data I have a NameRange called CourseNamesData = OFFSET(POST_Data!$A$2,0,0,COUNTA(POST_Data!$A:$A),1) In the "DashBoard_and_Data Entry" worksheet I have a two report areas: one to report the Course Name and Date Attended for a specified Attendee (specified by a drop down list in cell C7) and the other report to provide the Attendee Name and Date Attended for a specified Course Name (specified by a drop down list in I7). In row 8 I report the column that the data belongs to in the POST_Data worksheet What IS working: When I choose an Attendee from the drop down list in C7, I correctly report the first of the Course Names for this attendee from the data in the POST_Data worksheet. I used the following formula to do so: =INDEX(CourseNamesData,MATCH(C7,AttendeeNamesData,0),B$8) What is NOT working: The corresponding "Date Attended" data when I use a similar formula as the one that is working. I have: =INDEX(DateAttendedData,MATCH(C7,AttendeeNamesData,0),C$8) but this gives me the #REF! error. Again, when I try to follow the data that this formula points to, it looks like it is pointing to the correct cell but not showing the result. Another issue is how to get all the data corresponding to the choice in the drop down and not just the first row. So for example, if I choose <PERSON>, K. from the attendee list and he has attended 4 training courses, I need all 4 to show up, not just the first one. I appreciate any help or insights on this. If you know of a better way to display the workbook contents, please let me know. Thanks!
1b21e0f247b7bc4e390d4a204a21ca1c82e94f8482f56c6405855a7de46b5555
['b3dab69c646b41658d3dbf94c1e1472d']
I have some Excel VBA code which generates an array based on inputs/calculations and then enters the values onto another sheet. I have this working for one version of my spreadsheet which contains all of the calculations on one sheet using: Range(Cells(4, "T"), Cells(4 + ball, "T")).Value = Application.Transpose(lon) However, when I try to use this on another workbook which enters the values onto another sheet in the same location using: Sheets("Calculations").Range(Cells(4, "T"), Cells(4 + ball, "T")).Value = Application.Transpose(lon) I get an error stating: "Run-time error '1004': Application-defined or object-defined error". I have looked this up and also doing some debug.print of values in my array to ensure I understand the values and the length, believe my issue is with how I am declaring the range. However, I cannot seem to figure out the correct implementation. As a work-around I have a For loop pasting the values into the cell but it seems to me there would be a cleaner way to do this. For n = 1 To ball Sheets("Calculations").Cells(4 + n, "T").Value = lon(n) Next n Thanks for your help!
f02639e0e56de145ee84e56bdb39ed2d5ad758d4e64bb2ff35db0e1f7d8a2fd6
['b3e5acf4cf744cb7b9ca5d87f1d7c864']
Not sure why all the complicated solutions. Just add the following to your .btn css: white-space: normal; So, if you already have a .btn in your global css file, do this: .btn { white-space: normal; } Or if you do not have anything in your global css file, just do it inline, such as: <button type="button" class="btn btn-primary" style="white-space: normal;">This is some button with text that should wrap</button> Note: This method may not work on archaic versions of IE
10f172caf38c75a9551f3355add0835cf92db041a8ae8e48f098b750616a3888
['b3e5acf4cf744cb7b9ca5d87f1d7c864']
Give this a try: <?php // /////////////////////////////////////////////////////////////////////// // This would be your mail.php file /////////////////////////////////////////////////////////////////////// // // // /////////////////////////////////////////////////////////////////////// // Lets Just Check Basic PHP Installation Is Working /////////////////////////////////////////////////////////////////////// // if (!function_exists('mail')) { die('mail() is not available'); } // // // /////////////////////////////////////////////////////////////////////// // Validate Required Passed Fields /////////////////////////////////////////////////////////////////////// // if ( isset($_POST['name']) && $_POST['name'] !='' && isset($_POST['email']) && $_POST['email'] !='' && isset($_POST['phone']) && $_POST['phone'] !='' && isset($_POST['message']) && $_POST['message'] !='' ) { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; } else { die('Sadly you did not complete all of the fields on our contact form'); } // // /////////////////////////////////////////////////////////////////////// // Validate The Email... This Is Just An Example /////////////////////////////////////////////////////////////////////// // if (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', trim($email))) { die('Email Address Invalid. Please Check Your Email.'); } // // /////////////////////////////////////////////////////////////////////// // Build Your Email Message /////////////////////////////////////////////////////////////////////// // $EmailMessage .= "Name: " . $name . " \n\n"; $EmailMessage .= "Email: " . $email . " \n\n"; $EmailMessage .= "Phone: " . $phone . " \n\n"; $EmailMessage .= "Message: " . $message . " \n\n"; // // /////////////////////////////////////////////////////////////////////// // Build Email Header /////////////////////////////////////////////////////////////////////// // $EmailHeader .= "From: " . $name . " <" . $email . "> \n"; $EmailHeader .= "Reply-To: " . $name . " <" . $email . "> \n"; $EmailHeader .= "Return-Path: " . $name . " <" . $email . "> \n"; // running a windows server?? // // /////////////////////////////////////////////////////////////////////// // Send The Email & Confirm It Processed /////////////////////////////////////////////////////////////////////// // if (mail('Rowan Krishnan <<EMAIL_ADDRESS><PERSON> <rowan.krishnan@tufts.edu>', 'Contact Form', $EmailMessage, $EmailHeader)) { // // it appears to have worked, so redirect somewhere else // header("Location: contact.php"); die('Contact Form Redirect'); } else { echo('Contact Form Failed'); } ?>
3ac21dc3ea8d916538f047533899f620b3a6988ec478dd3f8ab7898087cda3f5
['b3ff3417d246444cb7b0282b2a154808']
Refresh token was deliberately omitted in default storage synchronization configuration for security reasons. However, if you need that you can always provide your own storage synchronization configuration like in the example below. It will not override default configuration, but it will be combined with it. To exclude something from default configuration you can use excludeKeys similarly to keys property in storageSync configuration. import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { translationChunksConfig, translations } from "@spartacus/assets"; import { ConfigModule, StateConfig, StorageSyncType } from "@spartacus/core"; import { B2cStorefrontModule } from "@spartacus/storefront"; import { AppRoutingModule } from "./app-routing.module"; import { AppComponent } from "./app.component"; export function refreshTokenConfigFactory(): StateConfig { const config: StateConfig = { state: { storageSync: { keys: { "auth.userToken.token.refresh_token": StorageSyncType.LOCAL_STORAGE } } } }; return config; } @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, AppRoutingModule, B2cStorefrontModule.withConfig({ backend: { occ: { baseUrl: "http://localhost:9002", prefix: "/rest/v2/" } }, context: { baseSite: ["electronics-spa"] }, i18n: { resources: translations, chunks: translationChunksConfig, fallbackLang: "en" }, features: { level: "1.5", anonymousConsents: true } }), ConfigModule.withConfigFactory(refreshTokenConfigFactory), ], providers: [], bootstrap: [AppComponent] }) export class AppModule {}
89120d09ec292b0b66f207881832410b3492740bc2b754c8ebfb97cac9140f88
['b3ff3417d246444cb7b0282b2a154808']
At the moment Spartacus doesn't have good error handling and we have it on our radar. In value fields for loader states, we only want to keep correct values and that's why we don't set by default error action payload as a value. However, you might want to achieve desired behavior by handling the error action in your reducer provided to LoaderReducer. value: reducer ? reducer(state.value, action) // you have this option. You can extract anything from this action and use it to set new state : undefined,
6f3788aea9ece8dc2a8df42ade88a8975f0abdd55bc302e03cded85462d032b9
['b3ff45c6140245399f62f4dcff9af690']
This is for the headstails java homework assignment that you can find a few places online (like http://www.javaproblems.com/2013/01/medium-problem-tricky-heads-and-tails.html) The idea is to input a decimal 0 to 511 and have it output a 3 x 3 matrix of H or T for 0 or 1's (mine works 0 to 255) Here's my attempt though, that I couldn't get working: public static void main(String[] args) { @SuppressWarnings("resource") Scanner keyboard = new Scanner(System.in); //System.out.println("Please enter a number between 0 and 511: "); //int num = keyboard.nextInt(); int num = 458; String binNum = ""; int temp; String[][] coinArr = new String[3][3]; // = [][]; while(num > 0) { temp = (int) (num % 2); binNum = binNum + "" + temp; num = (int) (num / 2); } System.out.println("binNum length is " + binNum.length()); System.out.println("binNum is " + binNum); binNum = String.format((binNum.length() < 9 ? ("%0"+ (9 - binNum.length())+"d%s") : "%0$d%s"), 0 ,binNum); System.out.println("binNum length is " + binNum.length()); System.out.println("binNum is " + binNum); int k=0; for(int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { binNum = binNum.replaceAll("0", "H"); binNum = binNum.replaceAll("1", "T"); coinArr[i][j] = binNum.substring(k, k+1); k++; System.out.print(coinArr[i][j]); } System.out.println(); } }
97fc10565a1ef1e3e368725840093c2d195234c2ab053052504443f3e38ef420
['b3ff45c6140245399f62f4dcff9af690']
I have a barcode scanner plugged into a keyboard input on the back of my computer tower and I'd like to be able to scan an item, have it catch the barcode and have it go through a script. Is there any way to figure out the name of the device/keyboard inputs coming from and have a if input from deviceb then do... ? Thanks
f2d48567e62756d080dabb40f1708806651c31186ddddf97b3476bbcf51fdd89
['b4045e4a65a944d7a8765a228c9856de']
I am using the following android library to display a BottomBar in my app: https://github.com/roughike/BottomBar It's a great library but there's one minor problem that I'm having. I want to show a popup (alertDialog) when the user clicks on a tab. But the problem is that when you click on the tab for the first time, it highlights the tab, and then you have to click it again to get the popup. How can I make it so that I only have to click a tab once for the popup? Also, one more thing, when the app loads, the first tab is by default activated, how can I prevent that from happening? Thanks in advance! Below is my code: BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar); bottomBar.setOnTabReselectListener(new OnTabReselectListener() { @Override public void onTabReSelected(@IdRes int tabId) { if(tabId == R.id.tab_one){ // alertDialogBuilder // show the popup } else if (tabId == R.id.two){ // show another popup } } } Let me know if you want me to post more code. I am mostly using the same code that is posted on that gitHub page.
2b16a12c216a70305c8be3f5db89e19eb8e053bcbc03494dd35fd3f5e5719838
['b4045e4a65a944d7a8765a228c9856de']
So I have two textboxes for the user to select a date and I am using JqQuery's datepicker UI to display a small calendar popup when the textbox is clicked. Now the problem is that when I click on the textbox, the calendar pops up, I select a date and then the textbox gets filled with that date and my scope variable in javascript also gets updated. However, in my HTML, the value of "From" date box doesn't get printed until I click on "To" date box. Below is my code: home.html <form name="myForm"> From Date: <input type="text" id="dateFrom" ng-model="data.dateFromChosen" /> To Date: <input type="text" id="dateTo" ng-model="data.dateToChosen" /> </form> <p>You chose: {{ data.dateFromChosen }} and {{ data.dateToChosen }}</p> script.js $scope.data = {}; $("#dateFrom").datepicker({ onSelect: function(dateText) { $scope.data.dateFromChosen = $("#dateFrom").datepicker({dateFormat: 'mm/dd/yyyy'}).val(); alert("You chose " + $scope.data.dateFromChosen); } }); $("#dateTo").datepicker({ onSelect: function(dateText) { $scope.data.dateToChosen = $("#dateTo").datepicker({dateFormat: 'mm/dd/yyyy'}).val(); alert("You chose " + $scope.data.dateToChosen); } }); So this is what happens: I click on from date box and select a date. Then I get the popup saying that You chose 06/01/2016 which means the $scope.data.dateFromChosen = 06/01/2016. But it doesn't get displayed in my HTML. Then when I click on to date box, the value of dateFromChosen gets printed on HTML. Does anyone know why this happens and how to fix it? Thanks
dee9e513fac9325988c732ec339b705c08036de71a086e6c65883d748190a559
['b405bdc86de1475281c6b44a87adfce8']
So after a while of trial and error what ended up working for me was modifying the IronRouter package. /lib/server/router.js on line 30 change... start: function () { connectHandlers .use(connect.query()) .use(connect.bodyParser()) .use(_.bind(this.onRequest, this)); }, to... start: function () { connectHandlers .use(connect.query()) .use(connect.bodyParser({limit: '100mb'})) // or whatever you want your limit to be .use(_.bind(this.onRequest, this)); },
041c3ff1976e5d2fe569063438cea0eda80fce3da12463154f132d42699f0395
['b405bdc86de1475281c6b44a87adfce8']
I am trying to send a very large amount of JSON to a server side route in my Meteor.js Application. I keep on getting this error... Error: Request Entity Too Large at Object.exports.error (/mnt/data/2/node_modules/connect/lib/utils.js:62:13) at limit (/mnt/data/2/node_modules/connect/lib/middleware/limit.js:46:47) at urlencoded (/mnt/data/2/node_modules/connect/lib/middleware/urlencoded.js:58:5) at /mnt/data/2/node_modules/connect/lib/middleware/bodyParser.js:55:7 at json (/mnt/data/2/node_modules/connect/lib/middleware/json.js:46:55) at Object.bodyParser [as handle] (/mnt/data/2/node_modules/connect/lib/middleware/bodyParser.js:53:5) at next (/mnt/data/2/node_modules/connect/lib/proto.js:190:15) at Object.query [as handle] (/mnt/data/2/node_modules/connect/lib/middleware/query.js:44:5) at next (/mnt/data/2/node_modules/connect/lib/proto.js:190:15) at Object.Package [as handle] (packages/spiderable/spiderable.js:108) In my research I have found that I need to set the request limit for the connect middleware. Does anyone know how I can do this within Meteor? Thanks!
d12ba70d4b0c20c8e968c311a229dc76880180bb18273d99ac3b1554982e574c
['b40ebcfd720948bb9f476c7116414e06']
Role hierarchy works in tandem with Profiles. Let says a role sales manager reports to VP. Object permission of Sales Manager profile assigned to people in Sales Manager role is CRUD and for VP is Read, then because of the hierarchy setup, VP role users will have access to all records that are visible to people in Sales manager role, but the object permissions will define what a VP can do with those. If the VP's profile does not have Edit permissions, he won't be able to edit the records, regardless of sharing setup.
5e8ce6c981362394e9d40e58e618580da7858556c7efefc7b07f9e0fdb141e59
['b40ebcfd720948bb9f476c7116414e06']
I don't think Salesforce has provided that option. I belive that they may have implemented a queue. You may create a component of your own and show the details. Have a look at the message componenet by salesforce [LDS Message](https://github.com/forcedotcom/aura/tree/master/aura-components/src/main/components/ui)