Daily Archives

Articles indexed Wednesday June 4 2014

Page 12/18 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How to create a view of table that contains a timestamp column?

    - by Matt Faus
    This question is an extension of a previous one I have asked. I have a table (2014_05_31_transformed.Video) with a schema that looks like this. I have put up the JSON returned by the BigQuery API describing it's schema in this gist. I am trying to create a view against this table with an API call that looks like this: { 'view': { 'query': u 'SELECT deleted_mod_time FROM [2014_05_31_transformed.Video]' }, 'tableReference': { 'datasetId': 'latest_transformed', 'tableId': u 'Video', 'projectId': 'redacted' } } But, the BigQuery API is returning this error: HttpError: https://www.googleapis.com/bigquery/v2/projects/124072386181/datasets/latest_transformed/tables?alt=json returned "Invalid field name "deleted_mod_time.usec". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long." The schema that the BigQuery API does not make any distinction between a TIMESTAMP data type and a regular nullable INTEGER data type, so I can't think of a way to programmatically correct this problem. Is there anything I can do, or is this a bug with BigQuery's view implementation?

    Read the article

  • How can I create or assign a method to temp (WindowAdapter)?

    - by Doug Hauf
    I want to create an instance of the WindowAdapter and put my method for windowClosing in it and then sent the temp into the f.addWindowListener(temp) can this be done. Java will not let me create an instance of WindowAdapter like below. WindowAdapter temp = new WindowAdapter(); <-- Does not compile How could this be done? Code: public static void main(String args[]) { setLookFeel(); JFrame f = new JFrame("Hello World Printer..."); WindowAdapter temp; f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); JButton printButton = new JButton("Print Hello World"); printButton.addActionListener(new HelloWorldPrinter()); f.add("Center", printButton); f.pack(); f.setVisible(true); }

    Read the article

  • Data Access Layer in an ASP.NET website

    - by user3519124
    :) i have a DAL class file in my project, that my teacher sent me and explained to me but i did not really understand it. It has number of functions, and I understand only few of them, like with connecting to the database or creating a command object but there are 2 that I dont understand: public static DataTable GetTable(string str) { OleDbConnection con = DAL.GetConnection(); OleDbCommand cmd = DAL.GetCommand(con, str); DataTable dt = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter(); adp.SelectCommand = cmd; adp.Fill(dt); return dt; } public static int ExecuteNonQuery(string str) { int num = -1; OleDbConnection con = DAL.GetConnection(); con.Open(); if (con.State == ConnectionState.Open) { OleDbCommand cmd = DAL.GetCommand(con, str); num = cmd.ExecuteNonQuery(); con.Close(); } return num; } thank you :)

    Read the article

  • Spring App error: java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion

    - by Shades88
    I am writing a simple spring mvc login form example. I am getting below error in netbeans 05-Jun-2014 02:11:51.055 SEVERE [http-nio-8084-exec-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/SpringSecurity.xml]; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:413) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4738) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5158) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:579) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:455) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1554) at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1428) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:885) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:343) at javax.servlet.http.HttpServlet.service(HttpServlet.java:618) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.config.SecurityNamespaceHandler]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105) at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:130) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1414) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:187) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:110) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391) ... 60 more Caused by: java.lang.NoClassDefFoundError: org/springframework/security/core/SpringSecurityCoreVersion at org.springframework.security.config.SecurityNamespaceHandler.<init>(SecurityNamespaceHandler.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) ... 69 more Caused by: java.lang.ClassNotFoundException: org.springframework.security.core.SpringSecurityCoreVersion at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1132) ... 75 more I am using spring 3.2.7. It was not having spring security jar. So I got it downloaded using maven. It's version is 3.2.4. What is this error? There's no error in code. What must have gone wrong? For last 3 hours I have been trying to run a simple example, but totally hammered by this error. Please help

    Read the article

  • Need a very simple bash-based webserver for logging XML in HTTP POST

    - by Syffys
    As in title, it's for testing purpose and I need it to be extremely light (1 line to 1 single light file). Here is a XML query sample: XML_QUERY=$(cat <<EOF <?xml version='1.0' encoding='UTF-8'?> <Test></Test> EOF ) curl -H "Content-type: text/xml; charset=utf-8" -H "Soapaction: \"\"" -k -d "${XML_QUERY}" http://localhost:8088 Here are some of the tracks I have found so far even if I wasnt able to adapt them to work as I expect: Netcat minimal webserver: Problem is that my nc does not have the -q option, so the connection is closing before delivering the XML content Netcat Only webserver: Same as above Python based: But does not handle POST Thanks in advance!

    Read the article

  • Ember nested route. Load more models

    - by user3568719
    JsBin http://jsbin.com/EveQOke/153/ I know how to load more then one model to a route, using Ember.RSVP.hash. (see Jsbin Children menu). I use dynamic part to access one elem from a collection children/1. But i cant load more models to a nested resource. In my example i want to populate all the toys for a select, not just list the toys of the child. I have tried to access the model of the route children App.ChildRoute = Ember.Route.extend({ model: function(param){ return Ember.RSVP.hash({ allToys: this.modelFor("children"), child:this.store.find('child', param.child_id) }); } }); and use its model's toy property (since there have already loaded all of the toys) child.hbs <h4>All avaiable toys</h4> <table> {{#each toy in model.allToys.toys}} <tr> <td>{{toy.name}}</td> </tr> {{/each}} </table>

    Read the article

  • MVC Partial View Not Refreshing when using JSON data

    - by 40-Love
    I have a dropdown that I'm using to refresh a div with checkboxes. I am trying to figure out why my view is not refreshing if I pass in data in JSON format. If I pass in just a regular string, the view refreshes. If I pass in JSON data, the view does not refresh. If I step through the code in the Partial view, I can see the correct number of records are being passed in, however the view doesn't get refreshed with the correct number of checkboxes. I tried to add some cache directives, it didn't work. This doesn't work: $(function () { $('#ddlMoveToListNames').change(function () { var item = $(this).val(); var selectedListID = $('#ddlListNames').val(); var checkValues = $('input[name=c]:checked').map(function () { return $(this).val(); }).toArray(); $.ajax({ url: '@Url.Action("Test1", "WordList")', type: 'POST', cache: false, data: JSON.stringify({ words: checkValues, moveToListID: item, selectedListID: selectedListID }), dataType: 'json', contentType: 'application/json; charset=utf-8', success: function (result) { } }) .done(function (partialViewResult) { $("#divCheckBoxes").replaceWith(partialViewResult); }); }); }); This works: $(function () { $('#ddlMoveToListNames').change(function () { var item = $(this).val(); var selectedListID = $('#ddlListNames').val(); var checkValues = $('input[name=c]:checked').map(function () { return $(this).val(); }).toArray(); $.ajax({ url: '@Url.Action("Test1", "WordList")', type: 'POST', cache: false, data: { selectedListID: item }, success: function (result) { } }) .done(function (partialViewResult) { $("#divCheckBoxes").replaceWith(partialViewResult); }); }); }); Partial View: @model WLWeb.Models.MyModel <div id="divCheckBoxes"> @foreach (var item in Model.vwWordList) { @Html.Raw("<label><input type='checkbox' value='" + @Html.DisplayFor(modelItem => item.Word) + "' name='c'> " + @Html.DisplayFor(modelItem => item.Word) + "</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); } </div> Controller: [AcceptVerbs(HttpVerbs.Post)] [OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")] public PartialViewResult Test1(MyModel vm, string[] words, string moveToListID, string selectedListID) { int listNameID = Convert.ToInt32(moveToListID); List<vwWordList> lst = db.vwWordLists.Where(s => s.Word.StartsWith("wa") && s.ListID == listNameID).ToList(); vm.vwWordList = lst; return PartialView("Partial1", vm); } View: @Html.DropDownListFor(x => Model.FilterViewModel.MoveToListNameID, Model.FilterViewModel.MoveToListNameList, new { @id = "ddlMoveToListNames", style = "width:100px;" })

    Read the article

  • QML 5.3 iOS compilation of pure QML app

    - by Nathaniel Johnson
    I have an application written in QML. Initially, I used the standard C++ bootstrap for the app. int main(int argc, char *argv[]) { QApplication app(argc, argv); // A bunch of components and data models written in C++ QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); return app.exec(); } The bulk of the app is in QML and the more I work with QML, the happier I am with it and the more I feel comfortable converting the C++ pieces to QML. So, it comes to one risk that I wanted to ask about. If I convert the app to a pure QML application like the kind generated by the Qt Quick UI application wizard with no C++ and designed to be run with qmlscene will I be able to compile it for iOS when the time to port it comes or will I end up just converting it back to the C++ loader form? TL;DR Can pure QML (no C++) apps be compiled and run on iOS devices?

    Read the article

  • samsung galaxy tab 4 not recognized by eclipse

    - by michael
    the just released samsung galaxy tab 4 tablet does bring up the 'autoplay' box with device options when connected, but is not being recognized by eclipse, nothing shows in the device window. I have enabled debugging on the galaxy tab, including tapping the 'about' box 7 times to make the developer options magically appear. it runs kitkat and the Samsung site has a 'no data available' under the driver tab for this device. since it just came out at target last week it's unlikely there would be a new driver anyway, which has been the usual suggestion for this question on older models.

    Read the article

  • How may I create an horizontal view from a tree table

    - by Giuseppe Alfieri
    I want to create a view for each tree for each customer of this 3 table structured in this way: Fields: db_attrib.name, db_attrib.name, db_attrib.name until the last db_tree.id_child = 0 Values: db_attrib_values.value where db_attrib.id = db_attrib_value.id_attrib and so on for each child And so on for each db_tree.id This is the link to sql fiddle with the prepared structure: http://sqlfiddle.com/#!9/21516

    Read the article

  • Build error while compiling Android source (JNI)

    - by arTsmarT
    I added some new functionality in C and when I try to build it, it gives me the following error: libnativehelper/include/nativehelper/JNIHelp.h:116: error: undefined reference to 'jniRegisterNativeMethods' error. I have included jnihelp.h in my C files. Is this a makefile related issue or am I missing something? LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := newfile LOCAL_SRC_FILES := newfile.cpp include $(BUILD_SHARED_LIBRARY)

    Read the article

  • PHP app.yaml, new to GAE, not sure of how to setup

    - by chetweewax
    I have a single page website built on bootstrap 3, that I am trying to move to Google Apps Engine. I Scaffold my sites using php, and all the content is showing but not the styles and javascript. My site is basically set up as follows _/js/bootstrap.js _/js/custom.js _/fonts/glypicon ...etc _/css/bootstrap.css _/css/custom.css _/php/ .. all my php files go here ... index.php can someone help me setup my app.yaml for this? I am new to GAE, and am a little confused by this.

    Read the article

  • angular-ui maps javascript error

    - by Will Lopez
    I'm having an issue with angularui. This error came from angular-google-maps.js: Error: [$compile:ctreq] Controller 'googleMap', required by directive 'rectangle', can't be found! http://errors.angularjs.org/1.2.16/$compile/ctreq?p0=googleMap&p1=rectangle at http://localhost:62874/Scripts/angular.js:78:12 at getControllers (http://localhost:62874/Scripts/angular.js:6409:19) at nodeLinkFn (http://localhost:62874/Scripts/angular.js:6580:35) at compositeLinkFn (http://localhost:62874/Scripts/angular.js:5986:15) at compositeLinkFn (http://localhost:62874/Scripts/angular.js:5989:13) at compositeLinkFn (http://localhost:62874/Scripts/angular.js:5989:13) at nodeLinkFn (http://localhost:62874/Scripts/angular.js:6573:24) at compositeLinkFn (http://localhost:62874/Scripts/angular.js:5986:15) at Scope.publicLinkFn [as $transcludeFn] (http://localhost:62874/Scripts/angular.js:5891:30) at link (http://localhost:62874/Scripts/ui-bootstrap-tpls-0.12.0.min.js:9:8037) <div class="rectangle grid-style ng-scope ng-isolate-scope" data-ng-grid="pipelineGrid"> I'm a little confused because the controller isn't trying to inject the angular-ui map directive: appRoot.controller('PipelineController', ["$scope", "$location", "$resource", function ($scope, $location, $resource) { ... Here's the html: <div class="container"> <tabset> <tab heading="Upload File"> <p>Tab 1 content</p> </tab> <tab heading="Data Maintenance"> Tab 2 content <div ng-controller="PipelineController"> <div id="mapFilter" class="panel panel-default"> <div class="panel-heading text-right"> <div class="input-group"> <input type="text" class="form-control" ng- model="pipelineGrid.filterOptions.filterText" placeholder="enter filter" /> <span class="input-group-addon"><span class="glyphicon glyphicon- filter"></span></span> </div> </div> <div class="panel-body"> <div class="rectangle grid-style" data-ng-grid="pipelineGrid"> </div> </div> </div> </div> </tab> </tabset> </div> Thank you!

    Read the article

  • What is this Design Pattern?

    - by Can't Tell
    I read the Wikipedia articles on FactoryMethod and AbstractFactory but the following code doesn't seem to fit anywhere. Can someone explain to me what the following pattern is or if it is an anti-pattern? interace PaymentGateway{ void makePayment(); } class PaypalPaymentGateway implements PaymentGateway { public void makePayment() { //some implementation } } class AuthorizeNetPaymentGateway implements PaymentGateway { public void makePayment() { //some implementation } } class PaymentGatewayFacotry{ PaymentGateway createPaymentGateway(int gatewayId) { if(gatewayId == 1) return PaypalPaymentGateway(); else if(gatewayId == 2) return AuthorizeNetPaymentGateway(); } } Let's say the user selects the payment method using a radio button on an html page and the gatewayId is derived from the radio button value. I have seen code like this and thought it was the AbstractFactory pattern but after reading the Wikipedia article, I'm having doubts.

    Read the article

  • GIgya Native Login without using Facebook and Twitter Account

    - by Wodjefer
    Following code that i am using to login but i am getting a Null response - (IBAction) signInPressed : (id)sender { [super signInPressed:sender]; NSLog(@"ACCLoginViewController_iPhone Sign-IN Pressed"); //Load the Gigya login UI component, passing this View Controller as a delegate. GSRequest *request = [GSRequest requestForMethod:@"accounts.login"]; [request.parameters setObject:self.emailField.text forKey:@"loginID"]; [request.parameters setObject:self.passwordField.text forKey:@"password"]; request.parameters[@"loginID"] = @"email"; [request sendWithResponseHandler:^(GSResponse *response, NSError *error) { if (!error) { NSLog(@"the resposne = %@",response); } else { // Check the error code according to the GSErrorCode enum, and handle it. NSLog(@"the Error = %@",error.description); } }]; // [self loadTabbar]; }

    Read the article

  • static block instance block java Order

    - by Rollerball
    Having read this question In what order are the different parts of a class initialized when a class is loaded in the JVM? and the related JLS. I would like to know in more detail why for example having class Animal (superclass) and class Dog (subclass) as following: class Animal { static{ System.out.println("This is Animal's static block speaking"): } { System.out.println("This is Animal's instance block speaking"); } class Dog{ static{ System.out.println("This is Dog's static block speaking"); } { System.out.println("This is Dog's instance block speaking"); } public static void main (String [] args) { Dog dog = new Dog(); } } Ok before instantiating a class its direct superclass needs to be initialized (therefore all the statics variables and block need to be executed). So basically the question is: Why after initializing the static variables and static blocks of the super class, control goes down to the subclass for static variables initialization rather then finishing off the initialization of also the instance member? The control goes like: superclass (Animal): static variables and static blocks subclass (Dog): static variables and static blocks superclass (Animal): instance variables and instance blocks sublcass (Dog):instance variables and instance blocks What is the reason why it is in this way rather than : superclass -> static members superclass -> instance members subclass -> static members sublcass-> instance members

    Read the article

  • Highlight DIV and dim the rest on mouseover

    - by Darren Sweeney
    I have a page full of DIVs which contain images. When I mouse over an image I can highlight it or add a shadow to accent it easily by adding class etc but is there a way to dim every other image instead. DIVs are loaded into DOM and I would like the DIV currently hovered over to retain 100% or 1 opacity and the rest of the DIVs on the page to fade to say 70% or 0.7 when one DIV is highlighted. Is this possible?

    Read the article

  • Using CMS for App Configuration - Part 1, Deploying Umbraco

    - by Elton Stoneman
    Originally posted on: http://geekswithblogs.net/EltonStoneman/archive/2014/06/04/using-cms-for-app-configurationndashpart-1-deploy-umbraco.aspxSince my last post on using CMS for semi-static API content, How about a new platform for your next API… a CMS?, I’ve been using the idea for centralized app configuration, and this post is the first in a series that will walk through how to do that, step-by-step. The approach gives you a platform-independent, easily configurable way to specify your application configuration for different environments, with a built-in approval workflow, change auditing and the ability to easily rollback to previous settings. It’s like Azure Web and Worker Roles where you can specify settings that change at runtime, but it's not specific to Azure - you can use it for any app that needs changeable config, provided it can access the Internet. The series breaks down into four posts: Deploying Umbraco – the CMS that will store your configurable settings and the current values; Publishing your config – create a document type that encapsulates your settings and a template to expose them as JSON; Consuming your config – in .NET, a simple client that uses dynamic objects to access settings; Config lifecycle management – how to publish, audit, and rollback settings. Let’s get started. Deploying Umbraco There’s an Umbraco package on Azure Websites, so deploying your own instance is easy – but there are a couple of things to watch out for, so this step-by-step will put you in a good place. Create From Gallery The easiest way to get started is with an Azure subscription, navigate to add a new Website and then Create From Gallery. Under CMS, you’ll see an Umbraco package (currently at version 7.1.3): Configure Your App For high availability and scale, you’ll want your CMS on separate kit from anything else you have in Azure, so in the configuration of Umbraco I’d create a new SQL Azure database – which Umbraco will use to store all its content: You can use the free 20mb database option if you don’t have demanding NFRs, or if you’re just experimenting. You’ll need to specify a password for a SQL Server account which the Umbraco service will use, and changing from the default username umbracouser is probably wise. Specify Database Settings You can create a new database on an existing server if you have one, or create new. If you create a new server *do not* use the same username for the database server login as you used for the Umbraco account. If you do, the deployment will fail later. Think of this as the SQL Admin account that you can use for managing the db, the previous account was the service account Umbraco uses to connect. Make Tea If you have a fast kettle. It takes about two minutes for Azure to create and provision the website and the database. Install Umbraco So far we’ve deployed an empty instance of Umbraco using the Azure package, and now we need to browse to the site and complete installation. My Website was called my-app-config, so to complete installation I browse to http://my-app-config.azurewebsites.net:   Enter the credentials you want to use to login – this account will have full admin rights to the Umbraco instance. Note that between deploying your new Umbraco instance and completing installation in this step, anyone can browse to your website and complete the installation themselves with their own credentials, if they know the URL. Remote possibility, but it’s there. From this page *do not* click the big green Install button. If you do, Umbraco will configure itself with a local SQL Server CE database (.sdf file on the Web server), and ignore the SQL Azure database you’ve carefully provisioned and may be paying for. Instead, click on the Customize link and: Configure Your Database You need to enter your SQL Azure database details here, so you’ll have to get the server name from the Azure Management Console. You don’t need to explicitly grant access to your Umbraco website for the database though. Click Continue and you’ll be offered a “starter” website to install: If you don’t know Umbraco at all (but you are familiar with ASP.NET MVC) then a starter website is worthwhile to see how it all hangs together. But after a while you’ll have a bunch of artifacts in your CMS that you don’t want and you’ll have to work out which you can safely delete. So I’d click “No thanks, I do not want to install a starter website” and give yourself a clean Umbraco install. When it completes, the installation will log you in to the welcome screen for managing Umbraco – which you can access from http://my-app-config.azurewebsites.net/umbraco: That’s It Easy. Umbraco is installed, using a dedicated SQL Azure instance that you can separately scale, sync and backup, and ready for your content. In the next post, we’ll define what our app config looks like, and publish some settings for the dev environment.

    Read the article

  • Python in Finance by Yuxing Yan, Packt Publishing Book Review

    - by Compudicted
    Originally posted on: http://geekswithblogs.net/Compudicted/archive/2014/06/04/python-in-finance-by-yuxing-yan-packt-publishing-book-review.aspx I picked Python in Finance from Packt Publishing to review expecting to bore myself with complex algorithms and senseless formulas while seeing little actual Python in action, indeed at 400 pages plus it may seem so. But, it turned out to be quite the opposite. I learned a lot about practical implementations of various Python modules as SciPy, NumPy and several more, I think they empower a developer a lot. No wonder Python is on the track to become a de-facto scientist language of choice! But I am not going to compromise the truth, the book does discuss numerous financial terms, many of them, and this is where the enormous power of this book is coming from: it is like standing on the shoulders of a giant. Python is that giant - flexible and powerful, yet very approachable. The TOC is very detailed thanks to Packt, any one can see what financial algorithms are covered, I am only going to name a few which I had most fun with (though all of them are covered in enough details): Fama*, Fat Tail, ARCH, Monte-Carlo and of course the volatility smile! I am under an impression this book is best suited for students in Finance, especially those who are about to join the workforce, but I suspect the material in this book is very well suited for mature Financists, an investor who has some programming skills and wants to benefit from it, or even a programmer, or a mathematician who already knows Python or any other language, but wants to have fun in Quantitative Finance and earn a few buck! Pure fun, real results, tons of practical insight from reading data from a file to downloading trade data from Yahoo! Lastly, I need to complement Yuxing – he is a talented teacher, this book could not be what it is otherwise. It is a 5 out of 5 product. Disclaimer: I received a  free copy of this book for review purposes from the publisher.

    Read the article

  • non-GUI connection to local Hyper-V VM without network

    - by sandro
    I have a virtual machine on Hyper-V manager (Windows 2008 R2) without a network configured on the VM. From a powershell script running on the host Windows server, I would like to query into the OS of that local VM for certain information (i.e. if a given process has finished completion). I am using codeplex's pshyperv module (https://pshyperv.codeplex.com/) to interact with Hyper-V manager, but the only cmdlet to connect to the vm is 'New-VMConnectSession', which launches a 'vmconnect.exe' connection to the VM. Since vmconnect.exe is essentially RDP, this is not very script-friendly. From within a host's powershell script, is there any way to send a command to a local virtual machine's OS and receive output, if no network is configured on the VM? (I believe Vmware's 'vmrun' utility has this capability) Another way to ask this question: Does Hyper-V have a non-GUI-based form of vmconnect.exe? (PS. Not sure if this was more stackoverflow or serverfault)

    Read the article

  • NAS device for distributed team

    - by user5959
    We are a distributed team spread across 5 locations. We have a shared drive (1 TB data) at our former location that we are currently accessing via Hamachi VPN. Our shared drive is a network folder on a Windows Server located at one of our locations. The current connection speed is terrible. The upload speed at the current location of the shared drive is very slow. We looking for a NAS device that we can host at another location with better upload speed that all of us can access. I am looking for a NAS device that has these features: Minimal Maintenance as we do not have dedicated IT resources Access data on the device from multiple locations. Ability to create network drive (On Windows Computers Map Network Drive) Upload data from random client computers without having to install software. (Right now, we use LogMeIn Rescue's file manager) Ability handle slow or dropped connections when transferring files (Maximum size 1.5 GB)

    Read the article

  • File permissions on a dedicated server [duplicate]

    - by Niet the Dark Absol
    This question already has an answer here: What permissions should my website files/folders have on a Linux webserver? 4 answers I have a dedicated server for my website. There are no other users, and no other websites on the same machine. Is there any risk in setting 777-permissions on my site's public_html folder, bearing in mind configuration files with passwords and access keys are stored outside that root?

    Read the article

  • Using rspec to check creation of template

    - by Brian
    I am trying to use rspec with puppet to check the generation of a configuration file from an .erb file. However, I get the error 1) customizations should generate valid logstash.conf Failure/Error: content = catalogue.resource('file', 'logstash.conf').send(:parameters)[:content] ArgumentError: wrong number of arguments (0 for 1) # ./spec/classes/logstash_spec.rb:29:in `catalogue' # ./spec/classes/logstash_spec.rb:29 And the logstash_spec.rb: describe "customizations" do let(:params) { {:template => "profiles/logstash/output_broker.erb", :options => {'opt_a' => 'value_a' } } } it 'should generate valid logstash.conf' do content = catalogue.resource('file', 'logstash.conf').send(:parameters)[:content] content.should match('logstash') end end

    Read the article

  • OpenVPN on port 53

    - by TossUser
    I have an openvpn server setup on UDP port 53 on a public IP. All the connecting clients gets pushed external DNS servers such as 8.8.8.8 and opendns. Sometimes the resolution stops working on the connected vpn clients and I get strange packets in the openvpn log. Now my question is why is that? When a VPN client, let's say 192.168.1.22 does a DNS query that query should go to 8.8.8.8:53 and then an UDP response packet should be sent back to 192.168.1.22 on a high UDP port. Any ideas? Thanks

    Read the article

  • Security against IP spoofing [on hold]

    - by user1369975
    I am pursuing a college project, in which I am running three fake services on three ports to protect the main service (say running at port 80). The concept is that if the user is malicious, he'll try to bring the services down and access the fake services. These ports adopt a blocking process of a connection request and record the IP and port of the client. These are logged and aren't granted access on service on port 80. But what to do if the client spoofs his IP? How can I modify my system?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >