How can I replace CHAR with VARCHAR2 in all tables in a schema?
Note: I'm content with a query that returns the ALTER TABLE statements so I can save the script and run it again.
I'm using the post-receive-email script included with git. (Source is here.) It works just fine, but I want each email to be sent from the author of the commits pushed. How do I do it?
My post-receive file currently looks like this, and I want to customize the from-email-address.
#!/bin/sh
export [email protected]
$(dirname $0)/post-receive-email
i come across http://flyspy.com/miles/ and been impress by their chart/graph(the 2 and 3 one, i dont know is this 2 consider chart/graph)
anyone know how to build it? or did they use any javacsript script to build it?
Hi,
I have a applescript with the following:
on open dir
tell application "Finder"
tell application "Terminal"
activate
tell application "Terminal"
do script "cd " & dir
end tell
end tell
end tell
end open
It works, and gets the directory thats dropped on it, but it cd's into cd Macintosh HD:Users:USER:Desktop:C Files:
Is there any way to replace : with / ? in applescript?
What is the best gallery to showcase web design you have came across?
Plan to get various creative agencies to showcase their works on an advertisement platform so that new user will be able to see various portfolio. When it come to select a suitable album, I am indecisive if it too plain (Load and display) or too flashy (coverflow album), which album/gallery script do you recommend for our corporate theme?
I would prefer background to be white.
Hi,
In my asp.net page, i am refring external javascript file.
As per my learning in web, it's recommended that always put inline java script at the bottom of page. There is no information i get about external javascript refrence
I want to know that if i am refing external javascript file then where should i write?
Inside top of the page
bottom after closing tag of
Anyone who has developed file upload progress bar with following:
Ajax
Javascript
HTML
C based CGI
I am stuck at one point.
I am not able to read each updated progress bar value from CGI script.
Hello everyone:
I've got a typical problem when trying to insert a date into MySQL.
The column defined in MySQL is of type DATE. My PHP version is 5.3.0
Apart from this date-related issue, the rest of my code works just fine.
And this is my PHP script to do this:
$tablename = BOOKS_TABLE;
$insert = mysql_query("INSERT INTO $tablename (barcode, book_name, volume_num,".
" author, publisher, item_type, buy_price, buy_date) VALUES ".
"(".
"'" . $barcode . "', ".
"'" . $bookname . "', ".
"'" . $volumenum . "', ".
"'" . $author . "', ".
"'" . $publisher . "', ".
"'" . $itemtype . "', ".
"'" . $buyprice . "', ".
"'" . getMySQLDateString($buydate).
//"'STR_TO_DATE('".$buydate ."', '%d/%m/%Y'))'". //nothing changes in MySQL
")");
And this is the faulty function :
function getMySQLDateString($buydate) //typical buydate : 04/21/2009
{
$mysqlDateString = date('Y-m-d H:i:s', $strtotime($buydate));
return $mysqlDateString;
}
The first commented out line wouldn't do anything, the script is executed with no error, however, there is nothing changed in datebase after this.
The current approach will cause a Fatal error saying function name must be a string in this line.
Actually I followed this thread on SO, but just cannot pass the date into MySQL...
Can anyone help me figure out which part is not right?
How would you do it, in this case, to get it right?
Sorry about such a journeyman-like question, thanks a lot in advance.
Hi, I'm having problems updating a div's content in IE using .update; I also tried with innerHTML with no success. My script works fine with firefox and chrome, but I need to make it work with IE too (neither 7 nor 8 accept the functions). Any hints ?
Thanks in advance.
hey i got 9 type on my web. i have to set different keywords each type. with this script;
if ($type = movie) {
$yazdir = "DVDRip, DVDScr";
}
elseif ($type = game) {
$yazdir = "Full Version, Patch";
}
i can write keywords for two type. how to repeat this correctly for other types? (echo paramether must be $yazdir)
I am working on some ASP.NET web forms which involves some dynamic generation, and I need to add some onClick helpers on the client side. I have a basic outline of something working, except for one huge problem.
There are multiple HTML tables, each generated by a different ASP.NET web control. Each table can contain overlapping field names, which is causing a problem with my JQuery click event handlers. The click event handler is linking to unintended form fields in addition to the intended form field.
I have provided a simplified sample version of the code below. This code is trying to set the value of textbox box1 when a particular radiobutton is selected in the table with id=thing1. Obviously, the jquery code will be triggered for the form fields in both tables.
The tables are dynamically added to the webpage based upon different conditions. It is possible that no tables will be loaded, only 1 table, or both tables might load. In the future, other tables could be added. Each table comes from a different .net web control.
Other than renaming the form fields to make sure they are unique across all user controls, is there a way to have JQuery act only on the intended form fields? In other words, could the table ID be incorporated into the JQuery code in a manner that does not become a nightmare to maintain later?
<script>
$(document).ready(function() {
$("[id$=radio1_0]").click(function() {
$("[id$=box1]").attr("value", "");
});
$("[id$=radio1_1]").click(function() {
$("[id$=box1]").attr("value", "N/A");
});
</script>
<table id="thing1">
<tr><td>
<radiobuttonlist id="radio1"/>
<listitem>yes</listitem>
<listitem>no</listitem>
</td></tr>
<tr><td>
<textbox id="box1"/>
</td></tr>
</table>
<table id="thing2">
<tr><td>
<radiobuttonlist id="radio1"/>
<listitem>yes</listitem>
<listitem>no</listitem>
</td></tr>
<tr><td>
<textbox id="box1"/>
</tr></td>
</table>
I have a hash in Perl which has been dumped into from some legacy code the name of the key has now changed from simply reqHdrs to reqHdrs.bla
$rec->{reqHdrs.bla}
My problem is now I cant seem to access this field from the hash any ideas?
The following is my error
Download Script Output: Bareword "reqHdrs" not allowed while "strict subs" in use
This is my Unit Test class
<?
require_once '../simpletest/unit_tester.php';
require_once '../simpletest/reporter.php';
class Academic extends UnitTestCase
{
function setUp()
{
}
function tearDown()
{
}
function testAc1()
{
}
function testAc4()
{
}
function testAc7()
{
}
}
$test = new Academic();
$test->run(new HtmlReporter());
?>
When I run this script all methods viz., testAc1, testAc4, testAc7 etc are run.
Is there a way to execute just a single method ?
Thanks,
Shikhar
Can anyone tell me if there are any clients (browsers) that define a functioning Object.prototype.hasOwnProperty
that do NOT define a Function.prototype.call?
That is, must I use belt and suspenders to qualify clients for a certain level of scripting,
or will hasOwnProperty do for both?
if(Object.hasOwnProperty && Function.call){
// add script
}
Is support for either of these properties a reliable subset of support for the other?
Hey, I want to add a button(link), that when clicked will filter the pagination results.
I'm new to php (and programming in general) and would like to add a button like 'Automotive' and when clicked it updates the 2 mysql queries in my pagination script, seen here:
As you can see, the category automotive is hardcoded in, I want it to be dynamic, so when a link is clicked it places whatever the id or class is in the category part of the query.
1:
$record_count = mysql_num_rows(mysql_query("SELECT * FROM explore WHERE category='automotive'"));
2:
$get = mysql_query("SELECT * FROM explore WHERE category='automotive' LIMIT $start, $per_page");
This is the entire current php pagination script that I am using:
<?php
//connecting to the database
$error = "Could not connect to the database";
mysql_connect('localhost','root','root') or die($error);
mysql_select_db('ajax_demo') or die($error);
//max displayed per page
$per_page = 2;
//get start variable
$start = $_GET['start'];
//count records
$record_count = mysql_num_rows(mysql_query("SELECT * FROM explore WHERE category='automotive'"));
//count max pages
$max_pages = $record_count / $per_page; //may come out as decimal
if (!$start)
$start = 0;
//display data
$get = mysql_query("SELECT * FROM explore WHERE category='automotive' LIMIT $start, $per_page");
while ($row = mysql_fetch_assoc($get))
{
// get data
$name = $row['id'];
$age = $row['site_name'];
echo $name." (".$age.")<br />";
}
//setup prev and next variables
$prev = $start - $per_page;
$next = $start + $per_page;
//show prev button
if (!($start<=0))
echo "<a href='pagi_test.php?start=$prev'>Prev</a> ";
//show page numbers
//set variable for first page
$i=1;
for ($x=0;$x<$record_count;$x=$x+$per_page)
{
if ($start!=$x)
echo " <a href='pagi_test.php?start=$x'>$i</a> ";
else
echo " <a href='pagi_test.php?start=$x'><b>$i</b></a> ";
$i++;
}
//show next button
if (!($start>=$record_count-$per_page))
echo " <a href='pagi_test.php?start=$next'>Next</a>";
?>
Hi there,
I feel like this is quite delicate,
I have various folders whith projects I would like to backup into a zip/tar file, but would like to avoid backing up files such as pyc files and temporary files.
I also have a Postgres db I need to backup.
Any tips for running this operation as a python script?
Also, would there be anyway to stop the process from hogging resources in the process?
Help would be very much appreciated.
I added a word counter to a my form's textarea... it is something like this...
<div>
<label>About you:</label>
<textarea id="qualification" class="textarea hint_needed" rows="4" cols="30" ></textarea>
<span class="hint">explain about you</span>
<script type="text/javascript">
$("textarea").textareaCounter();
</script>
</div>
My problem is when I add textaracounter() like this my validation hint is not working.. when I remover the counter function validation hint is working...
this is the jquery for hint message..
$(".hint").css({ "display":"none" });
$("input.hint_needed, select.hint_needed, textarea.hint_needed, radio.hint_needed").on("mouseenter", function() {
$(this).next(".hint").css({ "display":"inline" });
}).on("mouseleave", function() {
$(this).next(".hint").css({ "display":"none" });
});
this is for the word counter..
(function($){
$.fn.textareaCounter = function(options) {
// setting the defaults
// $("textarea").textareaCounter({ limit: 100 });
var defaults = {
limit: 150
};
var options = $.extend(defaults, options);
// and the plugin begins
return this.each(function() {
var obj, text, wordcount, limited;
obj = $("#experience");
obj.after('<span style="font-weight: bold; color:#6a6a6a; clear: both; margin: 3px 0 0 150px; float: left; overflow: hidden;" id="counter-text">Max. '+options.limit+' words</span>');
obj.keyup(function() {
text = obj.val();
if(text === "") {
wordcount = 0;
} else {
wordcount = $.trim(text).split(" ").length;
}
if(wordcount > options.limit) {
$("#counter-text").html('<span style="color: #DD0000;">0 words left</span>');
limited = $.trim(text).split(" ", options.limit);
limited = limited.join(" ");
$(this).val(limited);
} else {
$("#counter-text").html((options.limit - wordcount)+' words left');
}
});
});
};
})(jQuery);
can anybody tell me what is the problem there?
Thank you..
I'm using Intercom rails in my application and I would like to not include intercom script in a certain situation. So, I would like to skip the intercom after_filter when a value is set in the user session.
I tried that, but it didn't worked:
class ApplicationController < ActionController::Base
before_filter :verify_session
def verify_session
if skip_intercom?
self.class.skip_after_filter :intercom_rails_auto_include
end
end
end
Any idea if it's possible?
my python xml parser fails if there´s a comment at the beginnging of an xml file like::
<?xml version="1.0" encoding="utf-8"?>
<!-- Script version: "1"-->
<!-- Date: "07052010"-->
...
is it illegal to place a comment like this?
In my app, a user can run a script, and if it is run in the terminal, it shows a nice progress bar, how would I replicate this in rails? I mean I could do like something between the two to communicate, but I would prefer if it would just show a "live" shell output.
Thanks :)
Using CSS, when a link is clicked it brings up a hidden DIV that contains a form. The user will then enter information and then submit the form. I'd like the hidden DIV to remain visisble, and a 'success message' to be displayed after submission. Then the user will have the option of closing the DIV. I can't get it to work without reloading the page, which causes the DIV to become hidden again. Any ideas?
<body>
<a href="javascript:showDiv()" style="color: #fff;">Click Me</a>
<!--POPUP-->
<div id="hideshow" style="visibility:hidden;">
<div id="fade"></div>
<div class="popup_block">
<div class="popup">
<a href="javascript:hideDiv()">
<img src="images/icon_close.png" class="cntrl" title="Close" />
</a>
<h3>Remove Camper</h3>
<form method="post" onsubmit="email.php">
<p><input name="Name" type="text" /></p>
<p><input name="Submit" type="submit" value="submit" /></p>
</form>
<div id="status" style="display:none;">success</div>
</div>
</div>
</div>
<!--END POPUP-->
<script language=javascript type='text/javascript'>
function hideDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'hidden';
}
else { // IE 4
document.all.hideshow.style.visibility = 'hidden';
}
}
}
function showDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'visible';
}
else { // IE 4
document.all.hideshow.style.visibility = 'visible';
}
}
}
</script>
</body>
Good day, colleagues!
Tell me please, how to make a dynamic xpath-parsing:
for example, instead of writing $domXPath-query('//[(@id = "article-id-18")]');
- write something like that $domXPath-query('//[(@id = "article-id-*")]');, because in my case, the site's script generate (every time) a new id for block, that contains article's text?
So question, is above.
I currently use curl_multi_* to connect to a few sites. Its only sending a few $_GET variables to start a script, but it outputs the html from the sites to the browser. I want to stop this. I already use a short timeout, but sometimes the scripts start fast, and I don't want to set the timeout any lower, in case it causes it not to connect.
So how can I stop the output to the browser from cURL?
This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code.
there is a page that i need to post a password to it and then i get a file to download.
the post goes to the same page address its loads again and pop up the download manager.
now i want to do the same but in curl, i posted the data to the url and then its sends me the file back but i dont want my script to download the whole file i want only to get a link to download it by myself.
how can i do that?