Search Results

Search found 72 results on 3 pages for 'radek'.

Page 3/3 | < Previous Page | 1 2 3 

  • Chrome extension Page Action JS

    - by Radek Šimko
    I'm trying to create an extension using this docs: http://code.google.com/chrome/extensions/content_scripts.html I want a part of JS code to run when document is ready (loaded). This is my manifest.json: { "name": "OwnExtension", "version": "0.1", "content_scripts": [ { "matches": ["https://my.site.eu/*"], "css": ["styles.css"], "js": ["main.js"] } ] } This is my main.js: alert(10); Am I doing sth wrong, that nothing happend when page https://my.site.eu/ loaded in browser?

    Read the article

  • Android App - disappearance of app GUI

    - by Radek Šimko
    I'm trying to create a simple app, whose main task is to open the browser on defined URL. I've created first Activity: public class MyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://my.url.tld")); startActivity(myIntent); } Here's my AndroidManifest.xml: <manifest ...> <application ...> <activity android:name=".MyActivity" ...> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> This code is fully functional, but before it opens the browser, it displays a black background - blank app GUI. I didn't figured out, how to go directly do the browser (without displaying the GUI). Anyone knows?

    Read the article

  • how to select posts by particular author? (wordpress)

    - by Radek
    I have a page with template No Sidebars I want to list 5 posts' titles on that page by author where the author's name = page's title any idea how to do so without using any plugin? I thought that query_posts function would do the trick but this important note kind of tells me that I cannot use query_posts

    Read the article

  • text-transform cannot change/be overwritten? (css)

    - by Radek
    I am studying css and I do not understand why some OTHER text and line 2 has red underline effect on them. I thought I either changed it for class others or reset it to none for class line2 I tried `text-decoration:none' for both .line2 and .others and the text was still red underlined. <html> <head> <style type="text/css"> .line {color:red; text-transform:uppercase; text-decoration:underline;} .line2 {color:blue; text-transform:none;} .others {color:black; text-transform:lowercase; text-decoration:blink; font-weight:bold;} </style> </head> <body> <div class='line'> line 1 <div class='others'><BR>some OTHER text<BR></DIV> <div class='line2'> <BR>line 2 </div> </div> </body> </html>

    Read the article

  • Pointer to local variable

    - by Radek Šimko
    May I have any acces to local variable in different function? If may, how? void replaceNumberAndPrint(int array[3]) { printf("%i\n", array[1]); printf("%i\n", array[1]); } int * getArray() { int myArray[3] = {4, 65, 23}; return myArray; } int main() { replaceNumberAndPrint(getArray()); } The output of the piece of code above: 65 4202656 What am i doing wrong? What the "4202656" means?? Do I have to copy the whole array in the replaceNumberAndPrint() function to be able to access to it more than first times?

    Read the article

  • undefined method `key?' for nil:NilClass when using MongoMapper

    - by Radek Slupik
    I set up a new Rails application by following these instructions. I generated a new controller and added resources :tickets to the routes file. Hexapoda::Application.routes.draw do resources :tickets end This is the controller (`/app/controllers/tickets_controller.rb'). class TicketsController < ApplicationController def index @tickets = Ticket.all end end I then added a new model Ticket in /app/models/ticket.rb. class Ticket include MongoMapper::Document key :summary, String, :required => true end Here's the view (/app/views/index.html.erb): <h1>Tickets#index</h1> <p>Find me in app/views/tickets/index.html.erb</p> Now when I go to /tickets in my browser, I get an error message. NoMethodError in TicketsController#index undefined method `key?' for nil:NilClass I have no idea what's going on. What could be the problem? I'm using Rails 3.2.5 and MongoMapper 0.11.1.

    Read the article

  • how can I change top-margin the right way if multiple css class assigned?

    - by Radek
    I assigned these classes menu second_menu menu_about_author to ul so the html code looks like <ul class="menu second_menu menu_about_author"> I wanted this ul to have the same properties like menu and second_menu and then I wanted to move the menu_about_author little bit down. I did so by .menu_about_author { margin-top:40px; } but it didn't work any idea why the margin-top:40px; is crossed? the link to the image is [1]: http://img153.imageshack.us/img153/882/58daeef0c3c846e4a8d6321.png

    Read the article

  • How can I reshape and aggregate list of tuples in Python?

    - by radek
    I'm a newb to Python so apologies in advance if my question looks trivial. From a psycopg2 query i have a result in the form of a list of tuples looking like: [(1, 0), (1, 0), (1, 1), (2, 1), (2, 2), (2, 2), (2, 2)] Each tuple represents id of a location where event happened and hour of the day when event took place. I'd like to reshape and aggregate this list with subtotals for each hour in each location, to a form where it looks like: [(1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 0), (2, 1, 1), (2, 3, 3)] Where each touple will now tell me that, for example: in location 1, at hour 0 there were 2 events; in location 1, at hour 1 there was 1 event; and so on... If there were 0 events at certain hour, I still would like to see it, as for example 0 events at 0 hours in location 2: (2, 0, 0) How could I implement it in Python?

    Read the article

  • Regular expressions in c++ STL

    - by Radek Šimko
    Is there any native library in STL which is tested and works without any extra compiler options? I tried to use <regex>, but the compiler outputs this: In file included from /usr/include/c++/4.3/regex:40, from main.cpp:5: /usr/include/c++/4.3/c++0x_warning.h:36:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

    Read the article

  • Get the newest file from directory structure year/month/date/time

    - by Radek
    I store backups of databases in a directory structure year/month/day/time/backup_name an example would be basics_mini/2012/11/05/012232/RATIONAL.0.db2inst1.NODE0000.20110505004037.001 basics_mini/2012/11/06/012251/RATIONAL.0.db2inst1.NODE0000.20110505003930.001 note that timestamp from the backup file cannot be used. Before the automation testing starts the server time is set to 5.5.2011 So the question is how I can get the latest file if I pass the "base directory" (basics_mini) to some function that I am going to code. My thoughts are that I list the base directory and sort by time to get the year. Then I do the same for month, day and time. I wonder if there is any "easier" solution to that in php.

    Read the article

  • how can I capture **http response** from twitter.com? ( ruby + twitter gem)

    - by Radek
    I opened a question how can I capture response from twitter.com? ( ruby + twitter gem) to know if my update was successful. It is working fine... But I would like to know how I can capture HTTP Response Codes and Errors oauth = Twitter::OAuth.new('consumer token', 'consumer secret') oauth.authorize_from_access('access token', 'access secret') client = Twitter::Base.new(oauth) response = client.update('Heeeyyyyoooo from Twitter Gem!')

    Read the article

  • how does Enumerable#cycle work? (ruby)

    - by Radek
    looper = (0..3).cycle 20.times { puts looper.next } can I somehow find the next of 3? I mean if I can get .next of any particular element at any given time. Not just display loop that starts with the first element. UPDATE Of course I went though ruby doc before posting my question. But I did not find answer there ...

    Read the article

  • next element is (current+1) or 0 (ruby)

    - by Radek
    I have an interval let's say (0..3) where next element is +1 unless the last. Then the next is 0. I solved it by the code below. Just wondering if there is anything else outhere :-) def next(max,current) if current+1 == max return 0 else return current+1 end end

    Read the article

  • Initialization of array on heap

    - by Radek Šimko
    How do i manually initiate values in array on heap? If the array is local variable (in stack), it can be done very elegant and easy way, like this: int myArray[3] = {1,2,3}; Unfortunately, following code int * myArray = new int[3]; myArray = {1,2,3}; outputs an error by compiling error: expected primary-expression before ‘{’ token error: expected `;' before ‘{’ token Do i have to use cycle, or not-so-much-elegant way like this? myArray[0] = 1; myArray[1] = 2; myArray[2] = 3;

    Read the article

  • can't get pingfm class work (ruby)

    - by Radek
    I have simple code from Ping.fm Ruby Client/Library require 'pingfm' pingfm = Pingfm::Client.new('api_key', 'user_app_key') but it gives me uninitialized constant Pingfm (NameError) pingfm gem is installed, just there was this error message Could not find main page README during installation. Any idea how I can get it work? I am using: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] pingfm (1.0.2)

    Read the article

  • process all links but external ones (ruby + mechanize)

    - by Radek
    I want to process all links but external ones from the whole web site. Is there any easy way how to identify that the link is external and skip it? My code looks so far like (the site url is passed through command line argument require 'mechanize' def process_page(page) puts puts page.title STDIN.gets page.links.each do |link| process_page($agent.get(link.href)) end end $agent = WWW::Mechanize.new $agent.user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4' process_page($agent.get(ARGV[0]))

    Read the article

  • How to find that 'runas' execution finished?

    - by Radek
    I use ruby 1.9.3p194 (2012-04-20) [i386-mingw32] on Windows7 To do mySQL backup I run runas /savecred /user:yogurt\administrator "cmd.exe /k mysqldump --user=#{dbuser} --password=#{dbpassword} #{dbname} > #{dump}" - mysqldump must be executed as administrator. I do not run my ruby scripts under administrator account. runas starts new cmd.exe and ruby doesn't wait for it to finish. Dump process takes about one minute to finish. After that I zip the dump file and delete it. But I have to make sure that the dump process already finished before I do any other action on that file. Right now I use sleep(60) that works but I wonder if there any better more systematic solution.

    Read the article

  • can I pass arguments to my function through add_action? (Wordpress)

    - by Radek
    can I do something like that? to pass arguments to my function? I already studied add_action doc but did not figure out how to do it. What the exact syntax to pass two arguments would look like. function recent_post_by_author($author,$number_of_posts) { some commands; } add_action('thesis_hook_before_post','recent_post_by_author',10,'author,2')

    Read the article

  • retrieve only sub-pages (wordpress)

    - by Radek
    I want to list all sub-pages only one level though of one particular page. I was reading Function Reference/get pages and thought that $pages = get_pages( array( 'child_of' => $post->ID, 'parent' => $post->ID)) ; will do the trick but it is not working. It lists all pages on the same level like the page I call that code from. If I omit parent option I will get all pages even with sub-pages that I want. But I want only sub-pages. The whole function is like function about_menu(){ if (is_page('about')){ $pages = get_pages( array( 'child_of' => $post->ID, 'parent' => $post->ID)) ; foreach($pages as $page) { ?> <h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2> <?php } } } and mine is second one

    Read the article

< Previous Page | 1 2 3