external

When creating an external table in hive can I point the location to specific files in a directory?

*爱你&永不变心* 提交于 2019-11-27 06:38:21
I have defined a table as such: create external table PageViews (Userid string, Page_View string) partitioned by (ds string) row format as delimited fields terminated by ',' stored as textfile location '/user/data'; I do not want all the files in the /user/data directory to be used as part of the table. Is it possible for me to do the following? location 'user/data/*.csv' I came across this thread when I had a similar problem to solve. I was able to resolve it by using a custom SerDe. I then added SerDe properties which guided what RegEx to apply to the file name patterns for any particular

Log4Net config in external file does not work

牧云@^-^@ 提交于 2019-11-27 06:21:46
We are using log4net and want to specify it's configuration in an external config file (as we have done with other sections). To do this we have changed the log4net section in the App.config to: ... <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> ... <log4net configSource="Log.config" /> ... And in the Log.Config file (same directory as the App.config) we have: <log4net> <appender name="General" type="log4net.Appender.FileAppender"> <file value="myapp.log" /> <layout type="log4net.Layout.SimpleLayout" /> </appender> <root> <appender-ref ref="General"

Declaring a global variable `extern const int` in header but only `int` in source file

天大地大妈咪最大 提交于 2019-11-27 06:07:52
问题 I was experimenting with GCC and found out that you can declare external variables const in header files but keep them mutable in implementation files. EDIT : This does actually not work. The only reason I got my test code to compile was because I did not include "header.h" in "header.c". header.h: #ifndef HEADER_H_ #define HEADER_H_ extern const int global_variable; #endif header.c: int global_variable = 17; This seems like a very good feature to use for keeping global_variable readonly to

Use Ajax() function in Jquery to load PART of an external page into div

风流意气都作罢 提交于 2019-11-27 05:58:24
问题 I'm trying to load a DIV element from an external page into my current page using the Ajax/jQuery.ajax function. While I have successfully been able to load an entire external page, I can't seem to load just the DIV element. Here's my code: $("a").click(function() { /* grabs URL from HREF attribute then adds an */ /* ID from the DIV I want to grab data from */ var myUrl = $(this).attr("href") + "#external-div"; $.ajax( { url: myUrl, success: function(html) { /* loads external content into

External USB devices to Android phones?

天大地大妈咪最大 提交于 2019-11-27 05:35:29
问题 I would like to use Android phones as a way to do some processing and visualization of a sensor that would be attached to the USB port on the phone. The sensor would plug into the micro/mini USB, and then I would need to read the incoming data from the USB serial port. Is this possible? I have heard of people using Android to steer robots and other applications, but I have never seen Android being used as a host for a USB sensor. I can't seem to find any official documentation on the subject

Twig variable in extern js file

情到浓时终转凉″ 提交于 2019-11-27 05:31:49
I want to external my js code but there is twig variable. What are your tricks ? team: {{ 'Select your team'|trans }} Thanks, I just set my twig vars as globals before requiring any javascript files. <!DOCTYPE html> <html> <head> <title></title> </head> <body> <script> var my_twig_var = {% if twig_var is defined %}'{{ twig_var }}'{% else %}null{% endif %} </script> <script src="scripts/functions.js"></script> </body> </html> Another aproach I use is to forsee a javascript block in my main template base.twig.html <!DOCTYPE html> <html> <head> <title></title> </head> <body> {% block body %} {%

Load external JS from bookmarklet?

只谈情不闲聊 提交于 2019-11-27 05:06:10
问题 How can I load an external JavaScript file using a bookmarklet? This would overcome the URL length limitations of IE and generally keep things cleaner. 回答1: 2015 Update Content security policy will prevent this from working in many sites now. For example, the code below won't work on Facebook. 2008 answer Use a bookmarklet that creates a script tag which includes your external JS. As a sample: javascript:(function(){document.body.appendChild(document.createElement('script')).src='** your

Call external JS file based on “media screen” value

試著忘記壹切 提交于 2019-11-27 04:53:39
I'm trying this but it is not working: <html> <head> <script src="js/menu-collapser.js" type="text/javascript" media="media screen and (max-width: 599px)"></script> </head> ... </html> //menu-collapser.js : jQuery(document).ready(function($){ $('.main-navigation li ul').hide(); $('.main-navigation li').has('ul').click(function() { $(this).children().toggle(); }); }); Do you have an idea on how to do this in the right way? The script work if used directly in the header with the tags. You can't do that directly using Javascript <script> tags. Media queries are used in linked CSS files or inline

External CSS styles cant be accessed in Google Chrome

坚强是说给别人听的谎言 提交于 2019-11-27 04:43:05
问题 So i have the following code <html> <head> <link href="style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> document.styleSheets[0].cssRules[0].style.color="blue"; </script> </head> //etc. So basically this code works in IE and Mozilla, but not in Chrome. Actually, when you run document.styleSheets[0].cssRules it returns an CSSRulesList Object(in IE and Mozilla), but in Chrome it returns null. Btw, for embedded styles this object seems to work even in Chrome. So is

Cannot load an external page with jQuery.load into a div in my page

半世苍凉 提交于 2019-11-27 04:31:53
I am not able to load an external html page into a div in my page. My Jquery Code is: $(document).ready(function(){ var url = 'http://www.google.com'; $.get(url, function(response) { $('div#external').html(response); }); }); My HTML page is <html><body><div id="external"></div></body></html> I also tried using another JQuery code $(document).ready(function() { $('#external').load('http://google.com'); }); Could anyone please help me. Thanks Amal Due to browser restrictions, most Ajax requests are subject to the "same origin policy". That means that in most cases, you can’t use jQuerys ajax