How can a trigger be written which is invoked after updating a particular column in the table and creates a CSV file with the contents of same table?
I am using Oracle 10g.
I have a step 1 page, and a step 2 page. I want to take the information from step 1 page, then step 2 page, and save as session information (which i have already done). Once this information is all gathered i then want to be able to submit it to another php page using HTTP POST.
I can not figure out why my code does not filter out lists from a predefined list.
I am trying to remove specific list using the following code.
data = [[1,1,1],[1,1,2],[1,2,1],[1,2,2],[2,1,1],[2,1,2],[2,2,1],[2,2,2]]
data = [x for x in data if x[0] != 1 and x[1] != 1]
print data
My result:
data = [[2, 2, 1], [2, 2, 2]]
Expected result:
data = [[1,2,1],[1,2,2],[2,1,1],[2,1,2],[2,2,1],[2,2,2]]
I'm not sure how password hashing works (will be implementing it later), but need to create database schema now.
I'm thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length.
So, how to store these passwords in the database?
I am getting an object structure like
Object--
--- Object
STRING1:VALUE
STRING2:VALUE
STRING3:VALUE
---- OBJECT
STRING1:VALUE
STRING2:VALUE
STRING3:VALUE
Now I want to filter this object because i need only STRING2:VALUE in the same object structure and need to a an structure similar to:
Object
STRING2:VALUE
Object
STRING2:VALUE
and I need to do it in runtime can somebody please let me know ..
I created a plot using 2 separate data sets so that I could create different errorbars. The first data set has error bars that go down only whereas the second data set has error bars that go up only. This prevents unnecessary overlap in the plot. I also used a compound shape for one of the groups.
I want to create a legend based on these shapes (not a colour), but I can't seem to figure it out. Here is the plot code.
p<-ggplot()
p + geom_point(data=df.figure.1a, aes(x=Hour, y=Mean), shape=5, size=4) +
geom_point(data=df.figure.1a, aes(x=Hour, y=Mean), shape=18, size=3) +
geom_errorbar(data=df.figure.1a, aes(x=Hour, y=Mean, ymin = Mean - SD, ymax = Mean), size=0.7, width = 0.4) +
geom_point(data=df.figure.1b, aes(x=Hour, y=Mean), shape=17, size=4) +
geom_errorbar(data=df.figure.1b, aes(x=Hour, y=Mean, ymin = Mean, ymax = Mean + SD), size=0.7, width = 0.4)
I use MD5 hash for identifying files with unknown origin. No attacker here, so I don't care that MD5 has been broken and one can intendedly generate collisions.
My problem is I need to provide logging so that different problems are diagnosed easier. If I log every hash as a hex string that's too long, inconvenient and looks ugly, so I'd like to shorten the hash string.
Now I know that just taking a small part of a GUID is a very bad idea - GUIDs are designed to be unique, but part of them are not.
Is the same true for MD5 - can I take say first 4 bytes of MD5 and assume that I only get collision probability higher due to the reduced number of bytes compared to the original hash?
I want to use some parts of code in different area of bootstrap.groovy. How do I "include" these parts and reuse it?
def init = {
environments {
production {
include("bla.groovy)
include("blaFoo.groovy)
}
test {
include("blaFoo.groovy)
}
development {
include("bla.groovy)
include("bla1.groovy)
include("blaFoo.groovy)
}
}
}
Given a infinite stream of random 0's and 1's that is from a biased (e.g. 1's are more common than 0's by a know factor) but otherwise ideal random number generator, I want to convert it into a (shorter) infinite stream that is just as ideal but also unbiased.
Looking up the definition of entropy finds this graph showing how many bits of output I should, in theory, be able to get from each bit of input.
The question: Is there any practical way to actually implement a converter that is nearly ideally efficient?
Sound Manager functions such as SndPlay() are deprecated and not available in 64-bit. The AudioServices functions are modern but only seem to deal with files and are not documented to handle this format.
In top of form1 i did:
private System.Timers.Timer _refreshTimer;
private int _thisProcess;
Then in the Form1 Load event:
_thisProcess = Process.GetCurrentProcess().Id;
InitializeRefreshTimer();
PopulateApplications();
Then the timer init method:
void InitializeRefreshTimer()
{
_refreshTimer = new System.Timers.Timer(5000);
_refreshTimer.SynchronizingObject = this;
_refreshTimer.Elapsed += new System.Timers.ElapsedEventHandler(TimerToUpdate_Elapsed);
_refreshTimer.Start();
}
Then the timer elapsed event:
void TimerToUpdate_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
PopulateApplications();
}
In the end the Populate method:
void PopulateApplications()
{
dataGridView1.Rows.Clear();
foreach (Process p in Process.GetProcesses("."))
{
if (p.Id != _thisProcess)
{
try
{
if (p.MainWindowTitle.Length > 0)
{
String status = p.Responding ? "Running" : "Not Responding";
dataGridView1.Rows.Add( p.MainWindowTitle, status);
}
}
catch { }
}
}
}
The variable status show in the column2 but let's say i want that status will be display for each process/app in column5 ? How can i move it ?
EDIT**
Tried this:
void PopulateApplications()
{
dataGridView1.Rows.Clear();
foreach (Process p in Process.GetProcesses("."))
{
if (p.Id != _thisProcess)
{
try
{
if (p.MainWindowTitle.Length > 0)
{
var icon = Icon.ExtractAssociatedIcon(p.MainModule.FileName);
Image ima = icon.ToBitmap();
img.Image = ima;
img.HeaderText = "Image";
img.Name = "img";
String status = p.Responding ? "Running" : "Not Responding";
dataGridView1.Rows.Add(img, p.MainWindowTitle, status);
}
}
catch { }
}
}
}
I moved the variable img to the top of the form.
The problem is i see in each row this:
DataGridViewImageColumn { Name=img, Index=-1 }
And i don't see the icon it self. Why ?
Ok, I think this is probably an easy question but for the life of my I can't figure it out. I have created a table called ugtags and in that table I have two columns (beyond the basics), 'name' and 'link'.
I am trying to allow a user to add a link to a page. Ideally they would enter the link title (name) and the url (link) and in the view it would display the title as a link to the url that was entered in the link column.
I there a way to do it by simply affecting the <%= link_to h(ugtag.name) %> code?
I have a site that plays a stream. I perform an AJAX call to the server once a person presses a button.
<input type="submit" class="play" data-type="<?php echo $result_cameras[$i]["camera_type"]; ?>" data-hash="<?php echo $result_cameras[$i]["camera_hash"]; ?>" value="<?php echo $result_cameras[$i]["camera_name"]; ?>">
This prints out a bunch of buttons that the user can select. This is processed by the following code:
<script>
$(document).ready(function(){
$(".play").click(function(){
var camerahash = $(this).data('hash');
var cameratype = $(this).data('type');
function doAjax(){
$.ajax({
url: 'index.php?option=streaming&task=playstream&id_hash=<?php echo $id_hash; ?>&camera_hash='+camerahash+'&format=raw',
success: function(data) {
if (data == 'Initializing...please wait')
{
$('#quote p').html(data);
setTimeout(doAjax, 2000);
}
else
{
if (cameratype == "WEBCAM" && data == 'Stream is ready...')
{
$('#quote p').html(data);
window.location = 'rtsp://<?php echo DEVSTREAMWEB; ?>/<?php echo $session_id;?>/'+camerahash;
}
else if (cameratype == "AXIS" && data == 'Stream is ready...')
{
$('#quote p').html(data);
window.location = 'rtsp://<?php echo DEVSTREAMIP; ?>/<?php echo $session_id;?>/'+camerahash;
}
else
{
$('#quote p').html(data);
}
}
}
});
}
doAjax();
});
});
</script>
The server returns the messages such as Stream is ready.... My problem is that everything is working great except on additional button clicks. Specifically when they get success (video plays) and they exit back out, they don't get any other messages if they click another button. It is as if the click event is not triggered. Do I need to be doing something to the click handler to respond?
Hey all,
The title is obvious, I need to know if methods are serialized along with object instances in C#, I know that they don't in Java but I'm a little new to C#. If they don't, do I have to put the original class with the byte stream(serialized object) in one package when sending it to another PC? Can the original class be like a DLL file?
If I have a linq query that creates the anonymous type below:
select new
{
lf.id,
lf.name,
lf.desc,
plf.childId
};
Is it possible to assign a specific type to one of the members? Specifically I would like to make lf.id a null-able int rather than an int...
Assume that I have a text file separated by colons. I understand how to display the entire text file or any specific column using awk. However, what I want to do is to get the awk output and then display it by adding my own text using a shell script? For example, assume that my text file is:
England:London:GMT
USA:Washington:EST
France:Paris:GMT
What I want to do is to display this input into the below format:
COUNTRY: England
CAPITOL: London
TIMEZONE: GMT
COUNTRY: USA
CAPITOL: Washington
TIMEZONE: EST
COUNTRY: France
CAPITOL: Paris
TIMEZONE: GMT
I have two tables registries and names. Consequently, I have two model classes. I'm coding a method in registries model and I need to fetch all names in the names table/model. How'd I do it?
Should a simple new Names() work? But, is it recommended?
I'm using Java sockets for client - server application. I have a situation when sometimes client needs to send a byte array (using byteArrayOutputStream) and sometimes it should send a custom java object. How can I read the information from the input stream on the server side and determine what is in the stream so that I can properly process that?
...and what the nice folks at OpenSSL gratiously provide me with is this. :)
Now, since you shouldn't be guessing when using cryptography, I come here for confirmation: what is the function call I want to use?
What I understood
A 128 bits key is 16 byte large, so I'll need double DES (2 × 8 byte). This leaves me with only a few function calls:
void DES_ede2_cfb64_encrypt(const unsigned char *in,
unsigned char *out, long length, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_cblock *ivec, int *num, int enc);
void DES_ede2_cbc_encrypt(const unsigned char *input,
unsigned char *output, long length, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_cblock *ivec, int enc);
void DES_ede2_cfb64_encrypt(const unsigned char *in,
unsigned char *out, long length, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_cblock *ivec, int *num, int enc);
void DES_ede2_ofb64_encrypt(const unsigned char *in,
unsigned char *out, long length, DES_key_schedule *ks1,
DES_key_schedule *ks2, DES_cblock *ivec, int *num);
In this case, I guess the function I want to call DES_ede2_cfb64_encrypt, although I'm not so sure -- I definitely don't need padding here and I'd have to care about what ivec and num are, and how I want to generate them...
What am I missing?
Hi all,
I've decided to develop a database driven web app, but I'm not sure where to start. The end goal of the project is three-fold: 1) to learn new technologies and practices, 2) deliver an unsolicited demo to management that would show how information that the company stores as office documents spread across a cumbersome network folder structure can be consolidated and made easier to access and maintain and 3) show my co-workers how Test Drive Development and prototyping via class diagrams can be very useful and reduces future maintenance headaches.
I think this ends up being a basic CMS to which I have generated a set of features, see below.
1) Create a database to store the site structure (organized as a tree with a 'project group'-project structure).
2) Pull the site structure from the database and display as a tree using basic front end technologies.
3) Add administrator privileges/tools for modifying the site structure.
4) Auto create required sub pages* when an admin adds a new project.
4.1) There will be several sub pages under each project and the content for each sub page is different.
5) add user privileges for assigning read and write privileges to sub pages.
What I would like to do is use Test Driven Development and class diagramming as part of my process for developing this project. My problem; I'm not sure where to start. I have read on Unit Testing and UML, but never used them in practice. Also, having never worked with databases before, how to I incorporate these items into the models and test units?
Thank you all in advance for your expertise.
Lets suppose that $(document).height() is 1000. Then i insert a new div at the bottom of the page with height=100. The $(document).height() should be 1100 but it keeps throwing 1000 to me.
How can i get the new $(document).height() dynamically?
Thank!
Getting the customer's to_s method by looping through
Is there a Ruby idiom to write the code in 1 line (or shorter than 3 lines of code)?
def method
string = ""
@customers.each { |customer| string += customer.to_s + "\n" }
string
end
Consumer profiles with analytical scores [ConsumerID, 1..n demographical variables, 1...n analytical scores e.g. "likely to churn" "likely to buy an item 100$ in worth" etc.] have to be possible to query fast if they are to be used in customizing web-sites, consumer communications etc.
Well. If you have:
Large number of consumers
Large profiles with a huge set of variables (as profiles describing human behaviour are likely to be..)
...you are in trouble. If you really have a physical relational database to which you target a query and then a physical disk starts to rotate someplace to give you an individual profile or a set of profiles, the profile user (a web site customizing a page, a recommendation engine making a recommendation..) has died of boredom before getting any observable results.
There is the possibility of having the profiles in memory, which would of course increase the performance hugely. What are the most proven solutions for a fast-response, scalable consumer profile storage? Is there a shootout of these someplace?