Daily Archives

Articles indexed Tuesday March 23 2010

Page 26/130 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • multiple background pics in css

    - by delboud
    this is what im trying to do... ul#newnav a{ /*--This is basically the hover state of navigation--*/ color: #555; background: url(images/a_bg.gif) repeat-x left bottom;} ul#newnav a{ background: url(images/navpic.png) no-repeat top left;} and of course its only loading the last one but is it anyway I can load both.

    Read the article

  • How to link a table to a field a in MySQL server

    - by Nek
    I have this data from a xml file: <?xml version="1.0" encoding="utf-8" ?> <words> <id>...</id> <word>...</word> <meaning>...</meaning> <translation> <ES>...</ES> <PT>...</PT> </translation> </words> This forms the table named "words", which has four fields ("id","word","meaning" and "translation"). On the other hand, the "translation" field can hold several languages like ES,PT,EN,JA,KO,etc... So I create a table ("words.translation", one field is "id" and the others ones are languages ids like "ES","PT",...). I'm sorry for this newby question, but I'd like to know a couple of things about this one-to-many relationship. How to join (or link?) this two tables in MySQL? What information does the "translation" field in the "words" table has to store? How is the sql query to get all the word information (JOIN syntax used?) Thanks for your patience.

    Read the article

  • C++ Variable declarable in function body, but not class member?

    - by anon
    I want to create a C++ class with the following type: It can be declared inside of a function. It can be declared inside of a member function. It can not be declared as a class member. The use of this: think "Root" objects for a GC. Is this possible in C++? In particular, I'm using g++. Willing to switch to clang. Either templates or macro solution fine. Thanks!

    Read the article

  • Run a PHP script every second using CLI

    - by Saif Bechan
    Hello, I have a dedicated server running Cent OS with a Parallel PLESK panel. I need to run a php script every second, that updates my database. These is no alternative way timewise, i have checked every method, it needs to be updated every second. I can find my script using the url: http://www.mysite.com/phpfile.php?key=123, and this has to be executed every second. Does anyone have any knowledge at all on doing this, i can not seem to find the answer. I heard about doing it with CLI and putty, but i have no knowledge of this at all. Or can this be done using the PLESK Panel? And can the file be executed locally every second. Like \phpfile.php If someone helps me on answering these question i would really appreciate it. Regards EDIT It has been a few months since i added this question. I ended up using the following code: #!/user/bin/php $start = microtime(true); set_time_limit(60); for (i = 0; i < 59; ++$i) { doMyThings(); time_sleep_until($start + $i + 1); } Thank you for this code guys! My cronjob is set to every minute. I have been running this for some time now in a test environment, and this works out great. It works really supperfast, and i see no increase in CPU nor Memory usage.

    Read the article

  • Send TAB to a child console (windows)

    - by alex2k8
    I create a child console application with _process = new Process(); _process.StartInfo.FileName = @"cmd.exe"; _process.StartInfo.UseShellExecute = false; _process.StartInfo.RedirectStandardInput = true; _process.StartInfo.RedirectStandardOutput = true; _process.StartInfo.CreateNoWindow = true; _proccess.Start(); Now I can go to c:\aaa _process.StandardInput.Write("cd c:\\aaa\xD\xA"); But normally user can type c:\ + TAB + ENTER. How can I do the same? This does not work: _process.StandardInput.Write("cd c:\\\0x9\xD\xA");

    Read the article

  • Excel formula for variable fields

    - by awais
    I am looking for a simple formula to do the calculation on two fields that are variable, for e.g., c1 has 100 and c3 has 150 and I want to calculate an increase/decrease percentage, but the trick is the cell values change every month. How do I put the formula to cater for such variation. Appreciate your help. Regards

    Read the article

  • Display X divs randomly out of a possible Y.

    - by Jordan
    How do I randomly display 3 divs out of a possible 10 in total? This is what I have tried so far: HTML: <div id="1">Content 1</div> <div id="2">Content 2</div> <div id="3">Content 3</div> <div id="4">Content 4</div> <div id="5">Content 5</div> <div id="6">Content 6</div> Javascript: function randomiseDiv() { // Define how many divs we have var divCount = 6; // Get our random ID (based on the total above) var randomId = Math.floor(Math.random()*divCount+1); // Get the div that's been randomly selectted var chosenDiv= document.getElementById(randomId); // If the content is available on the page if (chosenDiv) { // Update the display chosenDiv.style.display = 'block'; } } window.onload = randomiseDiv; I would prefer a PHP solution, although anything at this stage would be beneficial.

    Read the article

  • Ruby on Rails: How to sanitize a string for SQL when not using find and other built-in methods?

    - by williamjones
    I'm trying to sanitize a string that involves user input without having to resort to manually crafting my own possibly buggy regex if possible. There are a number of methods in Rails that can allow you to enter in native SQL commands, how do people escape user input for those? The question I'm asking is a broad one, but in my particular case, I'm working with a column in my Postgres database that Rails does not natively understand as far as I know, the tsvector, which holds plain text search information. Rails is able to write and read from it as if it's a string, however, unlike a string, it doesn't seem to be automatically escaping it when I do things like vector= inside the model. For example, when I do model.name='::', where name is a string, it works fine. When I do model.vector='::' it errors out: ActiveRecord::StatementInvalid: PGError: ERROR: syntax error in tsvector: "::" "vectors" = E'::' WHERE "id" = 1 This seems to be a problem caused by lack of escaping of the semicolons, and I can manually set the vector='\:\:' fine. I also had the bright idea, maybe I can just call something like: ActiveRecord::Base.connection.execute "UPDATE medias SET vectors = ? WHERE id = 1", "::" However, this syntax doesn't work, because the raw SQL commands don't have access to find's method of escaping and inputting strings by using the ? mark. This strikes me as the same problem as calling connection.execute with any type of user input, as it all boils down to sanitizing the strings, but I can't seem to find any way to manually call Rails' SQL string sanitization methods. Can anyone provide any advice?

    Read the article

  • iPad application - Using Dock within an application

    - by sagar
    Hello ! Every one. I am interested in development of iPad applications. I have seen iPad Demo from Apple site. There is one new functionality - which is dock in iPad. My Question is "Can we use our own Dock control ( as we have - Tab bar in iPhone ) in iPad application? " If Answer is yes - Then my other question is How? Thanks in advance for sharing your knowledge. Sagar

    Read the article

  • Code Generation(based on templates) for COCOA

    - by Vikas
    Hi, I have written a library for I-phone which is based upon some object models(whose definitions I get via XML). Now I have one implementation for a sample model ready but to make the code library generic I want to write an application where I can templatize the code and provide placeholders for data model specific points. Is there any tool available for Xcode to enable me do this. In java "Velocity" does this job for me. Regards, Vikas

    Read the article

  • wget return downloaded filename

    - by Matthew
    I'm using wget in a php script and need to get the name of the file downloaded. For example, if I try <?php system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/'); ?> I will get a file called index.html in the downloads directory. The page will not always be google though, so I need to find out the name of the file that was downloaded. I'd like to have something like this: <?php //Does not work: $filename = system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/'); //$filename should contain "index.html" ?>

    Read the article

  • What should I do in order to be able to work with maven + eclipse + wicket + hibernate + spring in M

    - by spderosso
    I want to create a web app that will use wicket, hibernate and spring frameworks. My IDE of choice is Eclipse, I am using maven for the .war generation and I am running Mac OS. What steps should I follow to correctly install and configure all the tools so as to have a project running that relies on these 3 frameworks. I was able to successfully set up wicket but I am having trouble for setting up hibernate and spring. I went through multiple tutorials but I still couldn't find the solution. Thanks!

    Read the article

  • Python overriding class (not instance) special methods

    - by André
    How do I override a class special method? I want to be able to call the __str__() method of the class without creating an instance. Example: class Foo: def __str__(self): return 'Bar' class StaticFoo: @staticmethod def __str__(): return 'StaticBar' class ClassFoo: @classmethod def __str__(cls): return 'ClassBar' if __name__ == '__main__': print(Foo) print(Foo()) print(StaticFoo) print(StaticFoo()) print(ClassFoo) print(ClassFoo()) produces: <class '__main__.Foo'> Bar <class '__main__.StaticFoo'> StaticBar <class '__main__.ClassFoo'> ClassBar should be: Bar Bar StaticBar StaticBar ClassBar ClassBar Even if I use the @staticmethod or @classmethod the __str__ is still using the built in python definition for __str__. It's only working when it's Foo().__str__() instead of Foo.__str__().

    Read the article

  • How can I quote strings in SASS?

    - by Stavros Korokithakis
    I'm using SASS to generate a @font-face mixin, however this: =remotefont(!name, !url) @font-face font-family = !name src = url(!url + ".eot") src = local(!name), url(!url + ".ttf") format("truetype") +remotefont("My font", "/myfont.ttf") becomes this: @font-face { font-family: My font; src: url(/myfont.ttf.eot); src: local(My font), url(/myfont.ttf.ttf) format(truetype); } No matter how much I try, I can't have it quote either "My font" (with "!name") or "truetype" (it removes the quotes). Any ideas on how I can do this?

    Read the article

  • How to create a demo version of my software in visual studio during MSI

    - by sijith
    How to create a 30 days evaluation software. Is there any possiblility to do this with MSI creation. It would be great if MSI installer package provides such in built facility, by which, application expiries after fixed trial period. If we going for custome action to do this by writing code, how can i do this. How to Write installation time in some file in installed path or in registry or both. Please give some sample of how to capture time during installation.

    Read the article

  • Unable to Access Zend Server 5 CE after installation

    - by jl
    I have previously installed WAMP on my windows, and now I am trying to install Zend Server 5 CE 5.3.1 Win x86. During the installation of Zend Server, there is a step asking about: web server port : 80 zend server interface port : 10081 I kept to the default. After the installation, I tried to access http://localhost,and is able to see zend test page. But I am unable to access http://localhost:10081/ZendServer, it was stated as page not found. Is it a conflict of my WAMP and the Zend Server? I remembered stopping the apache for WAMP, before trying to access ZS. Could anyone please advise me how to fix it? Thank you.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >