I have two button one textset on JFrame ,i need user used first button to browse
in your computer and other button to attche documents or image
and displayed in textset
I have a collection of heterogenous data that I pull from a database table mtable. Then, for every unique value uv in column A, I compute a function of (SELECT * FROM mtable WHERE A=uv). Then I do the same for column B, and column C. There are rather a lot of unique values, so I don't want to hit the db repeatedly - I would rather have a class that replicates some of the functionality (most importantly some version of SELECT WHERE). Additionally, I would like to abstract the column names away from the class definition, if that makes any sense - the constructor should take a list of names as a parameter, and also, I suppose, a list of types (right now this is just a String[], which seems hacky). I'm getting the initial data from a RowSet.
I've more or less done this by using a hashmap that maps Strings to lists/arrays of Objects, but I keep getting bogged down in comparisons and types, and am thinking that my current implementation really isn't as clean and clear as it could be. I'm pretty new to java, also, and am not sure if I'm not going down a completely incorrect path.
Does anyone have any suggestions?
I'm trying to write a kernel which is a little long but the output is not correct.
I took out a lot almost everything and finally narrowed down the an initialization problem and I found that the following works:
__kernel void k_sIntegral(__global const float* eData,__global const unsigned long* elements,__global float* area){
const int i = get_global_id(0);
if(i < elements[0]){
area[i] = i;
}
}
But the following does not work:
__kernel void k_sIntegral(__global const float* eData,__global const unsigned long* elements,__global float* area){
const int i = get_global_id(0);
if(i < elements[0]){
__local float a,b,c,j,k,h,s;
area[i] = i;
}
}
Using the first kernel, I get:
area[1] = 1
Using the second kernel, I get:
area[1] = 0 (from calloc)
Update:
It seems like the code does work, but I need to change the function name otherwise it somehow calls the previous function even though it was not compiled (?). Any leads to why that happens?
If anyone can let me know what might be the problem I'll be really grateful, thanks in advance!
here is the code:
cmd1.setCommandText("select * from lp.human_tb_meta_sex");
cmd1.Execute();
while (cmd1.FetchNext())
{
SAString sas=cmd1.Field("id").asString();
cout<<"sas id:"<
it gave me ORA-00932 error...I dont know why..?
I am involved in a project where I need to provide subset of our production data (for a date range) to one of my co-workers for trouble shooting.I would like to insert a scrubbed subset of the production data into a new database table that my co-worker can access. Please suggest best approach to achieve this.
Say I only need to find out whether a line read from a file contains a word from a finite set of words.
One way of doing this is to use a regex like this:
.*\y(good|better|best)\y.*
Another way of accomplishing this is using a pseudo code like this:
if ( (readLine.find("good") != string::npos) ||
(readLine.find("better") != string::npos) ||
(readLine.find("best") != string::npos) )
{
// line contains a word from a finite set of words.
}
Which way will have better performance? (i.e. speed and CPU utilization)
I have the following function which takes a list and returns two sublists split at a given element n. However, I only need to split it in half, with odd length lists having a larger first sublist
splitlist :: [a] -> Int -> ([a],[a])
splitlist [] = ([],[])
splitlist l@(x : xs) n | n > 0 = (x : ys, zs)
| otherwise = (l, [])
where (ys,zs) = splitlist xs (n - 1)
I know I need to change the signature to [a] - ([a],[a]), but where in the code should I put something like length(xs) so that I don't break recursion? Thank you.
How can I match the following pattern?
"anything123.anythingelse"
Alphanum of any length, with exactly 1 "." in the middle, and then alphanum of any length?
Thanks.
If we only need to graphically authorize a user,
view a few tables representation (from database),
ability to change data in the database visually
what tools to use to write such a web application that will run on Tomcat?
What framework allows to do that in the most straightforward, easy-to-manage and elegant way?
How to create a function, which on every call generates a random integer number? This number must be most random as possible (according to uniform distribution). It is only allowed to use one static variable and at most 3 elementary steps, where each step consists of only one basic arithmetic operation of arity 1 or 2.
Example:
int myrandom(void){
static int x;
x = some_step1;
x = some_step2;
x = some_step3;
return x;
}
Basic arithmetic operations are +,-,%,and, not, xor, or, left shift, right shift, multiplication and division. Of course, no rand(), random() or similar staff is allowed.
A=rand(10)
B=find(A98)
How do you have text saying "There were 2 elements found" where the 2 is general i.e. it isn't text, so that if I changed B=find(A90) it would automatically no longer be 2.
For some reason my galleryScroll() function only runs once, even though the function calls itself using setTimeout(). I'm thinking the issue may be related to scope, but I'm not sure:
http://jsfiddle.net/CYEBC/2/
$(document).ready(function() {
var x = $('#box').offset().left;
var y = $('#box').offset().top;
galleryScroll();
function galleryScroll() {
x = x + 1;
y = y + 1;
$('#box').offset({
left: x,
top: y
});
setTimeout('galleryScroll()', 100);
}
});?
The HTML:
<html>
<head>
</head>
<body>
<div id="box">
</div>
</body>
</html>
I have been racking my brains over this for a while now. Here is the data i have in the sql data base as an example:
ID | TYPE | DATA
1 | TXT | TEST
2 | PHP | php
3 | JS | JAVASCRIPT
That is just an example, there are multiple listing for TXT, PHP and JS throughout the table. What I want to do is retrive all the data and display it all into separate drop down/select boxes. Meaning, select box one would list all data with type TXT, select box two would list all data with type PHP and select box 3 would list all data with type JS. The only way I have came about doing this is doing individual sql queries for each different type. I know there is a way to do it all in 1 query and then display it the way I want to but I just can't seem to figure out how and I know its going to drive me nuts when someone helps and I see just how they did it. Thanks for the input.
Hi,
What's the simplest way to add an admin menu button with x submenus?
How can I make use of the table styling of WP?
I just want to show a table of orders from a non WP table, but displayed in WP admin??
Should I make a plugin?
1- Does mod_rewrite means that if I make this url:
domain.com/ad.php?id=8498292
INTO
domain.com/8498292
that all links on my website will have to be changed to the later above?
example the link: domain.com/ad.php?id=8498292 wont work now, unless I replace it with domain.com/8498292 ?
Or will the server know that they are the same still?
2- Will the rewritten link appear rewritten in the browsers adress bars also, so if I enter domain.com/ad.php?id=8498292 it will actually appear as domain.com/8498292 in the adress bar itself?
3- Will images and all other related links and material on the page whose link is rewritten remain intact? ie will pictures and links still work FROM that page which are relative?
Thanks
On my master page I have:
<link rel="stylesheet" href="css/default.css" />
I also have a page "blog.aspx" in the root directory.
I have the rule:
<rewrite url="~/blog/blog.aspx" to="~/blog.aspx" />
My questions are:
Am I meant to make all my links in my site point to blog/blog.aspx now instead of just blog.aspx where it is physically located
How is best to cope with the paths of the stylesheets etc now being messed up because they are one dir up?
Input integer array:
a[8] = { a1, a2, a3, a4, b1, b2, b3, b4 }
Output array:
a[8] = { a1, b1, a2, b2, a3, b3, a4, b4 }
Forget all corner cases, make sure your solution works for any int array of size 2n. You can use one or two temp variables for looping or anything, but you shouldn't use any temp arrays/stacks/queues etc to store entire array or part of array.
I'm able to get answer in O(n*log n), but I'm looking for better solution.
I have a UI question that troubled me on the best method to handle 4 decimal places for prices.
In an table already cramped full of data, I would want to simplified the interface to make it not so cluttered. The actual current UI is shown below.
http://i41.tinypic.com/bg5tub.jpg
The problem is, for a unit price/units/D.Price and Dis.(Discount) to have 4 decimal places ($0.3459) is quite rare but it still happens (5 in 100 entries). This will result a lot of junk decimal places, cluttering up the interface.
What is the best solution to this problem?
In short, I want to declutter it yet maintain the precision.
Note: This is web app
for ( var i:int = 0 ; i < 1; i++)
{
for ( var j:int = 0 ; j < 1; j++)
{
if (shape[j][i] == 0 )
{
pencil.graphics.beginFill(0);
pencil.graphics.drawRect(10,10,5,5);
pencil.graphics.endFill();
}
}
}
i am trying to run this code where shape is an array 2*2
gives an error
ReferenceError: Error #1069: Property 0 not found on Number and there is no default value.
at Main()
need help
I have created a dropdown menu with jquery:
here
Everything is ok but in ie6. I know ie6 not supported z-index, but is there any solution for ie6?
Thanks in advance
Hey everyone,
First off, sorry for my noob-ness. Believe me when i say ive been rtfm'ing. Im not lazy, im just dumb (apparently). On the bright side, this could earn someone some easy points here.
I'm trying to do a match/replace with a pattern that contains special characters, and running into syntax errors in a Flex 3 app. I just want the following regex to compile... (while also replacing html tags with "")
value.replace(/</?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>/g, "");
On a side note, the pattern /<.*?/g wouldn't work in cases where there are html entities between tags,
like so:
<TEXTFORMAT LEADING="2">
<P ALIGN="LEFT">
<FONT FACE="Arial" SIZE="11" COLOR="#4F4A4A" LETTERSPACING="0" KERNING="0"><one</FONT>
</P>
</TEXTFORMAT><TEXTFORMAT LEADING="2">
<P ALIGN="LEFT">
<FONT FACE="Arial" SIZE="11" COLOR="#4F4A4A" LETTERSPACING="0" KERNING="0">two</FONT>
</P>
</TEXTFORMAT>
The first regex would get both "<one" and "two", but the second would only get "hi"
Thanks!
Stabby L
Hi this works fine in Firefox, but not IE. What am I doing wrong? Thanks for the help in advance!
$(document).ready(function(){
$("#radiodiv").buttonset();
$('#radio1').bind("click", function() {
alert('Hello');
});
}
<form>
<div id="radiodiv">
<input type="radio" id="radio1" name="radio" checked="checked" /><label for="radio1">WaveHeight</label>
<input type="radio" id="radio2" name="radio" /><label for="radio2">Current</label>
<input type="radio" id="radio3" name="radio" /><label for="radio3">WaveHeightDir</label>
</div>
</form>
// ACCORDION
$('.accordion .answer').hide(); // hide all
$('.accordion .question').click(function(){
$('.accordion .answer').slideUp(); // hide all open
$(this).addClass('active').next().slideDown(); // show the anwser
return false;
});
HTML:
<dl class="accordion">
<dt class="question">question</dt>
<dd class="answer">answer</dd>
<dt class="question">question</dt>
<dd class="answer">answer</dd>
</dl>
... works, but
the 'active' class is removed from inactive question elements and
atleast one of the answer remains open, all answers should be able to close.
Thanks!