Search Results

Search found 9122 results on 365 pages for 'dynamic scripting'.

Page 24/365 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Dynamic SQL to query an Adventureworks table

    - by salvationishere
    I am trying to see a list of tables from Adventureworks DB from "Person" schema in Sql Server 2008. I developed teh following SP, but after running it as follows it gives me error "Incorrect syntax near ')'". Do you know how I can revise this SP or exec statement? CREATE PROCEDURE [getTableNames] @SchemaName VARCHAR(50) AS BEGIN SET NOCOUNT ON; SET @SchemaName = 'PERSON' DECLARE @cmd AS VARCHAR(max) SET @SchemaName = RTRIM(@SchemaName) SET @cmd = N'SELECT TABLE_NAME ' + 'FROM information_schema.Tables ' + 'WHERE TABLE_TYPE = ''BASE TABLE'' AND TABLE_SCHEMA = @SchemaName' END exec sp_executesql getTableNames, N'@SchemaName NVARCHAR(50), @SchemaName'

    Read the article

  • PHP Dynamic Breadcrumb, small modification

    - by Adrian M.
    Hello, I got this code from someone and it works very well, I just want to remove the link from the last element of the array: //get rid of empty parts $crumbs = array_filter($crumbs); $result = array(); $path = ''; foreach($crumbs as $crumb){ $path .= '/' . $crumb; $name = ucfirst(str_replace(array(".php","_"),array(""," "), $crumb)); $result[] = "<a href=\"$path\">$name</a>"; } print implode(' > ', $result); This will output for example: Content Common File I just want a to remove the link from the last item - "File" to be just plain text.. I tried myself to count the array items and then if the array item is the last one then to print as plain text the last item.. but I'm still noob, I haven't managed to get a proper result.. Thank you!

    Read the article

  • XCode: How to adress dynamic Variables?

    - by Markus S.
    I want to do something like that: for (v=1;v=150;v++) { for (h=1; h=250;v++) { tile_0%i_0%i.image = [UIImage imageWithData:tmp_content_of_tile]; //1st %i = v; 2nd %i = h } } In the %i should be inserted the current value of "v" or "h"? Is it possible? How is it called? Greets!

    Read the article

  • Dynamic adding of usercontrols not showing control on page

    - by Phil
    I am trying to insert a user control dynamically into my default.aspx page via the following method in the page_init: Dim control As UserControl = LoadControl("~\Modules\Content.ascx") Controls.Add(control) When I run the page there is no sign of the usercontrol. Am I using the correct code to insert the usercontrol? Is there an alternative method of insertion available? Does the fact that the usercontrol has a page_load make a difference? Do I need to register the control in my aspx page at design time? Thanks in advance for any assistance you can offer.

    Read the article

  • Dynamic typed language example using ANTLR

    - by wvd
    Hey all, I'm looking for some ANTLR examples, I tried googling a bit but I found certain things which didn't fit my requirments. I found the Mantra project, but it's statically typed and is 'too' big for me at this moment, then I found 'pie' as interpreter, which is dynamically typed, which what I want, but it uses a syntax-directed interpreter. I'm looking for a pretty small language which is dynamically typed and uses AST's if possible. It doesn't need to be advanced, if it would have classes I would already be very happy. Thanks, William van Doorn

    Read the article

  • Dynamic inheritance/implementation in PHP 5.*

    - by Rolf
    Hi everyone, I'm implementing a Logger, based on a XML declaration (path to class, method name, custom log message). There is also a Logger interface that defines the function __call, the latter logs what's needed and then relays the call to the target method. The only difficulty is to make each class, declared in the XML file, implement this interface with __call. So finally my question: is there a way to set at runtime the parent class or the implemented interface of another class ? Thanks in advance ! Rolf

    Read the article

  • Deleting a non-owned dynamic array through a pointer

    - by ayanzo
    Hello all, I'm relatively novice when it comes to C++ as I was weened on Java for much of my undergraduate curriculum (tis a shame). Memory management has been a hassle, but I've purchased a number books on ansi C and C++. I've poked around the related questions, but couldn't find one that matched this particular criteria. Maybe it's so obvious nobody mentions it? This question has been bugging me, but I feel as if there's a conceptual point i'm not utilizing. Suppose: char original[56]; cstr[0] = 'a'; cstr[1] = 'b'; cstr[2] = 'c'; cstr[3] = 'd'; cstr[4] = 'e'; cstr[5] = '\0'; char *shaved = shavecstr(cstr); delete[] cstrn; where char* shavecstr(char* cstr) { size_t len = strlen(cstr); char* ncstr = new char[len]; strcpy(ncstr,cstr); return ncstr; } In that the whole point is to have 'original' be a buffer that fills with characters and routinely has its copy shaved and used elsewhere. To prevent leaks, I want to free up the memory held by 'shaved' to be used again after it passes through some arguments. There is probably a good reason for why this is restricted, but there should be some way to free the memory as by this configuration, there is no way to access the original owner (pointer) of the data.

    Read the article

  • Dynamic Selectors with Jquery with php while loop

    - by Anders Kitson
    I have a while loop which creates a list of anchor tags each with a unique class name counting from 1 to however many items there are. I would like to change a css attriubute on a specific anchor tag and class when it is clicked so lets say the background color is changed. Here is my code while($row = mysql_fetch_array($results)){ $title = $row['title']; $i++; echo "<a class='$i'>$title</a> } I would like my jquery to look something like this, it is obviously going to be more complicated than this I am just confused as where to start. $(document).ready(function() { $('a .1 .2 .3 .4 and so on').click(function() { $('a ./*whichever class was clicked*/').css('background':'red'); }); });

    Read the article

  • Creating SQL table using Dynamic variable name

    - by megatoast
    I want to create backup SQL tables using variable names. something along the lines of DECLARE @SQLTable Varchar(20) SET @SQLTable = 'SomeTableName' + ' ' + '20100526' SELECT * INTO quotename(@SQLTable) FROM SomeTableName but i'm getting Incorrect syntax near '@SQLTable'. It's just part of a small script for maintence so i don't have to worry about injections.

    Read the article

  • Django FormWizard with dynamic forms

    - by krys
    I want to implement a simple 2 part FormWizard. Form 1 will by dynamically generated something like this: class BuyAppleForm(forms.Form): creditcard = forms.ChoiceField(widget = forms.RadioSelect) type = forms.ChoiceField(widget = forms.RadioSelect) def __init__(self,*args, **kwargs): user = kwargs['user'] del kwargs['user'] super(BuyAppleForm, self).__init__(*args, **kwargs) credit_cards = get_credit_cards(user) self.fields['creditcard'].choices = [(card.id,str(card)) for card in credit_cards] apple_types= get_types_packages() self.fields['type'].choices = [(type.id,str(type)) for type in apple_types] This will dynamically create a form with lists of available choices. My second form, I actually want no input. I just want to display a confirmation screen containing the credit card info, apple info, and money amounts (total, tax, shipping). Once user clicks OK, I want the apple purchase to commence. I was able to implement the single form way by passing in the request.user object in the kwargs. However, with the FormWizard, I cannot figure this out. Am I approaching the problem wrong and is the FormWizard not the proper way to do this? If it is, how can the Form __init__ method access the user object from the HTTP request?

    Read the article

  • Find a dynamic added tag with javascript

    - by Jake
    I am trying to see how to find a tag that was added dynamically within a table as so: ParentTag= document.getElementById('parentdiv'); var newTag = document.createElement('div'); newTag.innerHTML="<span class="ImNew"></span>" ParentTag.appendChild(newTag); How will I be able to find that tag in javascript, not leaning towards using jquery so no live recommendations please.. Trying to find that new tag in strictly javascript.

    Read the article

  • Javascript: Dynamic Check box (Fieldset with Father/Child Checkboxes)

    - by BoDiE2003
    I have a problem here, when I select any of the 'father' checkboxes all the child checkboxes are getting enabled or disabled. So I need each father checkbox to affect it own child fieldset. Could someone help me with this. Thank you <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>toggle disabled</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> .cssDisabled { color: #ccc; } </style> <script src="http://prototypejs.org/assets/2009/8/31/prototype.js" type="text/javascript"> </script> <script type="text/javascript"> Event.observe(window, 'load', function(){ // for all items in the group_first class $$('.father').each(function(chk1){ // watch for clicks chk1.observe('click', function(evt){ dynamicCheckbox(); }); dynamicCheckbox(); }); }); function dynamicCheckbox (){ // count how many of group_first are checked, // doEnable true if any are checked var doEnable = ($$('.father:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label $$('.child').each(function(item){ if (doEnable) { item.enable().up('label').removeClassName('cssDisabled'); } else { item.disable().up('label').addClassName('cssDisabled'); } }); }; </script> </head> <body> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="1" class="father" />Check box 1</label><br /> <label><input type="checkbox" value="2" class="father" checked/>Check box 2</label> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="3" class="father" />Check box 1</label><br /> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> </body> </html>

    Read the article

  • parentNode.parentNode.rowindex to delete a row in a dynamic table

    - by billy85
    I am creating my rows dynamically when the user clicks on "Ajouter". <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> function getXhr(){ var xhr = null; if(window.XMLHttpRequest) // Firefox and others xhr = new XMLHttpRequest(); else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { // XMLHttpRequest not supported by your browser alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } return xhr } /** * method called when the user clicks on the button */ function go(){ var xhr = getXhr() // We defined what we gonna do with the response xhr.onreadystatechange = function(){ // We do somthing once the server's response is OK if(xhr.readyState == 4 && xhr.status == 200){ //alert(xhr.responseText); var body = document.getElementsByTagName("body")[0]; // Retrieve <table> ID and create a <tbody> element var tbl = document.getElementById("table"); var tblBody = document.createElement("tbody"); var row = document.createElement("tr"); // Create <td> elements and a text node, make the text // node the contents of the <td>, and put the <td> at // the end of the table row var cell_1 = document.createElement("td"); var cell_2 = document.createElement("td"); var cell_3 = document.createElement("td"); var cell_4 = document.createElement("td"); // Create the first cell which is a text zone var cell1=document.createElement("input"); cell1.type="text"; cell1.name="fname"; cell1.size="20"; cell1.maxlength="50"; cell_1.appendChild(cell1); // Create the second cell which is a text area var cell2=document.createElement("textarea"); cell2.name="fdescription"; cell2.rows="2"; cell2.cols="30"; cell_2.appendChild(cell2); var cell3 = document.createElement("div"); cell3.innerHTML=xhr.responseText; cell_3.appendChild(cell3); // Create the fourth cell which is a href var cell4 = document.createElement("a"); cell4.appendChild(document.createTextNode("[Delete]")); cell4.setAttribute("href","javascrit:deleteRow();"); cell_4.appendChild(cell4); // add cells to the row row.appendChild(cell_1); row.appendChild(cell_2); row.appendChild(cell_3); row.appendChild(cell_4); // add the row to the end of the table body tblBody.appendChild(row); // put the <tbody> in the <table> tbl.appendChild(tblBody); // appends <table> into <body> body.appendChild(tbl); // sets the border attribute of tbl to 2; tbl.setAttribute("border", "1"); } } xhr.open("GET","fstatus.php",true); xhr.send(null); } </head> <body > <h1> Create an Item </h1> <form method="post"> <table align="center" border = "2" cellspacing ="0" cellpadding="3" id="table"> <tr><td><b>Functionality Name:</b></td> <td><b>Description:</b></td> <td><b>Status:</b></td> <td><input type="button" Name= "Ajouter" Value="Ajouter" onclick="go()"></td></tr> </table> </form> </body> </html> Now, I would like to use the href [Delete] to delete one particular row. I wrote this: <script type="text/javascript"> function deleteRow(r){ var i=r.parentNode.parentNode.rowIndex; document.getElementById('table').deleteRow(i); } </script> When I change the first code like this: cell4.setAttribute("href","javascrit:deleteRow(this);"); I got an error: The page cannot be displayed. I am redirected to a new pagewhich can not be displayed. How could I delete my row by using the function deleteRow(r)? table is the id of my table Thanks. Billy85

    Read the article

  • dynamic dashboard interface

    - by user208081
    I want to create an interface similar to the following in Silverlight. http://demos6.dundas.com/Silverlight/ I need to create a dashboard where different elements can be re-arranged using Silverlight. The dashboard elements can be different usercontrols that in turn may contain charts, guages, grids...... The user should be able to dynamically add and remove dashboard elements. The user should also be able to use drag and drop to reposition the dashboard elements. If there are some code samples to get me started, that will be great as we are just starting out on some Silverlight development. Thanks, Pratik

    Read the article

  • Emulating Dynamic Dispatch in C++ based on Template Parameters

    - by Jon Purdy
    This is heavily simplified for the sake of the question. Say I have a hierarchy: struct Base { virtual int precision() const = 0; }; template<int Precision> struct Derived : public Base { typedef Traits<Precision>::Type Type; Derived(Type data) : value(data) {} virtual int precision() const { return Precision; } Type value; }; I want a function like: Base* function(const Base& a, const Base& b); Where the specific type of the result of the function is the same type as whichever of first and second has the greater Precision; something like the following pseudocode: template<class T> T* operation(const T& a, const T& b) { return new T(a.value + b.value); } Base* function(const Base& a, const Base& b) { if (a.precision() > b.precision()) return operation((A&)a, A(b.value)); else if (a.precision() < b.precision()) return operation(B(a.value), (B&)b); else return operation((A&)a, (A&)b); } Where A and B are the specific types of a and b, respectively. I want f to operate independently of how many instantiations of Derived there are. I'd like to avoid a massive table of typeid() comparisons, though RTTI is fine in answers. Any ideas?

    Read the article

  • Simple dynamic memory allocation bug.

    - by M4design
    I'm sure you (pros) can identify the bug's' in my code, I also would appreciate any other comments on my code. BTW, the code crashes after I run it. #include <stdlib.h> #include <stdio.h> #include <stdbool.h> typedef struct { int x; int y; } Location; typedef struct { bool walkable; unsigned char walked; // number of times walked upon } Cell; typedef struct { char name[40]; // Name of maze Cell **grid; // 2D array of cells int rows; // Number of rows int cols; // Number of columns Location entrance; } Maze; Maze *maz_new() { int i = 0; Maze *mazPtr = (Maze *)malloc(sizeof (Maze)); if(!mazPtr) { puts("The memory couldn't be initilised, Press ENTER to exit"); getchar(); exit(-1); } else { // allocating memory for the grid mazPtr->grid = (Cell **) malloc((sizeof (Cell)) * (mazPtr->rows)); for(i = 0; i < mazPtr->rows; i++) mazPtr->grid[i] = (Cell *) malloc((sizeof (Cell)) * (mazPtr->cols)); } return mazPtr; } void maz_delete(Maze *maz) { int i = 0; if (maz != NULL) { for(i = 0; i < maz->rows; i++) free(maz->grid[i]); free(maz->grid); } } int main() { Maze *ptr = maz_new(); maz_delete(ptr); getchar(); return 0; } Thanks in advance.

    Read the article

  • Dynamic Form Help for PHP and MySQL

    - by Tony
    The code below works as far as inserting records from a file into MySQL, but it only does so properly if the columns in the file are already ordered the same way as in the database. I would like for the user to be able to select the drop down the corresponds to each column in their file to match it up with the columns in the database (the database has email address, first name, last name). I am not sure how to accomplish this. Any ideas? <?php $lines =file('book1.csv'); foreach($lines as $data) { list($col1[],$col2[],$col3[]) = explode(',',$data); } $i = count($col1); if (isset($_POST['submitted'])) { DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'csvimport'); // Make the connection: $dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); for($d=1; $d<$i; $d++) { $q = "INSERT into contacts (email, first, last) VALUES ('$col3[$d]', '$col1[$d]', '$col2[$d]')"; $r = @mysqli_query ($dbc, $q); } } echo "<form action =\"handle2.php\" method=\"post\">Email<br /> <select name =\"email\"> <option value='col1'>$col1[0]</option> <option value='col2'>$col2[0]</option> <option value='col3'>$col3[0]</option> </select><br /><br /> First Name <br /> <select name=\"field2\"> <option value='col1'>$col1[0]</option> <option value='col2'>$col2[0]</option> <option value='col3'>$col3[0]</option> </select><br /><br /> Last Name <br /> <select name=\"field3\"> <option value='col1'>$col1[0]</option> <option value='col2'>$col2[0]</option> <option value='col3'>$col3[0]</option> </select><br /><br /> <input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"hidden\" name=\"submitted\" value=\"TRUE\" /> </form>"; ?>

    Read the article

  • Dynamic charts at runtime in SSRS

    - by BALAMURUGAN
    I need to create a report(rdl) in SQL reporting services 2008. In that I need to create in runtime. The report has chart. I will specify the type of chart, font, alignment and all those stuff in runtime. Is there any option for using this in SSRS 2008.

    Read the article

  • RegEx for Dynamic URL Goals settings in Google Analytics

    - by gaaustralia
    Hi, I have tried to work this regex to set up a goal in GA for 2 days, but I cannot get my head around it... The url format is like this: /purchase.php?cDd=1&transaction_id=xxxxxxx&verify=xxxxxxxxxxxxxxxx=&method=creditcard&type=purchase transaction_id= is populated with a sept of numbers verify= is populated by a string of numbers, letters in both caps and lower case Basically I would like to only match URLs which finish by "&method=creditcard&type=purchase" I have tried to just put &method=creditcard&type=purchase but it does retrieve other URLs too Would anyone has any ideas

    Read the article

  • Dynamic expression tree how to

    - by Savvas Sopiadis
    Hello everybody! Implemented a generic repository with several Methods. One of those is this: public IEnumerable<T> Find(Expression<Func<T, bool>> where) { return _objectSet.Where(where); } Given to be it is easy to call this like this: Expression<Func<Culture, bool>> whereClause = c => c.CultureId > 4 ; return cultureRepository.Find(whereClause).AsQueryable(); But now i see (realize) that this kind of quering is "limiting only to one criteria". What i would like to do is this: in the above example c is of type Culture. Culture has several properties like CultureId, Name, Displayname,... How would i express the following: CultureId 4 and Name.contains('de') and in another execution Name.contains('us') and Displayname.contains('ca') and .... Those queries should be created dynamically. I had a look in Expression trees (as i thought this to be a solution to my problem - btw i never used them before) but i cannot find anything which points to my requirement. How can this be costructed? Thanks in advance

    Read the article

  • Creating Mobile Cross-Platform Scripting Solution

    - by Aplomb
    I am having the dream to design a Mobile cross-platform scripting solution to achieve Developer only need to code once by scripting language(it's possible be Javascript or others need further investigation), then the solution will be able to generate the installation files for multiple mobile platforms like J2me, Android, Symbian, BlackBerry, Palm, Windows Mobile/Phone, iPhone, etc. Using the scripting language, developer can code with unified platform API. And other extension frameworks under scripting language, like, 1. 2D UI framework Most probably using for Mobile Applications, the UI style will compete with native UI framework and no longer every application in particular platform looks similar. 2. 3D UI framework Provide the platforms who has 3D capability can represent their Mobile Application with more fashion 3D style which will be much more abstractive. 3. Variable game engine Developers can can use it for easily and high-quality build games. 4. etc This Mobile solution is providing three points, 1. Cross-Platform 2. Scripting 3. Middleware So guys, what do you think about this idea, is it good for Developers? is it profitable? where is the better direction for this idea?

    Read the article

  • Generating dynamic css using php and javascript

    - by Onkar Deshpande
    I want to generate tooltip based on a dynamically changing background image in css. This is my my_css.php file. <?php header('content-type: text/css'); $i = $_GET['index']; if($i == 0) $bg_image_path = "../bg_red.jpg"; elseif ($i == 1) $bg_image_path = "../bg_yellow.jpg"; elseif ($i == 2) $bg_image_path = "../bg_green.jpg"; elseif ($i == 3) $bg_image_path = "../bg_blue.jpg"; ?> .tooltip { white-space: nowrap; color:green; font-weight:bold; border:1px solid black;; font-size:14px; background-color: white; margin: 0; padding: 7px 4px; border: 1px solid black; background-image: url(<?php echo $bg_image_path; ?>); background-repeat:repeat-x; font-family: Helvetica,Arial,Sans-Serif; font-family: Times New Roman,Georgia,Serif; filter:alpha(opacity=85); opacity:0.85; zoom: 1; } In order to use this css I added <link rel="stylesheet" href="css/my_css.php" type="text/css" media="screen" /> in my html <head> tag of javascript code. I am thinking of passing different values of 'index' so that it would generate the background image dynamically. Can anyone tell me how should I pass such values from a javascript ? I am creating the tooltip using var tooltip = document.createElement("div"); document.getElementById("map").appendChild(tooltip); tooltip.style.visibility="hidden"; and I think before calling this createElement, I should set background image.

    Read the article

  • Dynamic context menus for a BlackBerry CLDC Application

    - by Jacob Tabak
    In my custom field in a BlackBerry CLDC Application, I want to display a specific context menu based on the current state of the field. My original idea was to do something like this: protected void makeContextMenu(ContextMenu contextMenu) { if (isPaused()) contextMenu.addItem(resumeMenuItem); else contextMenu.addItem(pauseMenuItem); } However, the state of the field doesn't seem to be affecting the items on the context menu. I'm assuming that the context menu only gets "made" once during the life of the field. Is there a way to do what I'm trying to do?

    Read the article

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