I have a form which would collect location information from the user. I'm using Google places api to autocomplete the location information. It works great. Everything got filled out nicely however there are some places (e.g. my workplace which is a building), Google does not return a postal code for it. I followed this example from Google address autocomplete. It also doesn't return postal code for my workplace. So I'm not entire sure what I did wrong. Below is my code: HTML <div id="location-autocomplete" style="display: none;"> <div class="half-formfield"> @Html.LabelFor(x => x.Address) @Htm
Does const vector<A> mean that its elements are constas well? In the code below, v[0].set (1234); in void g ( const vector<A> & v ) produces the compiler error const.cpp:28:3: error: member function 'set' not viable: 'this' argument has type 'const value_type' (aka 'const A'), but function is not marked const Why? But (*v[0]).set(1234); in void h ( const vector<A *> & v ) is OK for the compiler. What's the difference between the versions? // ........................................................... class A { private: int a; public: A (int a_) : a (a_) { } int get () const { return a; } void
I am constructing my own AuthorizingRealm subclass, and am having a tough time wiring it up to my SecurityManager. The essence of my realm: public class MyRealm extends AuthorizingRealm { protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { try { // My custom logic here } catch(Throwable t) { System.out.println(t.getMessage()); } SimpleAuthenticationInfo authn = new SimpleAuthenticationInfo(new MyUser(), "somePassword"); return authn; } protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { try { // My cu
bought a php software that allows users to build websites. But the guy I paid didn't build a signup form. I'm dangerous enough to do basic coding. But I feel this is past my skill level. The form I created inserts into the mysql database just fine, but it wold let the new users that use this form login because the password field isn't hashing. HMTL signup form: <form action="input.php" method="post" class="pcss3f pcss3f-type-hor"> <header>Fillout the below to join.</header> <section class="state-normal"> <label for="">First Name</label> <input type="text" name="first_name"/> <i class="icon-use
I have a requirement to have multiple select parameters on a BI Publisher report. I am passing the parameters to a function that turns a comma separated list of values to a table. I then use the tables from the csv parser function in "IN" statements in the where clause. It looks likes below... select * from table(my_report_function(my_csv_parser_function(:Parameter)) This works fine when I run it in SQL Developer. The problem is that seems when BI Publisher passes the parameter it interprets each comma as a separate parameter so I get an invalid number of parameters error. How can I stop it fr
I am a student and we have a Object-Oriented Project that we have to do to pass Object-Oriented course. My problem is to design the project. Teacher wants two different class diagram.Teacher said "One is high level, other one is normal class diagram." I know that high-level class diagram have detailed information such as attributes and methods. Additionally, I think high-level diagram covers normal diagram. What is normal class diagram? What is the difference between high-level and normal class diagram? I think that if we draw a high-level diagram normal diagram is redundant. Why Did teacher w
fairly new user but have basic understanding of command line/python. when attempting to install pip through windows 8 powershell get the following error message: Cannot fetch index base URL https://pypi.python.org/simple/ Could not find any downloads that satisfy the requirement pip Cleaning up... No distributions at all found for pip Storing debug log for failure in C:\Users\xxxx\pip\pip.log other instances of similar question seem to suggest something to do with proxy and then some more detailed linux instructions. i am unfamiliar with 'proxy' though if it's relevant i have a VPN extension i
I call the initialize function on page load. Which correctly setsup all the markers. Then I have a searchbox along with a submit button which clears all the markers and then fetches a new JSON object which consist of new markers to be created. As soon as I enter a search query and call the getWorldTweets function I get this error: Cannot read setMap property of undefined which points to the addMarker and deleteMarker functions. var map; var marker; var allmarkers = []; var iterator = 0; var riterator = 0; var geocoder = new google.maps.Geocoder(); var search = { q: "" }; function initialize()
In JavaScript, Math.cbrt(1728) evaluate to the exact result of 12. However, the seemingly-equivalent expression Math.pow(1728, 1/3) evaluates to 11.999999999999998. Why do these results vary in precision?
In the JavaFX Scene Builder there is a text field to search in the library: Is this a default control (if so I can't find it) or did they simply style a text field? I tried looking in the source code of the Scene Builder as well, but could not find it.
Hi i am new to spring restful service using angular.js, i need to display data returning from spring controller via angular js. Here i hava attached the code Controller file:- @Controller public class Control { @RequestMapping(value="/getContent",method = RequestMethod.GET,produces = {"application/json"}) public @ResponseBody String show(){ String msg = "welcome to spring angular js"; return msg; }} servlet file: <context:component-scan base-package="spring" /> <mvc:annotation-driven content-negotiation-manager="contentManager"/> <bean id="contentManager" class="org.springframework.web.accept.
I am trying to get create a file in Perl using GetOptions from Getopt::Long, and one of the inputs is an array. My code looks like this: my $filename = 'grid.sh'; my @job_name; my $output_file; my $testbench; my %opts = ( 'job_name' => \@job_name, 'output' => \$output_file, 'testbench' => \$testbench, ); GetOptions( \%opts, 'job_name=s', 'output=s', 'testbench=s' ); open(my $fh, '>', $filename) or die "Could not open"; for (my $i=0; $i <= 2; $i++) { print $fh "Job names are $job_name[$i]"; } close $fh; In my command line I am providing the input as: perl grip_script.pl "-job_name test -job_nam
When I try to synthesize my Verilog project, I get the following errors: ERROR:Xst:2634 - "shiftman.v" line 15: For loop stop condition should depend on loop variable or be static. ERROR:Xst:2634 - "shiftman.v" line 22: For loop stop condition should depend on loop variable or be static. I think I understand what causes the error, but I can't find a way to fix it. module shiftman(in,sh,out); input[47:0] in; input[8:0] sh; output[47:0] out; reg[47:0] out; reg[7:0] r; reg i; always @(in or sh) begin r = sh[7:0]; out = in; if (sh[8] == 0) for (i=0; i<r; i=i+1) begin out[23:0] = {1'b0,out[23:1]};
Given a set of database records that record the date when an object enters a particular state, I would like to produce a query that shows how many objects are in each state on any particular date. The results will be used to produce trend reports showing how the number of objects in each state changes over time. I have a table like the following that records the date when an object enters a particular state: ObjID EntryDate State 1 2014-11-01 A 1 2014-11-04 B 1 2014-11-06 C 2 2014-11-01 A 2 2014-11-03 B 2 2014-11-10 C 3 2014-11-03 B 3 2014-11-08 C There are an arbitrary number of objects and s
I'm creating a 2 column masonry layout using images of different sizes. The images can be any size as long as they have the greatest common divisor (as required by the Masonry plugin). In order to make the layout responsive I'm converting the width of the masonry items into percent (or I can use min-width and width 100%). Update: I noticed that many who answer make both columns 50% as a solution. That works but is not the goal. Images have to retain their original image size. They can shrink but keep the same ratio. $(function () { var container = $('#container'); // Convert .box width from pi
I am getting below exception org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile. Configuration: RabbitMQ 3.3.5 on windows On Config file in %APPDATA%\RabbitMQ\rabbit.config I have done below change as per https://www.rabbitmq.com/access-control.html [{rabbit, [{loopback_users, []}]}]. I also tried creating a user/pwd - test/test doesn't seem to make it work. Tried the Steps from this post. Other Configuration Details are as below: To
I've created a party invitation template in MailChimp with an RSVP section within the body of the email that contains 3 buttons: yes maybe no I have also added a custom text field on the list called "RSVP". Is there a way I can automate the user click event to automatically update the profile and target this field? I realize I can add the |UPDATE_PROFILE| merge tag and send the user to a custom form where they choose their RSVP option, but ideally i want to bypass the form and handle the response using the buttons in the email body ONLY. Is this possible?
I am trying to import and sort data from a large excel report into a new file using Excel 2007 VBA. I have come up with two methods so far for doing this: Have Excel actually open the file (code below), gather all data into arrays and output the arrays onto new sheets in the same file and save/close it. Public Sub GetData() Dim FilePath As String FilePath = "D:\File_Test.xlsx" Workbooks.OpenText Filename:=FilePath, FieldInfo:=Array(Array(2, 2)) ActiveWorkbook.Sheets(1).Select End Sub Use ADO to get all data out of the closed workbook, import the whole datasheet into an array (code below) and s
I have an iframe inside Div in which i want to add video . I have added the URL path for the video correctly but not getting video on the screen neither i am getting any error on the browser console.Here is the HTML for the whole.. <div style="position:relative; width: 100%; height: 0; padding-bottom: 56.25%;"> <iframe width="420" height="315" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"> <video id='video-player' autoplay preload='metadata' controls> <source src="Video/Sapno.MP4" type="video/mp4"> </video> </iframe> </div> Please help
I have had some fairly good experiences with structural modelling in Verilog, but I barely have any with other modelling methods. So, kindly help me out. The code compiles fine, but when simulating, it just hangs. Nothing happens. If it is important, the code is a Montgomery Modular Multiplier. It is a bit above my academic level, but I have managed to understand the algorithm and write the code. Why won't the simulation run? module MMM42(A1,A2,B1,B2,N,S1,S2,clk); input clk; input [3:0]A1,A2,B1,B2,N; output [6:0]S1,S2; reg [3:0]a1,a2,b1,b2,n,bd1,bd2,d1,d2,w,y; reg [6:0]s1,s2,s11,s21,s12,s22; r
Recently I'm working on this little project with Java EE and I need to use derby database , but every time I go to service->Database and try to connect to my jdbc:derby I get this error : Unable to connect. Cannot establish a connection to jdbc:derby://localhost:1527//sample using org.apache.derby.jdbc.ClientDriver (java.netConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.). and this exception : Wed Oct 29 15:05:26 EET 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve") java.security.AccessControlExce
I have a requirement to produce within a Web API a service that will return a pdf of a local report viewer file. In MVC you can do something like this using FileResult but i'm struggling to replicate this as a HttpResponseMessage. Has anybody ever tried or had success in trying to do anything similar? All my attempts in trying toconvert the byte[] to a stream and then output as an HttpResponse have ended up with empty files. public FileResult File() { // Create a new dataset StudentDataSet ds = new StudentDataSet(); // Create and fill the Student data table // using the Student table adapter S
Given an iPython notebook running on an external server, is there a way to trigger a file download? I would like to either be able to have the notebook be able to initiate the download of a file living on the the external server to the where the notebook is being rendered locally, or perform a direct string dump from the notebook workspace into a text file, downloaded locally. I.E. a powerful and tool would be a Notebook that can query from a database, alter data, and download the query results as a CSV file. A quick experiment showed that a cell containing the following renders a link which d
I'm trying to display a column name as well as the data from that column, but can't because of the following error: Msg 402, Level 16, State 1, Line 5 The data types xml and varchar are incompatible in the add operator. Convert or Cast don't work in this instance. Code: select CUSTOMER_ID, CURRENCY, DELIVERY_METHOD, CASE WHEN (COURIER_TRACKING_XML) IS NOT NULL THEN dbo.GetXml(COURIER_TRACKING_XML) + 'Courier' END, CASE WHEN BILLING_ADDRESS IS NOT NULL THEN dbo.GetXml(BILLING_ADDRESS) + 'Billing' END, CASE WHEN DELIVERY_ADDRESS IS NOT NULL THEN dbo.GetXml(DELIVERY_ADDRESS) + 'Delivery' END from
I'm trying to use Oauth2 to access Analytics data. I successfully get authorization code from and change it for authorization token. But when I try to get any data from Analytics API I get 401 Invalid Credentials error. The code I'm using is from PHP client library: <?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once 'lib/API/Google_Client.php'; require_once 'lib/API/contrib/Google_AnalyticsService.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("APP name"); $client->setClientId('xxx.apps.googleusercontent.com'); $client->setClientSecret('
I am currently learning Python, and I decided to build a small "Guess the Number" type of game. I am using the random feature, and trying to make it so it will detect if the user's input is equal the the random number. This is my code: irand = randrange(1, 10) while True: number = input ("Pick a number 1-10: ") if number < irand: print (" ") print ("That's too high, try again.") if number > irand: print (" ") print ("That's too low, try again.") if number == irand: print (" ") print ("You got it right! You won!") break I am not exactly sure how to make it detect if number is equal to, less tha
I want to implement OnScrollListener to load more data, when scrolled to bottom, dynamically. Following code is giving me NullPointerException, but when I declare BusinessListDataAdapter adapter = new BusinessListDataAdapter(this, this.imgFetcher, this.layoutInflator, this.businesses); inside setBusiness, it doesn't show any error and works fine. Problem with this is when I scroll to the bottom of page it replaces current data in list view with new data but what I wanted is endless scrolling while appending new data instead of replacing so that I can view first data scrolling up import java.ut
How to configure Notepad++ to open files in a single instance when double click a text file from Windows Explorer? I'm using version 6.6.8. Old versions always open files in one single instance. I need to open many files and don't want open many windows. Thanks.
I am trying to create multiple processes from a same parent, but it always ended up with more processes than expected. I couldn't figure out how to do it and need some help here. I found a piece of code online and tried it, int main () { pid_t pid=0; int i=0; for (i=0; i<3; i++) { pid=fork(); switch(pid) { case 0: { cout<<"\nI am a child and my pid is:"<<getpid(); cout<<endl; exit(0); break; } default: { cout<<"\nI am a parent and my pid is: "<<getpid(); cout<<"\nMy child pid is: "<<pid; cout<<endl; wait(NULL); break; } } } return 0; } This code does work and creates 3 children from same paren