Search Results

Search found 341 results on 14 pages for 'andreas roth'.

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • Execute javascript in PHP

    - by Andreas Bonini
    I'm generating your typical Web 2.0 HTML page with PHP: it contains a lot of <script> tags and javascript code that will substantially change the DOM after the load event. Is there a way to get the final HTML code directly from PHP, without opening the page with any browser? For example, let's say the HTML for the page is (it's just an example): <html> <head> <script>...the jquery library code...</script> <script>$(document).ready(function() { $("body").append("<p>Hi!</p>");</script> </head> <body> </body> </html> This HTML is saved in the $html PHP variable. Now, I want to pass that variable to some function that will return $result = <html>....<body><p>Hi!</p></body></html>. Is this possible?

    Read the article

  • ScriptManager duplicates javascript

    - by Andreas
    Hi! I have a usercontrol that can be used in for example a gridview itemtemplate, this means that the control might or might not be on the page at page load. In the case where the control is inside an itemtemplate i will popupate the gridview via asyncronous postbacks (via updatepanels). The control itselfs registrers scriptblocks since it is depending on javascripts. First i used Page.ClientScript.RegistrerClientScriptBlock But this doesn't work on asyncronous postbacks (updatepanels) so i then tried the same using ScriptManager which allows me to registrer scripts on the page after async postbacks. great!. ScriptManager.RegisterClientScriptBlock However, ScriptManager (what i know of) does not have the functionallity to see if a script already is on the page, so i will for every postback generate duplicates of the script blocks, this is ofcourse unwanted behaviour. I did a run at Google and found that i can call the Dispose() method of the PageRequestManager can be used, this does work since it clears the scripts and then adding them again (this also solves my issue with removing unused script blocks from removed controls). Sys.WebForms.PageRequestManager.getInstance().Dispose() However, ofcourse there is a downside since im posting here :). The Dispose() method disposes the instance on the master page as well which leads to scripts running there will stop to function after an async postback (updateprogress for example). So, is there a way to check if a script already exists on the page using ScriptManager or any other tools, that will prevent me of inserting duplicate scripts? Also, is there a way to remove certain script blocks (when i am removing an item in itemtemplate for example). Big thanks in advance.

    Read the article

  • How to load an RSA key from binary data to an RSA structure using the OpenSSL C Library?

    - by Andreas Bonini
    Currently I have my private key saved in a file, private.key, and I use the following function to load it: RSA *r = PEM_read_RSAPrivateKey("private.key", NULL, NULL, NULL); This works perfectly but I'm not happy with the file-based format; I want to save my key in pure binary form (ie, no base64 or similar) in a char* variable and load/save the key from/to it. This way I have much more freedom: I'll be able to store the key directly into the application const char key[] { 0x01, 0x02, ... };, send it over a network socket, etc. Unfortunately though I haven't found a way to do that. The only way to save and load a key I know of reads/saves it to a file directly.

    Read the article

  • add several variables to dataframe, based on vector

    - by Andreas
    I am sure this is easy - but I can't figure it out right now. Basically: I have a long vector of variables: names <- c("first","second", "third") I have some data, and I now need to add the variables. I could do: data$first <- NA But since I have a long list, and I would like an automated solution. This doesn't work. for (i in 1:length(names)) (paste("data$", names[i],sep="") <- NA) The reason I want this, is that I need to vertically merge to dataframes, where one doesn't have all the variables it should have. Thanks in advance

    Read the article

  • Reading an embedded file from an ASP.NET Custom Server Control an rendering it

    - by Andreas Grech
    I currently have a file "abc.htm" in my Custom Server Control Project and it's Build Action is set to Embedded Resource. Now in the RenderContents(HtmlTextWriter output) method, I need to read that file and render it on the website. I am trying the following but it's to no avail: protected override void RenderContents(HtmlTextWriter output) { var providersURL = Page.ClientScript.GetWebResourceUrl(typeof (OpenIDSel), "OpenIDSelector.Providers.htm"); var fi = new FileInfo(providersURL); // <- exception here //the remaining code is to possibly render the file } This is an example of how the providersURL is: /WebResource.axd?d=kyU2OiYu6lwshLH4pRUCUmG-pzI4xDC1ii9u032IPWwUzMsFzFHzL3veInwslz8Y0&t=634056587753507131 FileInfo is throwing System.ArgumentException: Illegal characters in path.

    Read the article

  • Writing to the middle of the file (without overwriting data)

    - by Andreas Bonini
    In windows is it possible through an API to write to the middle of a file without overwriting any data and without having to rewrite everything after that? If it's possible then I believe it will obviously fragment the file; how many times can I do it before it becomes a serious problem? If it's not possible what approach/workaround is usually taken? Re-writing everything after the insertion point becomes prohibitive really quickly with big (ie, gigabytes) files. Note: I can't avoid having to write to the middle. Think of the application as a text editor for huge files where the user types stuff and then saves. I also can't split the files in several smaller ones.

    Read the article

  • How to declare a function that accepts a lambda?

    - by Andreas Bonini
    I read on the internet many tutorials that explained how to use lambdas with the standard library (such as std::find), and they all were very interesting, but I couldn't find any that explained how I can use a lambda for my own functions. For example: int main() { int test = 5; LambdaTest([&](int a) { test += a; }); return EXIT_SUCCESS; } How should I declare LambdaTest? What's the type of its first argument? And then, how can I call the anonymous function passing to it - for example - "10" as its argument?

    Read the article

  • Beginners question: Variable in Javascript

    - by Andreas
    Hello everybody! I'm new to javascript and cant get this little thing to work. (all external scripts a of course loaded) I have this jQuery script: $('a.Link').click(function(){ autoComp('City'); }); function autoComp(strFormName) { var Company = 'Adobe Apple Microsoft'.split(" "); var City = 'London Paris Berlin'.split(" "); $('#'+strFormName).autocomplete(strFormName) } I cant get it to work. I've discovered that the problem is the last "strFormName" after .autocomplete Appreciate all the help I can get.

    Read the article

  • How to structure a database with questions and answers?

    - by Andreas Johannessen
    Hi I am going to make a simple application that uses a database. I could need some guidance on how to structure it. I shall make question program. What I have in mind is. One table with questions One table with the difficulity of the question One table with the category of the question However, what do I do with the answers? Have them as seperate columns in the question-table? It sounds like a bad practice.(Also, where do I have the correct answer) Each question will have 5 answers where only one of them is correct.

    Read the article

  • tomcat session replication without multicast

    - by Andreas Petersson
    i am planning to use 2 dedicated root servers rented at a hosting provider. those machines will run tomcat 6 in a cluster. if i will add additional machines later on - it is unlikely that they will be accessible with multicast, because they will be located in different subnets. is it possible to run tomcat without multicast? all tutorials for tomcat 6 clustering include multicast heartbeat. are there any alternatives to SimpleTcpCluster? or are other alternatives more appropriate in this situation?

    Read the article

  • Catching errors in ANTLR and finding parent

    - by Andreas
    I have found out that I can catch errors during parsing by overwriting displayRecognitionError, but how do I find the parent "node" of this error? ex. if I have the grammar: prog: stat expr; stat: STRING; expr: INTEGER; And give it the input "abc def". Then I will get an error at "def" which should be an integer. At this point I then want to get the parent which is "expr" (since it fails inside the INTEGER part) and it's parent "prog". Kind of like printing stack trace in java. I tried to look at the node from RecognitionException parsed to displayRecognitionError, but it is null, and using CommonErrorNode the parent is null. Should I maybe take a completely different approach?

    Read the article

  • Session is null when inherit from System.Web.UI.Page

    - by Andreas K.
    I want to extend the System.Web.UI.Page-class with some extra stuff. In the ctor I need the value of a session-variable. The problem is that the Session-object is null... public class ExtendedPage : System.Web.UI.Page { protected foo; public ExtendedPage() { this.foo = (int)HttpContext.Current.Session["foo"]; // NullReferenceException } } If I move the part with the session-object into the Load-Event everything works fine... public class ExtendedPage : System.Web.UI.Page { protected foo; public ExtendedPage() { this.Load += new EventHandler(ExtendedPage_Load); } void ExtendedPage_Load(object sender, EventArgs e) { this.foo = (int)HttpContext.Current.Session["foo"]; } } Why is the Session-object null in the first case??

    Read the article

  • Increasing nesting in sub headings with LaTeX

    - by Andreas Grech
    The following is an example of what I currently have: \setcounter{secnumdepth}{3} \chapter{The Chapter} \section{First Section} \subsection{First sub Section} \subsubsection{First sub sub Section} which renders something like this: Chapter 1 The Chapter 1.1 First Section 1.1.1 First Sub Section 1.1.1.1 First sub sub Section Now unfortunately in LaTeX, I can only go down to a subsubsection (1.1.1.1) but I need to be able to go down further...for example, something like this 1.1.2.1.3. Are there any commands that will allow me to do this?

    Read the article

  • SQL statement HAVING MAX(some+thing)=some+thing

    - by Andreas
    I'm having trouble with Microsoft Access 2003, it's complaining about this statement: select cardnr from change where year(date)<2009 group by cardnr having max(time+date) = (time+date) and cardto='VIP' What I want to do is, for every distinct cardnr in the table change, to find the row with the latest (time+date) that is before year 2009, and then just select the rows with cardto='VIP'. This validator says it's OK, Access says it's not OK. This is the message I get: "you tried to execute a query that does not include the specified expression 'max(time+date)=time+date and cardto='VIP' and cardnr=' as part of an aggregate function." Could someone please explain what I'm doing wrong and the right way to do it? Thanks

    Read the article

  • Simple string parsing with C++

    - by Andreas Brinck
    I've been using C++ for quite a long time now but nevertheless I tend to fall back on scanf when I have to parse simple text files. For example given a config like this (also assuming that the order of the fields could vary): foo: [3 4 5] baz: 3.0 I would write something like: char line[SOME_SIZE]; while (fgets(line, SOME_SIZE, file)) { int x, y, z; if (3 == sscanf(line, "foo: [%d %d %d]", &x, &y, &z)) { continue; } float w; if (1 == sscanf(line, "baz: %f", &w)) { continue; } } What's the most concise way to achieve this in C++? Whenever I try I end up with a lot of scaffolding code.

    Read the article

  • clicking a button via javascript does not cause a postback

    - by Andreas Niedermair
    hi there! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.js"></script> </head> <body> <form id="fooForm"> <script type="text/javascript"> function FooMethod() { alert('hello'); } var fooButton; var fooForm; $(document).ready(function() { InitializeVariables(); InitiliazeDialog(); InitiliazeForm(); }); function InitializeVariables() { fooButton = $('#fooButton'); fooForm = $('#fooForm'); } function InitiliazeDialog() { var dialog = $('<div/>'); dialog.css('display', 'none'); var content = $('<p/>'); var icon = $('<span/>'); icon.addClass('ui-icon ui-icon-alert'); icon.css('float', 'left'); icon.css('margin', '0px 7px 20px 0px'); content.text('do you really want to hurt me?'); icon.prependTo(content); content.appendTo(dialog); var dialogOpenMethod = function () { dialog.dialog('open'); return false; }; var dialogOpenHandlerMethod = function (event, ui) { var widget = dialog.dialog('widget'); widget.appendTo(fooForm); var overlay = widget.prev(); overlay.css('z-index', 999); overlay.appendTo(fooForm); widget.css('position', 'fixed'); widget.css('top', '50%'); widget.css('margin-top', widget.height() / 2 * -1); widget.css('left', '50%'); widget.css('margin-left', widget.width() / 2 * -1); }; var submitMethod = function () { dialog.dialog('option', 'closeOnEscape', false); var widget = dialog.dialog('widget'); var yesButton = $(':button:eq(0)', widget); var noButton = $(':button:eq(1)', widget); var closeButton = $('a.ui-dialog-titlebar-close', widget); noButton.remove(); closeButton.remove(); fooButton.unbind('click', dialogOpenMethod); fooButton.click(); }; dialog.dialog({ autoOpen: false, modal: true, buttons: { 'Ja': submitMethod, 'Nein': function () { dialog.dialog('close'); } }, open: dialogOpenHandlerMethod }); fooButton.bind('click', dialogOpenMethod); } function InitiliazeForm() { fooButton.button(); fooForm.submit(function () { alert('doing a submit'); }); } </script> <input type="submit" id="fooButton" value="submit it!" onclick="FooMethod();"></input> </form> </body> </html> what am i doing? i want a modal-confirmation: user clicks on button, confirmation "do you really want to...?", user clicks "yes", this click unbinds the original click-handler and clicks the button again (which should cause a submit). what/why is not working? indeed you need a special case. this demo won't work, unless you set modal: false. interesting to mention: the original handler (onclick="FooMethod();") is called in modal and non-modal dialog. can anybody help me out? thanks in advance!

    Read the article

  • PHP exec() not executing batch files

    - by Andreas Bonini
    I tried googling for this issue and found many people with the same problem but no solution. $result = exec("C:\\Ruby191\\bin\\lessc.bat less\\$file", $output); Here result is an empty string and output an empty array. Same thing with: $result = exec("cmd /c C:\\Ruby191\\bin\\lessc.bat less\\$file", $output); I am sure the path is correct; I am sure exec() is enabled. I tried exec, shell_exec, system and none work. lessc is less CSS.

    Read the article

  • Read some content of a resource on internet

    - by Andreas Johannessen
    Hi For my iPhone application I need to read some content of a plain html file on the web. It's just some text within a pre-tag. However I don't want to download the whole file and then get the line I need. The format is: TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText I only need the first line and then close the connection to that resource. Thanks in advance.

    Read the article

  • A programming language for teaching data structures and algorithms with? [closed]

    - by Andreas Grech
    Possible Duplicate: Choice of programming language for learning data structures and algorithms Teachers have different opinions on what programming language they would choose to teach data structures and algorithms with. Some would prefer a lower level language such as C because it allows the student to learn more about what goes on beyond the abstractions in terms of memory allocation and deallocation and pointers and pointer arithmetic. On the other hand, others would say that they would prefer a higher level language like Java because it allows the student to learn more about the concepts of the structures and the algorithm design rather than 'waste time' and fiddle around with memory segmentation faults and all the blunders that come with languages where memory management is manual. What is your take on this issue? And also, please post any references you may know of that also discuss this argument.

    Read the article

  • transferring subversion changes between linux and windows

    - by andreas buykx
    Hi all, What is the best way to transfer changes that include new and deleted directories and/or new and deleted (actually moved) files in those directories from a subversion repository on linux to windows? I do my developments on linux using a subversion repository, but I have to test my changes on windows as well. My windows machine has a tortoisesvn repository which I tried to patch with a svn diff output. This failed miserably since my patch contains a renamed (i.e. deleted and added under a different name) directory, a new directory and the files in there. Do I do things wrong by just applying the svn diff output as a patch in tortoisesvn? For now I think that my best option is to have the windows tree on the same svn version as the linux tree and just copy the entire changed directory over the existing directory. Would that work?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >