i have a string of the format SUCCESS,12:34:56:78:90, i want to separate these two values that are separated by commas into two different strings. how do i do that in gcc using c language.
create or replace procedure proc_advertisement(CustomerID in Number,
NewspaperID in number,
StaffID in Number,
OrderDate in date,
PublishDate in date,
Type in varchar,
Status in varchar,
Units in number) is
begin
insert into PMS.Advertisement(CustomerID, NewspaperID, StaffID, OrderDate, PublishDate,
Type, Status, Units)
values(CustomerID,NewspaperID, StaffID, OrderDate, PublishDate,
Type, Status, Units);
dbms_output.put_line('Advertisement Order Placed Successfully');
end;
How to check for if any error has occurred during the execution of the procedure and if any error has occurred then I wish to display an error message.
I am using jquery to set a session, i have a php page which gets the values of the person logging. The value in the session array, is then used in another page where, it is stored in a hidden field for database entry.The problem is, the value is not set unless you refresh the page of which beats the purpose of AJAX and Jquery.Again,the session seems to be one session behind.How can I do this without page refresh/ reload?
i have following regular expression but it's not working properly it takes only three values after @ sign but i want it to be any number length
"/^[a-zA-Z0-9_.-]+\@([a-zA-Z0-9-]+.)+[a-zA-Z0-9]{2,4}$/"
this@thi This is validated
this@this It is not validating this expression
Can you please tell me what's the problem with the expression...
Thanks
Hi,
My UPDATE and DELETE logic are in stored procedures. I've built an entity framework model with mappings to these procedures.
In spUpdate I return the new timestamp column so the EF could detect concurrency conflicts. It works fine.
I have a problem with the spDelete because I don't see mappings for return values in the "delete function" row.
How to check concurrency in this example?
I have a web page loaded into a WebBrowser object. What I want to do is access the elements on that page to input data. For example, enter username and password and submit the form.
How is this possible? Any ideas?
Could I use HTMLAgilityPack to access the elements and set their values?
I have a trait and an implementation looking like:
trait Foo[A] {
def bar[B >: A: Ordering]: Foo[B]
}
class FooImpl[A]( val a: A, val values: List[Foo[A]] ) extends Foo[A] {
def bar[B >: A] = { /* concrete implementation */}
}
I would like to use the @specialized annotation on A and B to avoid autoboxing. Do I need to use it in both trait and implementation, only in implementation, or only in trait ?
D <- read.csv("sample1.csv", header = FALSE, sep = ",")
D
V1 V2 V3 V4
1 20100316 109825 352120 239065
2 20100317 108625 352020 239000
3 20100318 109125 352324 241065
D[,1]
[1] 20100316 20100317 20100318
In the above example how do I get the data in D[,1] to be read, and stored as date values:
2010-03-16, 2010-03-17, 2010-03-18 ? I have lots of data files in this format.
TIA,
I'm trying to optimize some bit packing and unpacking routines. In order to do the packing I need to calculate the number of bits needed to store integer values. Here is the current code.
if (n == -1) return 32;
if (n == 0) return 1;
int r = 0;
while (n)
{
++r;
n >>= 1;
}
return r;
I want to know is there any way to prevent elements of HTML form from changing on client side before submit (the elements they have value, like hidden elements)?
Lets say I have hidden elements. I want to make sure their values haven't been changed by user in purpose.
Or what is HTML FORM Security Best Practice?
OK so for background I've only been using Java for a little more than a week and I am making a basic GUI "Recipe Book" application just to test out some of the techniques I've learned. Currently I'm working on the "Add New Recipe" page that allows the user to make a new recipe by adding ingredients one at a time. The ingredients have 3 attributes: Name, amount, and unit (like cups, oz, etc) that come from two text fields and a combo box respectively. The 3 values are stores as strings to a String array that represents the ingredient, then the arrays are stored in a vector that holds all of the ingredients for one recipe. When an ingredient is added, the user first types in the 3 necessary values into empty boxes/combo box dropdown and then clicks "Add Ingredient". Here is my code for when the button is clicked:
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source == addIngredientButton) {
//make sure 3 ingredient fields are not blank
if (!ingredientNameField.getText().equals("") && !ingredientAmountField.getText().equals("") && !ingredientUnitDropdown.getSelectedItem().equals("")) {
tempIngredientsArray[0] = ingredientNameField.getText(); //set ingredient name to first position in array
tempIngredientsArray[1] = ingredientAmountField.getText(); //set ingredient amount to second position in array
tempIngredientsArray[2] = (String) ingredientUnitDropdown.getSelectedItem(); //set ingredient unit to third position in array
int ingredientsVectorSize = tempRecipe.ingredientsVector.size();
tempRecipe.ingredientsVector.add(this.tempIngredientsArray); //why would it matter if this and previous statement were switched
for (int k = 0; k < ingredientsVectorSize + 1; k++ ) {
liveIngredientsListArea.append("\n" + tempRecipe.makeIngredientSentence(k));
System.out.println(Arrays.toString(tempIngredientsArray)); //shows that tempIngredientsArray gets messed up each time
}
}
Now here's the really strange problem I've been having. The first time the user adds an ingredient everything works fine. The second time, the String[] for that ingredient seems to be duplicated, and the third time it's triplicated. Aka the first time it runs the System.out.println might return "{Sugar, 3, Cups}" and the second time it will return "{Flour, 2, Oz.} {Flour, 2, Oz.}" etc. What's causing this strange problem? All help greatly appreciated, let me know if you need any clarification.
Hi to All,
I developed an iPhone app which displays iPhone AddressBook contacts list.
I want to add extra fields to the selected contact.
Using AddressBook framework,it was not possible.So,i want to attach those values to the "contacts" table of my database.
How can i store(insert) those existing contacts into contacts(using sqlite3 insert command).
Please,help me with a sample code.
Thanks in Advance,
Ramya.
Hi,
I have a PHP page with two drop down lists. I am using AJAX to populate the second one according to the choice made of the first drop down list.
My problem is that when i am posting both values of the two dropdownlists to another php page in which an INSERT query is being made, the value of the second dropdown list is blank (as if no value was selected from the second drop down list).
Can you please take a look at this code and let me know what I am doing wrong?
Having a sequence, I need to find out which table.column gets its values. As far as I know, Oracle doesn't keep track of this relationship. So, looking up for the sequence in source code would be the only way. Is that right?
Anyone knows of some way to find out this sequence-table relationship?
Write a program that computes the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities. Test this for different values of n.
This is my query:
from forum in Forums
join post in Posts on forum equals post.Forum into postGroup
from p in postGroup
where p.ParentPostID==0
select new
{
forum.Title,
forum.ForumID,
LastPostTitle = p.Title,
LastPostAddedDate = p.AddedDate
}).OrderBy(o=>o.ForumID)
Currently the Join is not left join, meaning if some forum doesn't have a post that belongs to it, it will not be returned.
The forum without posts must be returned with null (or default) values for the post properties.
In a ruby on rails app, I build an array of Project Names and project id values, but want to truncate the length of the names. Current code is:
names = active_projects.collect {|proj| [proj.name, proj.id]}
I have tried to add a truncate function to the block, but am getting undefined method for class error.
Thanks in advance - I just cannot wrap my head around this yet.
void TheSettings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
var settings = IsolatedStorageSettings.ApplicationSettings[StorageSettings] as Dictionary<string, string>;
settings[e.PropertyName]= //call the method that has the same property name to get what the value is
LoadData();
}
Here is What I am trying to do. This is for a Windows Phone 7 series App. I am trying to determine what values got changed when the user changes the settings on the settings page and just save that.
I want to access files in the /sys, to be exact in the /sys/class folder. I just need to read some values there.
I tried the Context.openFileInput method, but got only exceptions and I understand this is not the right way.
thanks for replying!
here is the function description
test($argv)
$argv is an array , for example $argv=array($from1,$to1,$from2,$to2.....);
array items must be even.
$argv=array(1,2,4,5) : this will output values like below:
1_4
1_5
2_4
2_5
the number of arrray $argv's is not constant.
maybe 3 or 4 levels of loop will be outputed.
i know this will used RECURSIVE , but i don't know exatly how to code.
I do a select from table
[V_RPT_BelegungKostenstelleDetail]
WHERE SO_UID = '7C7035C8-56DD-4A44-93CC-F16FD66280A3'
AND GB_UID = '4FF1B0EE-A5DD-4699-94B7-760922666CE2'
AND GS_UID = '1188759A-54E1-4323-8BF2-85E71B3C796E'
AND RM_UID = '088C3559-6E6E-468A-9554-6740840FCBA1'
AND NA_UID= '96A2A8DB-8C83-4C60-9060-F0F55719AF5C'
GROUP BY KST_UID
How can I get SO_UID? It is the same everywhere, but I get an error when I try to get SO_UID with the return values...
SO_UID is not necessarely given like '7C7035C8-56DD-4A44-93CC-F16FD66280A3' here, so I can't just add it manually as string.
I've created a form that posts to a cfm file. When running a script onLoad that fills in the form values and tries to submit...The site takes me back to the login screen.
function f()
{
document.getElementById("email").value = "[email protected]";
document.getElementById("password").value = "asdf";
document.getElementById("form1").submit();
}
Please help!
Is there any facility in Django for doing currency conversions? Obviously, rates change day by day but I'm somewhat hopeful that the locale module has some sort of web-service based converter :P
There's a snippet here that handles the formatting: http://www.djangosnippets.org/snippets/552/ But I need to localize the values first.
I need to store authentication information and I rather not have the password in plain text:
<property name="user" value="theUser"/>
<property name="password" value="secret"/>
Has anyone figured out a way to encrypt property values in Nant?
I've looked in Nant and Nantcontrib docs but no mention of encryption. I am considering going the route of creating my own Nant Task.
Any suggestions?
In a vertex shader, I calculate a vector using only uniforms. Therefore, the outcome of this calculation is the same for all instantiations of the vertex shader. Should I just do this calculation on the CPU and upload it as a uniform? What if I have ten such calculations? If I upload a lot of uniforms in this way, does CPU-GPU communication ever get so slow that recomputing such values in the vertex shader is actually faster?