Search Results

Search found 3612 results on 145 pages for '1 21 gigawatts'.

Page 29/145 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Facebook insights for websites does not match on-site Facebook button counts

    - by Will
    I use Facebook Insights for websites and Facebook buttons on my site. However, the data reported by the two do not match. It always seems to be the case that the count reported by the buttons is significantly higher than the count reported in Facebook Insights. For example, this page http://www.appmyworld.com/blog/top-5-iphone-and-ipad-apps-of-the-week-10412.html has a count of 52 for Facebook which is made up of 19 likes, 21 shares and 12 comments according to AddThis and confirmed by http://sharedcount.com However, going into Facebook Insights for my website and looking at that specific page it shows only 4 total actions which is made up of 1 like and 3 shares. At the very least I would expect it to show a total count of 40 made up of 19 likes and 21 shares (I'm not sure it would track the 12 comments). Any thoughts on why this may be happening? My concern is if our website is not getting credit for the Facebook activity?

    Read the article

  • JQuery's Contains returns an Object?

    - by Abs
    Hello all, I am trying to see if a particular string appears in a div. I have tried but it doesn't return true or false which is what I thought contains did? if($("#path"+i+"_status:contains('!=')")){ alert($("#path"+i+"_status:contains('!=')")); //alerts - [object object] return true; } Here is my HTML: <div class="status" id="path3_status"> <img height="21" align="absmiddle" src="images/valid.jpg">Text File (3000) = Source Table (3000)<img height="21" align="top" src="images/info.jpg" " id="img_path3"> <a onclick="clear_file('TI004OBAE', 'path3');" href="#">Clear</a> </div> What am I doing wrong. How can I find out if a div contains the string "!="? Thanks all for any help

    Read the article

  • php foreach getting values from an array

    - by sea_1987
    I am having trouble accessing the values in an array, the array looks like this, Array ( [0] => Array ( [id] => 1661 [code] => 849651318 [job_status] => 4 [looking_for] => Lorem ipsum [keywords_education] => Derby University [sector_id_csv] => 10,21,9,22,26 [last_job_title_1] => Programmer [last_job_employer_1] => HBOS [city] => Bury [expected_salary_level] => LEVEL_2 [education_level] => COLLEGE [job_looking_for] => [is_contract] => Y [is_permanent] => N [is_temporary] => Y ) ) Array ( [0] => Array ( [id] => 402 [code] => 849650059 [job_status] => 3 [looking_for] => Lorem ipsum [keywords_education] => Paris College [sector_id_csv] => 27,22,19,21,12 [last_job_title_1] => Programmer [last_job_employer_1] => HSBC [city] => Bury [expected_salary_level] => LEVEL_2 [education_level] => COLLEGE [job_looking_for] => [is_contract] => N [is_permanent] => Y [is_temporary] => Y ) ) Array ( [0] => Array ( [id] => 1653 [code] => 849651310 [job_status] => 3 [looking_for] => Lorem ipsum [keywords_education] => Crewe University [sector_id_csv] => 27,15,19,21,24 [last_job_title_1] => Programmer [last_job_employer_1] => ICI [city] => Bury [expected_salary_level] => LEVEL_2 [education_level] => UNIVERSITY [job_looking_for] => [is_contract] => N [is_permanent] => Y [is_temporary] => Y ) ) I am trying to get the values out, I have tried doing the following, foreach ($result as $rslt) { echo $rslt->id; } I have also tried, foreach ($result as $rslt) { $rslt['id']; } But none of this works, I dont know why, can anyone help?

    Read the article

  • COUNT issue across multiple tables

    - by Kim
    I am trying to count across 2 tables and I dont see whats wrong with my query yet I get a wrong result. User 2 does not exist in table_two, so the zero is correct. SELECT t1.creator_user_id, COUNT(t1.creator_user_id), COUNT(t2.user_id) FROM table_one AS t1 LEFT JOIN table_two AS t2 ON t2.user_id = t1.creator_user_id GROUP BY t1.creator_user_id, t2.user_id Actual result 1 192 192 2 9 0 Expected result 1 16 12 2 9 0 The result indicate a missing group by condition, but I already got both fields used. Where am I wrong ? Also, can I sum up all users that doesnt exist in table_two for t1 ? Like user 3 exists 21 times in t1, then the results would be: 1 16 12 (users with > 0 in t2 will need their own row) 2 30 0 (user 2=9 + user 3=21 => 30) Its okay for the user Id to be wrong for sum of t1 for all users with 0 in t2. If not possible, then I'll just do two queries.

    Read the article

  • plot only x and y axis (no box) in ggplot2

    - by Tyler Rinker
    The convention of some journals is to show only the x and y axis in a plot not a box around the entire plot area. How can I achieve this in ggplot2? I tried theme_minimal_cb_L from HERE but it seems to erase the entire box around the plot (does not leave the x and y axis) as seen here: Here's the code I'm using: dat <- structure(list(x = c(0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3), y1 = c(34, 30, 26, 23, 21, 19, 17, 16, 15, 13, 12, 12, 11), y2 = c(45, 39, 34, 31, 28, 25, 23, 21, 19, 17, 16, 15, 14)), .Names = c("x", "y1", "y2"), row.names = c(NA, -13L), class = "data.frame") library(reshape2); library(ggplot2) dat2 <- melt(dat, id='x') theme_minimal_cb_L <- function (base_size = 12, base_family = "", ...){ modifyList (theme_minimal (base_size = base_size, base_family = base_family), list (axis.line = element_line (colour = "black"))) } ggplot(data=dat2, aes(x=x, y=value, color=variable)) + geom_point(size=3) + geom_line(size=.5) + theme_minimal_cb_L()

    Read the article

  • Python: how to run several scripts (or functions) at the same time under windows 7 multicore processor 64bit

    - by Gianni
    sorry for this question because there are several examples in Stackoverflow. I am writing in order to clarify some of my doubts because I am quite new in Python language. i wrote a function: def clipmyfile(inFile,poly,outFile): ... # doing something with inFile and poly and return outFile Normally I do this: clipmyfile(inFile="File1.txt",poly="poly1.shp",outFile="res1.txt") clipmyfile(inFile="File2.txt",poly="poly2.shp",outFile="res2.txt") clipmyfile(inFile="File3.txt",poly="poly3.shp",outFile="res3.txt") ...... clipmyfile(inFile="File21.txt",poly="poly21.shp",outFile="res21.txt") I had read in this example Run several python programs at the same time and i can use (but probably i wrong) from multiprocessing import Pool p = Pool(21) # like in your example, running 21 separate processes to run the function in the same time and speed my analysis I am really honest to say that I didn't understand the next step. Thanks in advance for help and suggestion Gianni

    Read the article

  • How to use PHP fgetcsv to create an array for each piece of data in csv file?

    - by Olivia
    I'm trying to import data from a csv file to some html code to use it in a graph I have already coded. I'm trying to use PHP and fgetcsv to create arrays for each separate piece of data to use PHP to put it into the html code. I know how to open the csv file and to print it using PHP, and how to print each separate row, but not each piece of data separated by a comma. Is there a way to do this? If this helps, this is the csv data I am trying to import. May 10,72,12,60 May 11,86,24,62 May 12,67,32,34 May 13,87,12,75 May 14,112,23,89 May 17,69,21,48 May 18,98,14,84 May 19,115,18,97 May 20,101,13,88 May 21,107,32,75 I hope that makes sense.

    Read the article

  • No method error in controller create action

    - by user2799827
    I have read a number of Q&As on SO in search of some help on this but have so far not solved my issue. I am trying to teach myself ruby/rails, and as a test project, I want to create a list of tvshows and a list of characters where each tvshow has_many characters and each character belongs_to a specific show. I am sure I am doing something basic incorrectly. Any assistance would be greatly appreciated. here is the characters controller: class CharactersController < ApplicationController before_action :set_character, only: [:show, :edit, :update, :destroy] # GET /characters # GET /characters.json def index @characters = Character.all end # GET /characters/1 # GET /characters/1.json def show end # GET /characters/new def new @character = Character.new end # GET /characters/1/edit def edit end # POST /characters # POST /characters.json def create @character = @tvshow.characters.create(params[:character]) respond_to do |format| if @character.save format.html { redirect_to @character, notice: 'Character was successfully created.' } format.json { render action: 'show', status: :created, location: @character } else format.html { render action: 'new' } format.json { render json: @character.errors, status: :unprocessable_entity } end end end # PATCH/PUT /characters/1 # PATCH/PUT /characters/1.json def update respond_to do |format| if @character.update(character_params) format.html { redirect_to @character, notice: 'Character was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @character.errors, status: :unprocessable_entity } end end end # DELETE /characters/1 # DELETE /characters/1.json def destroy @character.destroy respond_to do |format| format.html { redirect_to characters_url } format.json { head :no_content } end end private # Use callbacks to share common setup or constraints between actions. def set_character @character = Character.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. def character_params params.require(:character).permit(:first_name, :last_name, :bio) end end character model: class Character < ActiveRecord::Base belongs_to :tvshow default_scope -> { order('created_at DESC') } validates :tvshow_id, presence: true end tvshow model: class Tvshow < ActiveRecord::Base has_many :characters, dependent: :destroy end error gets returned when I attempt to create a character. here is the full trace: app/controllers/characters_controller.rb:27:in `create' actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action' actionpack (4.0.0) lib/abstract_controller/base.rb:189:in `process_action' actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:in `process_action' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in `block in process_action' activesupport (4.0.0) lib/active_support/callbacks.rb:413:in `_run__1211653665462320621__process_action__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:in `process_action' actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in `process_action' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action' activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument' activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument' activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action' actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in `process_action' activerecord (4.0.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action' actionpack (4.0.0) lib/abstract_controller/base.rb:136:in `process' actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in `process' actionpack (4.0.0) lib/action_controller/metal.rb:195:in `dispatch' actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' actionpack (4.0.0) lib/action_controller/metal.rb:231:in `block in action' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:in `call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call' rack (1.5.2) lib/rack/etag.rb:23:in `call' rack (1.5.2) lib/rack/conditionalget.rb:35:in `call' rack (1.5.2) lib/rack/head.rb:11:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context' rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call' activerecord (4.0.0) lib/active_record/query_cache.rb:36:in `call' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call' activerecord (4.0.0) lib/active_record/migration.rb:369:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__2792846465963916895__call__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app' railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged' railties (4.0.0) lib/rails/rack/logger.rb:21:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' rack (1.5.2) lib/rack/runtime.rb:17:in `call' activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call' railties (4.0.0) lib/rails/engine.rb:511:in `call' railties (4.0.0) lib/rails/application.rb:97:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' rack (1.5.2) lib/rack/content_length.rb:14:in `call' rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' /Users/dariusgoore/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /Users/dariusgoore/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /Users/dariusgoore/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

    Read the article

  • automatically downloading and installing an exe file

    - by dbphydb
    I need to automate the process of downloading and installing an exe file abc.exe from say 'http://10.34.45.21:8080/cruisecontrol/artifacts/xxx_trunk_nightly_build/xxx/test/' I mean now i have to manually goto ''http://10.34.45.21:8080/cruisecontrol' then click on each folder before i finally click on the abc.exe file. Then it downloads the exe on my machine. Then i have to double click on the exe to install it. I want to automate this whole process such that when i run the script it will automatically download the exe file and install it. Is it possible to do this using php? I am very much a beginner. Any help will be of use.

    Read the article

  • Row/column counter in 'apply' functions

    - by mortalitysequence
    What if one wants to apply a functon i.e. to each row of a matrix, but also wants to use as an argument for this function the number of that row. As an example, suppose you wanted to get the n-th root of the numbers in each row of a matrix, where n is the row number. Is there another way (using apply only) than column-binding the row numbers to the initial matrix, like this? test <- data.frame(x=c(26,21,20),y=c(34,29,28)) t(apply(cbind(as.numeric(rownames(test)),test),1,function(x) x[2:3]^(1/x[1]))) P.S. Actually if test was really a matrix : test <- matrix(c(26,21,20,34,29,28),nrow=3) , rownames(test) doesn't help :( Thank you.

    Read the article

  • Unable to get set intersection to work

    - by chavanak
    Sorry for the double post, I will update this question if I can't get things to work :) I am trying to compare two files. I will list the two file content: File 1 File 2 "d.complex.1" "d.complex.1" 1 4 5 5 48 47 65 21 d.complex.10 d.complex.10 46 6 21 46 109 121 192 192 TI am trying to compare the contents of the two file but not in a trivial way. I will explain what I want with an example. If you observe the file content I have typed above, the d.complex.1 of file_1 has "5" similar to d.complex.1 in file_2; the same d.complex.1 in file_1 has nothing similar to d.complex.10 in file_2. What I am trying to do is just to print out those d.complex. which has nothing in similar with the other d.complex. Consider the d.complex. as a heading if you want. But all I am trying is compare the numbers below each d.complex. and if nothing matches, I want that particular d.complex. from both files to be printed. If even one number is present in both d.complex. of both files, I want it to be rejected. My Code: The method I chose to achieve this was to use sets and then do a difference. Code I wrote was: first_complex=open( "file1.txt", "r" ) first_complex_lines=first_complex.readlines() first_complex_lines=map( string.strip, first_complex_lines ) first_complex.close() second_complex=open( "file2.txt", "r" ) second_complex_lines=second_complex.readlines() second_complex_lines=map( string.strip, second_complex_lines ) second_complex.close() list_1=[] list_2=[] res_1=[] for line in first_complex_lines: if line.startswith( "d.complex" ): res_1.append( [] ) res_1[-1].append( line ) res_2=[] for line in second_complex_lines: if line.startswith( "d.complex" ): res_2.append( [] ) res_2[-1].append( line ) h=len( res_1 ) k=len( res_2 ) for i in res_1: for j in res_2: print i[0] print j[0] target_set=set ( i ) target_set_1=set( j ) for s in target_set: if s not in target_set_1: if s[0] != "d": print s The above code is giving an output like this (just an example): d.complex.1.dssp d.complex.1.dssp 1 48 65 d.complex.1.dssp d.complex.10.dssp 46 21 109 What I would like to have is: d.complex.1 d.complex.1 (name from file2) d.complex.1 d.complex.10 (name from file2) I am sorry for confusing you guys, but this is all that is required. I am so new to python so my concept above might be flawed. Also I have never used sets before :(. Can someone give me a hand here?

    Read the article

  • impossible to install Framework 3.5

    - by yae
    Hi few days ago I formatted one of my computers (XP Home SP2 with prior updates installed). Now I am trying to install NET Framework 3.5, but display this error: [03/21/10,17:19:36] Microsoft .NET Framework 2.0a: [2] Error: Installation failed for component Microsoft .NET Framework 2.0a. MSI returned error code 1603 [03/21/10,17:20:17] WapUI: [2] DepCheck indicates Microsoft .NET Framework 2.0a is not installed. Already i have tried this to try solve this issue, but the problem persists. 1.- unistall all frameworks and reinstall from scratch 2.- clean all temps file and reinstall from scratch 3.- unistall and clean all frameworks with dotnetfx cleanup tool and reinstall from scratch 4.- install .NET Framework 3.5 full package But all these possibles solutions have failed. Any idea to solve this? Thanks in advance

    Read the article

  • How to change the date format in JavaScript?

    - by Nitz
    Hey Guys I am using one jquery date picker, with using picker i am getting date in like this format Friday, May 21, 2010 Now i want to add one day in this date so i think, i can only do if i change the date in exact format like 21/5/2010 I want to only convert that bcz i want to add one day to the particular date. So what do u suggest me? How can I do that? Can i do without converting it ? thanks in advance....

    Read the article

  • How to handle date difference between client and server?

    - by daydreamer
    I have an API which looks like /summary/yyyy/mm Which returns the summary of their data for the year and month requested. One of the things it returns the number of days left if this is current year and month. For example: days_left: 9 for 2013 and 10 and current date on server is 21 Oct 2013 How I calculate remaining days? This is implemented in python as def current_financial_month_details(self): time_from, time_to = self \ .get_start_end_time_current_financial_month() today = datetime.today() from_time = datetime(year=today.year, month=today.month, day=today.day) return { 'time_from': time_from, 'time_to': time_to, 'remaining_days': (time_to - from_time).days } The problem? The server is in east coast and the client(me with browser) is on pacific time zone When its 9PM PST the time changes in east coast, so if I run hit /summary/2013/10 and if it is Oct 21 2013 for me on PST, the date has already changed on EST, so days_left: 8 which is incorrect on client end. right? How do I handle this situation?

    Read the article

  • dynimically using pointer

    - by gcc
    Input: 3 1 2 n 4 5 d 1 21 30 x Output: 2: 4 5 21 30 Input: 3 j 3 34 6 22 10 51 n 1 2 j 1 3 4 5 n 6 7 x Output: 1: 1 2 3 4 5 2: 6 7 3: 34 6 22 10 51 'j': (Jump to array# command) 'd': (Delete array# command) 'n': (Next array command) 'x': (Exit command) #: (Integer number) int num_arrays; /* maximum number of arrays */ int **arrays; /* array of array pointers */ int *l_arrays; /* actual lengths of arrays */ int *c_arrays; /* actual capacities of arrays */ how can we write that code

    Read the article

  • error when trying to import ps file by grImport in R

    - by lokheart
    I need to create a pdf file with several chart created by ggplot2 arranged in a A4 paper, and repeat it 20-30 times. I export the ggplot2 chart into ps file, and try to PostScriptTrace it as instructed in grImport, but it just keep giving me error of "Unrecoverable error, exit code 1". I ignore the error and try to import and xml file generated into R object, give me another error: attributes construct error Couldn't find end of Start Tag text line 21 Premature end of data in tag picture line 3 Error: 1: attributes construct error 2: Couldn't find end of Start Tag text line 21 3: Premature end of data in tag picture line 3 What's wrong here? Thanks!

    Read the article

  • Codeigniter - selecting children and parents from db

    - by Tomek Buszewski
    I want to pull from my database records corresponding to parent_id, like this: function getChildren($id, $parent_id) { $q = $this->db->select('id, name, slug, plat'); $q = $this->db->from('games'); $q = $this->db->where('parent_id',$id); $q = $this->db->or_where('id',$parent_id); $q = $this->db->get(); return $q->result_array(); } It - if it's a children game - get parent_id and search for a game with such id and for other games that has parent_id same as this one. If it's the parent game, it only looks for games with parent_id same as it's id. The problem is... it's not always working. I have four games in db: id | parent_id | title 15 | 0 | Abe 19 | 15 | Abe 20 | 0 | RE2 21 | 20 | RE2 DS First two works, last two - only children (id = 21) shows parent.

    Read the article

  • Spring noHandlerFound

    - by Justin
    I am trying to set up my Spring MVC testing environment. But I always get this noHandlerFound error: Aug 21, 2014 4:43:25 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/firstPage] in DispatcherServlet with name 'spring' Aug 21, 2014 4:47:21 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/firstPage2] in DispatcherServlet with name 'spring' Aug 21, 2014 5:10:27 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/index.html] in DispatcherServlet with name 'spring' I already searched for solution, but none can fix my problem. My spring mvc version: 3.1.3.RELEASE This is my web.xml: <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext.xml </param-value> </context-param> this is my spring-servlet.xml: <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /> this is my applicationContext.xml: <context:annotation-config /> <context:component-scan base-package="test.spring" /> <mvc:annotation-driven /> <mvc:resources mapping="/index.html" location="/index.html" /> <mvc:view-controller path="/firstPage" /> This is my Controller: package test.spring; .... @Controller @RequestMapping("/") public class FirstController { @RequestMapping(value = "firstPage2", method = RequestMethod.GET) public String showFirstPage(Map<String,Object> model){ return "firstPage"; } } My server is tomcat 7, there is no error and warning when it is deployed. I also tried this with no luck: <mvc:default-servlet-handler/> Before I start Spring MVC, I can access index.html

    Read the article

  • Split string on first two colons

    - by Mark Miller
    I would like to split a column of strings on the first two colons, but not on any subsequent colons: my.data <- read.table(text=' my.string some.data 12:34:56:78 -100 87:65:43:21 -200 a4:b6:c8888 -300 11:bb:ccccc -400 uu:vv:ww:xx -500', header = TRUE) desired.result <- read.table(text=' my.string1 my.string2 my.string3 some.data 12 34 56:78 -100 87 65 43:21 -200 a4 b6 c8888 -300 11 bb ccccc -400 uu vv ww:xx -500', header = TRUE) I have searched extensively and the following question is the closest to my current dilemma: Split on first comma in string Thank you for any suggestions. I prefer to use base R.

    Read the article

  • ftp php file uploadin

    - by Issak
    <?php ini_set('max_execution_time', '0'); $host = '234.546.155.485'; $usr = 'fgfgfgdf'; $pwd = 'fghghh'; // file to move: $file = 'http://vsomesite.com/file.flv'; $ftp_path = '/public_html/video57242/test.flv'; // connect to FTP server (port 21) $conn_id = ftp_connect($host, 21) or die ("Cannot connect to host"); // send access parameters ftp_login($conn_id, $usr, $pwd) or die("Cannot login"); // turn on passive mode transfers (some servers need this) // ftp_pasv ($conn_id, true); // perform file upload $upload = ftp_put($conn_id, $ftp_path, $local_file, FTP_ASCII); // check upload status: print (!$upload) ? 'Cannot upload' : 'Upload complete'; ?> upload fails when the file is remote not local. what problem?

    Read the article

  • What does the R function `poly` really do?

    - by merlin2011
    I have read through the manual page ?poly (which I admit I did not completely comphrehend) and also read the description of the function in book Introduction to Statistical Learning. My current understanding is that a call to poly(horsepower, 2) should be equivalent to writing horsepower + I(horsepower^2). However, this seems to be contradicted by the output of the following code. library(ISLR) summary(lm(mpg~poly(horsepower,2), data=Auto))$coef summary(lm(mpg~horsepower+I(horsepower^2), data=Auto))$coef Output: Estimate Std. Error t value Pr(>|t|) (Intercept) 23.44592 0.2209163 106.13030 2.752212e-289 poly(horsepower, 2)1 -120.13774 4.3739206 -27.46683 4.169400e-93 poly(horsepower, 2)2 44.08953 4.3739206 10.08009 2.196340e-21 Estimate Std. Error t value Pr(>|t|) (Intercept) 56.900099702 1.8004268063 31.60367 1.740911e-109 horsepower -0.466189630 0.0311246171 -14.97816 2.289429e-40 I(horsepower^2) 0.001230536 0.0001220759 10.08009 2.196340e-21 My question is, why does the output not match, and what is poly really doing?

    Read the article

  • Nginx + Nagios : 502 Bad gateway

    - by MrROY
    I have a fully new install nagios, but I can't access to it. Here's my Nginx config: server{ listen 80; server_name 61.148.45.10; # blahblah # Nagios Monitoring location /nagios3/ { proxy_pass http://127.0.0.1:80; } } Nagios is installed step by step(From this Linode guide): sudo apt-get install -y nagios3 Then I try to visit http://ip-address/nagios3/, but it shows 502 bad gateway. How do I deal with this ? This is my /var/log/syslog: Oct 25 14:18:17 my-server nagios3: SERVICE ALERT: localhost;Disk Space;WARNING;SOFT;1;DISK WARNING - free space: /boot 43 MB (20% inode=99%): Oct 25 14:19:07 my-server nagios3: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;1;HTTP WARNING: HTTP/1.1 403 Forbidden - 319 bytes in 0.000 second response time Oct 25 14:19:17 my-server nagios3: SERVICE ALERT: localhost;Disk Space;WARNING;SOFT;2;DISK WARNING - free space: /boot 43 MB (20% inode=99%): Oct 25 14:20:07 my-server nagios3: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;2;HTTP WARNING: HTTP/1.1 403 Forbidden - 319 bytes in 0.000 second response time Oct 25 14:20:17 my-server nagios3: SERVICE ALERT: localhost;Disk Space;WARNING;SOFT;3;DISK WARNING - free space: /boot 43 MB (20% inode=99%): Oct 25 14:21:07 my-server nagios3: SERVICE ALERT: localhost;HTTP;WARNING;SOFT;3;HTTP WARNING: HTTP/1.1 403 Forbidden - 319 bytes in 0.000 second response time Oct 25 14:21:17 my-server nagios3: SERVICE ALERT: localhost;Disk Space;WARNING;HARD;4;DISK WARNING - free space: /boot 43 MB (20% inode=99%): Oct 25 14:21:17 my-server nagios3: SERVICE NOTIFICATION: root;localhost;Disk Space;WARNING;notify-service-by-email;DISK WARNING - free space: /boot 43 MB (20% inode=99%): Oct 25 14:21:17 my-server postfix/pickup[24474]: 4F89F394034C: uid=109 from=<nagios> Oct 25 14:21:17 my-server postfix/cleanup[27756]: 4F89F394034C: message-id=<20131025062117.4F89F394034C@my-server> Oct 25 14:21:17 my-server postfix/qmgr[24475]: 4F89F394034C: from=<nagios@[email protected]>, size=594, nrcpt=1 (queue active) Oct 25 14:21:17 my-server postfix/local[27758]: 4F89F394034C: to=<root@localhost>, relay=local, delay=0.15, delays=0.11/0/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox) Oct 25 14:21:17 my-server postfix/qmgr[24475]: 4F89F394034C: removed Oct 25 14:22:07 my-server nagios3: SERVICE ALERT: localhost;HTTP;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 403 Forbidden - 319 bytes in 0.000 second response time Oct 25 14:22:07 my-server nagios3: SERVICE NOTIFICATION: root;localhost;HTTP;WARNING;notify-service-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden - 319 bytes in 0.000 second response time Oct 25 14:22:07 my-server postfix/pickup[24474]: 219CA3940381: uid=109 from=<nagios> Oct 25 14:22:07 my-server postfix/cleanup[27756]: 219CA3940381: message-id=<20131025062207.219CA3940381@my-server> Oct 25 14:22:07 my-server postfix/qmgr[24475]: 219CA3940381: from=<nagios@[email protected]>, size=605, nrcpt=1 (queue active) Oct 25 14:22:07 my-server postfix/local[27758]: 219CA3940381: to=<root@localhost>, relay=local, delay=0.12, delays=0.07/0/0/0.05, dsn=2.0.0, status=sent (delivered to mailbox) Oct 25 14:22:07 my-server postfix/qmgr[24475]: 219CA3940381: removed Oct 25 14:39:01 my-server CRON[28242]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete) And there're lot of 127.0.0.1 visit in nginx log, but I actually visit from a external ip: 127.0.0.1 - - [25/Oct/2013:14:21:02 +0800] "GET /nagios3/ HTTP/1.0" 502 575 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/3 0.0.1599.69 Safari/537.36" 127.0.0.1 - - [25/Oct/2013:14:21:02 +0800] "GET /nagios3/ HTTP/1.0" 502 575 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/3 0.0.1599.69 Safari/537.36" 127.0.0.1 - - [25/Oct/2013:14:21:02 +0800] "GET /nagios3/ HTTP/1.0" 502 575 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/3 0.0.1599.69 Safari/537.36"

    Read the article

  • Roaming user profile issues on Server 2008

    - by Alicia White
    I thought I cleared a user's profile from 2008, but it keeps coming back. So, I was looking for the best way to clear a roaming profile in Server 2008, but I have been unable to find anything. But, I did see the post here: http://serverfault.com/questions/18724/user-profile-keeps-loading-temp-profile I wanted to add a comment to that post, but it was closed as not being related to sysadmin. But, I think it IS related because I dealt with precisely this same problem on our Wndows 2008 terminal server. Here was the issue: we have a user who was getting an "unable to load your roaming profile" type of error at logon in Windows 2008. Looking at the server, we could see her temp profile listed in the profile list while she was loggged (listed as a "temporary" and not a "roaming" profile). While she was logged on, a folder called C:\Users\Temp.DOMAIN existed in the users folder, but that disappeared as soon as she logged out. When this thing happened in 2003, we would clear the contents of the roaming profile folder & delete the temp folder in C:\Documents and Settings. The thing is, 2008 behaves a bit differently. Server 2008 created a new roaming profile folder in the roaming profile folder share: \SERVER\ProfileShare\UserName.V2 The local profile disappears from the profile list in System Properties, so there is no profile to clear Also the local profile folder, C:\Users\Temp.DOMAIN doesn't stay on the server when the user logs out, so we can't delete that as we would normally do when this sort of thing happens in Windows 2003 Despite all of this, every time the user logs back on, the frickin' Temp profile always comes back. One of my team-mates, who is much more experienced with 2008, said I should check the registry for the user's profile in this key (the users are listed by SID): HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList I saw the user's SID listed there, but it ended in .BAK. I checked several other servers where she is having the same profile errors: in all cases, her SID ended with .BAK. For example (xxx replacing the LONG SID): HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-xxxxx-xxxx.bak On the server she was logged on to, there were two keys for her profile in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-xxxxx-xxxx and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-xxxxx-xxxx.bak So, here is how I cleared up the issue. I had the user log off. I deleted the apparently bad profiles ending in .BAK from the ProfileList key on each server where it appeared. I made sure her roaming profile folder was empty I made sure that all the TEMP profile folders were gone The user logged back on: no more profile errors! Anyway, I wanted to make a comment on that closed question, but I didn't see any way to re-open the question so I could add it. But, I also would like to know if this is the best practice to clear out a bad roaming profile for Server 2008? I'm having a hard time finding any instructions on line on how best to do this, but this method I used seemed to work. I'd like to find some documentation to give to our Level 1 support staff so they will know how to clear user profiles on 2008 since this seems to be more involved that clearing user profiles in server 2003. Thanks, Alicia

    Read the article

  • Sometimes this script fails to update the iptables

    - by AlJo
    It does not happen often, but sometimes after running the below script, checking the iptables with service iptables status shows that they weren't updated and the script doesn't output any error. The iptables is structured as look-up tree (long repeated sections snipped): #!/bin/sh iptables -t nat -F iptables -t nat -X iptables -F iptables -X iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -s 93.225.0.0/16 -j ACCEPT iptables -A INPUT -s 15.102.0.0/16 -j ACCEPT iptables -A INPUT -s 47.122.0.0/16 -j ACCEPT iptables -N MY_CHAIN_L1-0 iptables -N MY_CHAIN_L1-1 iptables -N MY_CHAIN_L1-2 iptables -N MY_CHAIN_L1-3 iptables -N MY_CHAIN_L1-4 iptables -N MY_CHAIN_L1-5 iptables -N MY_CHAIN_L1-6 iptables -N MY_CHAIN_L1-7 iptables -N MY_CHAIN_L1-8 iptables -N MY_CHAIN_L1-9 iptables -N MY_CHAIN_L1-10 iptables -N MY_CHAIN_L1-11 iptables -N MY_CHAIN_L1-12 iptables -N MY_CHAIN_L1-13 iptables -N MY_CHAIN_L1-14 iptables -N MY_CHAIN_L1-15 iptables -N MY_CHAIN_L1-16 iptables -N MY_CHAIN_L1-17 iptables -N MY_CHAIN_L1-18 iptables -N MY_CHAIN_L1-19 iptables -N MY_CHAIN_L1-20 iptables -N MY_CHAIN_L1-21 iptables -N MY_CHAIN_L1-22 iptables -N MY_CHAIN_L1-23 iptables -N MY_CHAIN_L1-24 iptables -N MY_CHAIN_L1-25 iptables -N MY_CHAIN_L1-26 iptables -N MY_CHAIN_L1-27 iptables -N MY_CHAIN_L1-28 iptables -N MY_CHAIN_L1-29 iptables -N MY_CHAIN_L1-30 iptables -N MY_CHAIN_L1-31 iptables -N MY_CHAIN_L1-32 iptables -N MY_CHAIN_L1-33 iptables -N MY_CHAIN_L1-34 iptables -N MY_CHAIN_L1-35 iptables -N MY_CHAIN_L1-36 iptables -N MY_CHAIN_L1-37 iptables -A INPUT -m iprange --src-range 1.54.96.0-5.133.179.255 -j MY_CHAIN_L1-0 iptables -A INPUT -m iprange --src-range 5.133.180.0-24.113.159.255 -j MY_CHAIN_L1-1 [snip] iptables -A INPUT -m iprange --src-range 195.13.45.0-198.11.255.255 -j MY_CHAIN_L1-29 iptables -A INPUT -m iprange --src-range 198.12.64.0-199.19.215.255 -j MY_CHAIN_L1-30 iptables -A INPUT -m iprange --src-range 199.21.96.0-200.31.3.255 -j MY_CHAIN_L1-31 iptables -A INPUT -m iprange --src-range 200.31.11.0-202.171.255.255 -j MY_CHAIN_L1-32 iptables -A INPUT -m iprange --src-range 203.130.134.192-206.212.255.255 -j MY_CHAIN_L1-33 iptables -A INPUT -m iprange --src-range 206.214.64.0-211.155.95.255 -j MY_CHAIN_L1-34 iptables -A INPUT -m iprange --src-range 212.19.128.0-216.176.191.255 -j MY_CHAIN_L1-35 iptables -A INPUT -m iprange --src-range 216.189.0.0-218.23.255.255 -j MY_CHAIN_L1-36 iptables -A INPUT -m iprange --src-range 218.30.96.0-223.255.231.255 -j MY_CHAIN_L1-37 iptables -A MY_CHAIN_L1-0 -s 1.54.96.0/20 -j DROP iptables -A MY_CHAIN_L1-0 -s 1.208.0.0/12 -j DROP iptables -A MY_CHAIN_L1-0 -s 1.224.0.0/11 -j DROP [snip] iptables -A MY_CHAIN_L1-0 -s 5.133.178.0/23 -j DROP iptables -A MY_CHAIN_L1-0 -j ACCEPT iptables -A MY_CHAIN_L1-1 -s 5.133.180.0/22 -j DROP iptables -A MY_CHAIN_L1-1 -s 5.135.0.0/16 -j DROP iptables -A MY_CHAIN_L1-1 -s 5.153.232.0/21 -j DROP [snip] iptables -A MY_CHAIN_L1-1 -s 24.113.128.0/19 -j DROP iptables -A MY_CHAIN_L1-1 -j ACCEPT . . . iptables -A MY_CHAIN_L1-29 -s 195.13.45.0/24 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.20.224.0/19 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.31.216.0/26 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.58.245.0/24 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.60.164.0/23 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.60.240.0/22 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.62.10.0/23 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.110.30.0/23 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.154.0.0/16 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.190.13.0/24 -j DROP iptables -A MY_CHAIN_L1-29 -s 195.211.152.0/22 -j DROP iptables -A MY_CHAIN_L1-1 -j ACCEPT [snip more of same to end of script] Can anyone see why this script would silently fail to update the iptables sometimes? Maybe it's not the script? Thanks

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >