2018-10-22         Edward

ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview

I was trying to update the content of a modal dialog, and this code works for me:<asp:LinkButton ID="updateSomething" runat="server" Text="Update" CausesValidation="false" OnClientClick="openDialog();" onclick="UpdateButton_Click" /><asp:UpdatePanel ID="upNewUpdatePanel" runat="server"> <ContentTemplate> <asp:Label ID="updateLabel" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="updateSomething" EventName="Click" /> </Triggers></asp:UpdatePanel&g...

 asp.net                     4 answers                     64 view
 2018-10-22         Edward

Twitter Bootstrap - weird parameters?

I'm a newbie with HTML5 and Twitter Bootstrap, but - since I've been looking at some of the pre-built examples - I have a few questions...Let's take this piece of code as an example (from the Fluid Layout Example ):<div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container-fluid"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <...

 html5                     2 answers                     39 view
 2018-10-22         Edward

Github Pages does not display pages like local machine

I create a site with jekyll using the theme minima. The site displays everything well in my local machine(localhost:4000). But it appears strangely on Github Pages. It looks like this.This is the source hosted on github. I tried to modify the files Gemfile and Gemfile.lock, but it remains unchanged. There is no post in your blog. No post no print with the minima home template.Add one post and the magic will append. [XXX]

 github                     1 answers                     4 view
 2018-10-22         Edward

Creating sign-in with my site functionality

We need to develop feature on our site "project.net" for our partners' sites like google sign-in but with our users.The main idea is that partner adds button: "sign-in with project.net".I already have FOSOAuthServerBundle but I can't understand how to implement such feature.How is such idea called?Thank you I have found solution. Like @GiamPy said it's called single sign-on.There is a bundle for symfony called: korotovsky/sso-idp-bundle:~0.2.0 [XXX]

 php                     1 answers                     85 view
 2018-10-22         Edward

<authorization> can protect pages?

Can I use <authorization> to protect webforms from being accessed if a person does not have a specific role?I tried this:<authentication mode="windows" /><authorization> <allow roles="Admin" /> <deny users="*" /></authorization>but if the role Admin is not available then I can still visit the page by typing in the URL. How can I protect this page?I read the documentation on MSDN (ASP.NET Authorization).I also put the UrlAuthorizeModule extra in the web.config to make sure that it gets hit. Best to read this: ASP.NET AuthorizationIt e...

 asp.net                     1 answers                     68 view
 2018-10-22         Edward

incorrect node_module getting deployed to lambda as based on OS

I'm using the serverless framework to create a lambda function and to deploy all works great locally (on my mac) when testing by invoking it, but once its deployed onto AWS I get the following error: 2018-09-03T20:16:26.800Z 3bb86928-afb6-11e8-8ff0-912d71d35609 Error: Failed to load gRPC binary module because it was not installed for the current systemExpected directory: node-v57-linux-x64-glibcFound: [node-v57-darwin-x64-unknown]This problem can often be fixed by running "npm rebuild" on the current systemOriginal error: Cannot find module '/var/task/node_modules/...

 lambda                     1 answers                     30 view
 2018-10-22         Edward

numpy unable to understand

Below is my code. x = np.ones((3, 3))print(x)# [[1. 1. 1.]# [1. 1. 1.]# [1. 1. 1.]]print(x[:, [0, 1, 2, 2]])# [[1. 1. 1. 1.]# [1. 1. 1. 1.]# [1. 1. 1. 1.]]I am not able to understand what has been done in second print statement. Please explain. In [791]: x = np.arange(9).reshape(3,3)In [792]: xOut[792]: array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])In [793]: x[:,[0,1,2,2]]Out[793]: array([[0, 1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 8]])The new array has copies of columns 0 and 1 and 2 copies of column 2. [XXX]

 python-3.x                     1 answers                     9 view
 2018-10-22         Edward

Django manage.py : Is it possible to pass command line argument (for unit testing)

Is it possible to pass command line arguments to Django's manage.py script, specifically for unit tests? i.e. if I do something likemanage.py test myapp -a do_thisCan I receive the value do_this in the setUp function of unit test?P.S. @Martin asked the justification for using command line args in tests: Some extensive tests take a lot of time and don't need to be run before every commit. I want to make them optional.Occasional debug messages printed by my test cases should be optionalSometimes I just want the tests to go crazy and try a lot more permutations of data. All th...

 django                     4 answers                     90 view
 2018-10-22         Edward

Where are files stored when running ng serve?

When I run ng serve, where are the files generated and stored? I need to troubleshoot why the app works with ng serve but not for production build.Forgot to mention that I'm using webpack version of angular-cli. With the webpack version the output isn't written to disk. Webpack manages that all in memory and serves it to the browser using the webpack-dev-server.If you'd like to view the dev output, you will need to run ng build and then look into the dist directory [XXX]

 angular                     1 answers                     10 view
 2018-10-22         Edward

sql 2005 profiler analysis

we have some performance issue with a program, I traced tsql using sql server 2005 profiler and find below result for an INSERT statement,cpu: 0read: 28write: 0duration: 32804 I guess it's because the inserted table has several indexes and it's getting big. is there any other possibilities that I should check? thanks. Duration is in microseconds. 32804 microseconds = 0.032804 seconds. I don't think you have a problem. [XXX]Actually that depends on if your looking at the results in a table or if you are looking at them from the Profiler UI. If it's the UI then it is ...

 sql                     3 answers                     72 view
 2018-10-22         Edward

No data found in PL/SQL

I am trying to get an employee that does not have a manager to show on my table but all im getting is "no data found" when i know that such employee exist in the db.this is my code:ACCEPT p_1 PROMPT 'Please Enter Employee ID:'declare v_eid employee.employee_id%TYPE := &p_1; v_count NUMBER; v_name employee.employee_name%TYPE; v_sal employee.salary%type; v_mname employee.employee_id%TYPE ; v_dptname department.department_name%type; v_avg employee.salary%type;BEGIN SELECT c...

 sql                     2 answers                     37 view
 2018-10-22         Edward

optimistic lock exception on datetime column with hibernate + microsoft sql server 2016 + microsoft jdbc

i have a problem with the combination hibernate + mssql 2016 + microsoft jdbc driver + datetime column.the same software it works perfectly with other databases (oracle, mysql, but also mssql <2016) and with mssql 2016 using the jtds driver, so i believe the problem is in the microsoft jdbc driver.i use this libraries versions:<dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.3.5.Final</version> </dependency> <dependency> <gr...

 java                     1 answers                     52 view
 2018-10-22         Edward

What is better - more data receivers or more threads per consumer?

In Spark Streaming documentation they suggest to parallelize the data receiving (link). They suggest an example to create multiple Data Receivers: val numStreams = 5val kafkaStreams = (1 to numStreams).map { i => KafkaUtils.createStream(...) }Doing that you will get 5 cores to receive data luckily in 5 different machines. But in terms of performance, why is this option better than having a Data Receiver with 5 threads? (For instance for machines with more than 5 cores)val numThreads = 5val topicList = Map("topic1" -> numThreads)val kafkaStream = KafkaUtils.createStrea...

 apache-spark                     1 answers                     31 view
 2018-10-22         Edward

How to output SQLAlchemy logger only to a file

From what I read in the SQLAlchemy logging configuration documentation, I understood that the echo argument on sqlalchemy.create_engine controls whether sqlalchemy logging is forced to stdout, but shouldn't affect whether log messages are available to log handlers. In the code below, I get no output to stdout OR db.log if echo=False and I get output to both stdout AND db.log if echo=True. I want nothing to stdout while db.log is still populated. How can I accomplish that?This is python 2.7.6 and sqlalchemy 0.9.9import sqlalchemyimport loggingactive_db_url = 'postgres:/...

 python                     1 answers                     28 view
 2018-10-22         Edward

error :object can't be deleted because its id attribute is set to None

Trying to Delete an object using shell in django. How do i delete the object say "Ron"?I use the following command:t.delete('Ron') The error: object can't be deleted because its id attribute is set to NoneSuggests that you either never saved the object t in the first place, or you changed the primary key (here id) to None manually.If you have a single object you can perform a .delete() on the object, for example:my_obj = Model.objects.get(name='Ron')my_obj.delete()You should not add extra parameters to delete except for using and keep_parents, as specified in the docume...

 django                     1 answers                     93 view
 2018-10-22         Edward

how to display file input buttons multiple times with image preview?

I am working with laravel 5.6 and I have image upload button with my form. currently it is using upload single file with image thumbnail preview.<h3>Upload images</h3><input type="file" id="files" name="files[]" multiple />jquery<script > $(document).ready(function() { if (window.File && window.FileList && window.FileReader) { $("#files").on("change", function(e) { var files = e.target.files, filesLength = files.length; for (var i = 0; i < filesLength; i++) { ...

 javascript                     1 answers                     49 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last