I have a UserControl that exposes a System.Type property. I want to make it settable at design time, like the BindingSource's DataSource property. How can I achieve this?
I have a relationship like this:
class E {
string name
hasMany = [me:ME]
}
class M {
float price
}
class ME {
E e
M m
int quantity
}
And I'd hate to iterate to achieve this: "obtain the sum of the quantity in ME times the price of the corresponding M for a given E".
Any hints on how to implement it using GORM/HQL ?
Thanks in advance
Hi a newb question:
I have a table with a bunch of buttons like so:
<tr class="hr-table-cell" >
<td>REcord 1</td>
<td>
<INPUT type="button" value="Approve" onclick="" />
<INPUT type="button" value="Reject" onclick="" />
<INPUT type="button" value="Delete" onclick="fnDeletePpAppl(222445,704);" />
</td>
</tr>
<tr class="hr-table-cell" >
<td>REcord 1</td>
<td align="center" class="hr-table-bottom-blue-border" valign="middle">
<INPUT type="button" value="Approve" onclick="" />
<INPUT type="button" value="Reject" onclick="" />
<INPUT type="button" value="Delete" onclick="fnDeletePpAppl(237760,776);" />
</td>
</tr>
I have my jquery like so:
<script type="text/javascript"> // JQUERY stuff
$(document).ready(function(){
function fnDeletePpAppl(empno, applno) {
alert('Entering here');
$("form").get(0).empno.value = empno;
$("form").get(0).applNo.value = applno;
$("form").get(0).listPageAction.value = "delete";
$("form").get(0).action.value = "pprelreqlist.do";
$("form").get(0).submit();
}
});
This doesn't seem to work.I thought this means, the function is ready only after the dom is ready. After the dom is ready and i click the button, why is not recognizing the function declaration within the .ready() function? However if i use the function directly:
<script type="text/javascript">
function fnDeletePpAppl(empno, applno) {
alert('Entering here');
$("form").get(0).empno.value = empno;
$("form").get(0).applNo.value = applno;
$("form").get(0).listPageAction.value = "delete";
$("form").get(0).action.value = "pprelreqlist.do";
$("form").get(0).submit();
}
This works. I want to get my fundamentals straight here... If i do the declaration without the .ready() , does that mean i'm using plain vanilla jscript?
If i were to do this with the document.ready - the usual jquery declaration way, what would i have to change to make it work?
I understand there are much better ways to do this like binding with buttons etc, but I want to know why this particular way doesn't seem to be working. Thanks.
Cheers.
K
Hi,
I know this question has been asked here before, but I don't think those answers were adequate for my needs.
We have a SOAP webservice that is used for an iPhone application, but it is possible that we need an Android specific version or a proxy of the service, so we have the option to go with either SOAP or JSON. I have a few concerns about both methods:
SOAP solution:
Is it possible to generate java
source code from a WSDL file, if so,
will it include some kind of proxy
class to invoke the webservice and
will it work in the Android
environment at all?
Google has not provided any SOAP
library in Android, so i need to use
3rd party, any suggestion?
What about the performance/overhead
with parsing and transmitting SOAP
xml over the wire versus the JSON
solution?
JSON solution:
There is a few classes in the
Android sdk that will let me parse
JSON, but does it support generic
parsing, like if I want the result
to be parsed as a complex type? Or
would I need to implement that
myself?
I have read about 2 libraries before
here on Stackoverflow, GSON an
Jackson. What is the difference
performance and usability (from a
developers perspective) wise? Do you
guys have any experince with either
of those libraries?
So i guess the big question is, what method to go with?
I hope you can help me out. Thanks in advance :-)
Hi
Is there a security risk if an application called page.ashx called internal only page.ashx, can a hacker conclude that another page is called.
I don't want anyone to access this page. it looks stupid I know, but it is a part of more complex problem.
thanks
Here is my javascript:
$(document).ready(function(){
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: queries["mindex"] }, showData, 'html');
});
function showData(data)
{
var response = $(data).find("#mailing").html();
if (response == null)
{
$("#results").html("<h3>Server didn't respond, try again.</h3>");
}
else if (response.length)
{
var old = $("#results").html();
old = old + "<br /><h3>" + response + "</h3>";
$("#results").html(old);
var words = response.split(' ');
words[2] = words[2] * 1;
words[4] = words[4] * 1;
if (words[2] < words[4])
{
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: words[2] }, function(data){showData(data);}, 'html');
}
else
{
var done = $(data).find("#done").html();
old = old + "<br />" + done;
$("#results").html(old);
}
}
else
{
$("#results").html("<h3>Server responded with an empty reply, try again.</h3>");
}
}
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
After the first line in showData:
var response = $(data).find("#mailing").html();
the javascript stops. If I put an alert before it, the alert pops up, after it, it doesn't pop up. There must be something wrong with using $(data), but why? Any ideas would be appreciated.
i am trying to make a uiapplication
If i click on a button then a background thread must start which should run even when my application is exited how can i do that
I created a background thread but it gets stop when the app exits.
I've a spring bean with 3 Maps all of which are to be populated incrementally.
First map is an item category list, second map is a product list and third map is a hobby for item type list
All the maps are mapped to and on the JSP.
When the page is loaded only the first map is populated on the onchange event of first map, I need to populate the second map in the bean and similarly on the onchange event of second map, I need to populate the third map in the bean.
Is there a way to do this using Ajax??
I need some code samples to how to render JSON response in second and third dropdown.
Clarification: @Donal: I have a simple JSP page with 3 dropdowns corresponding to 3 maps stored in my commandBean. So when the page loads for the first time only the first map and hence the first dropdown is populated. Now whenever the user selects anything out of the first dropdown, I need to send the same commandbean back with the values of the first dropdown and get the values for the second map and hence the second dropdown and so forth for the 3rd dropdown as well. For each dropdown I 've got 3 maps and 3 variables for storing the selected values. Now I want to understand if this is possible using Ajax. I hope this clarifies whatever you need to know. Thanx
Hi, what is the best practice for this scenario:
1) User clicks "Sort huge javascript array"
2) Browser shows "Sorting..." through element.innerHTML="Sorting"
3) Browser sorts huge javascript array (100% CPU for several seconds) while displaying "Sorting..." message.
4) Browser shows result.
Pseudo code:
...
<a href="#" onclick="sortHugeArray();return false">Sort huge array</a>
...
function sortHugeArray(){
document.getElementById("progress").innerHTML="Sorting...";
...do huge sort ...
...render result...
document.getElementById("progress").innerHTML=result;
}
When i do that this way, browser never shows "Sorting...", it freezes browser for several seconds and shows result without noticing user...
Thank you for advice.
hi ,
Silverlight version : 4
Silverlight patter :MVVM
Visual Studio template :Silverlight navigation application
How do I block main navigation on (mainpage.xaml) as in any silverlight navigation application and block page's controls ( i.e whichever page is it in ) during async webservice calls in my viewmodel? Any best practices?
Hi Guy,
I am using JQuery ajax jsonp. I have got below JQuery Code:
$.ajax({
type:"GET",
url: "Login.aspx", // Send the login info to this page
data: str,
dataType: "jsonp",
timeout: 200000,
jsonp:"skywardDetails",
success: function(result)
{
// Show 'Submit' Button
$('#loginButton').show();
// Hide Gif Spinning Rotator
$('#ajaxloading').hide();
}
});
The above code is working fine, I just want to send the request as "POST" instead of "GET", Please suggest how can I achieve this.
Thanks
Im trying to create a loop of items like this...
for each (var btn:Object in ViewButtonData)
{
// build element
var box:HBox = new HBox();
box.styleName = "lefttab";
box.width = "100%";
box.addEventListener("rollOver", HoverTab(btn.id, 1));
box.addEventListener("rollOut", HoverTab(btn.id, 0));
// add element to list
}
I would like to pass in current HBox to the 'HoverTab' function. Is there a way to do that?
Scenario
I have a C# Windows Service that essentially subscribes to some events and if anything is triggered by the events, it carries out a few tasks.
The Thing...
....is that these events are monitoring processes, which I need to restart at certain times of the day.
Question
What's the best way I can go about performing this task at an exact time?
Thoughts so far are:
1)To use a timer that checks what time it is every few minutes.
2)Something that isn't a timer and doesn't suck as an implementation.
Help greatly appreciated.
Using Visual C++ with MFC. When a certain event occurs in my code, I want to set a function to be called 10 seconds later to perform some activity. The handling of the event happens in a static library that doesn't have any direct links to MFC (and I'd like to keep it that way).
How can I schedule a function to be called at some point in the future? Use a Timer I guess? How do I decouple the Timer (which is an MFC dependency) so my business code doesn't have a direct dependency on the GUI? Or maybe something else besides a timer?
i have used facebook connect in my site but it is not working properly. when i click on facebook connect button it shows popup after that when i enter my login and password it shows the callback url in the same popup.
Ok, this is so weird!!! I am running PHP Version 5.1.6 when I try and run the code below it gives a fatal error of an object that has not been instantiated. As soon as I un-comment this line of code
//$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
everything works. Even though I have declared the $cb_db object as global within in the method. Any help would be greatly appreciated.
require_once ( ROOT_CB_CLASSES . 'db.php');
$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
class cb_user {
protected function find_by_sql( $sql ) {
global $cb_db;
//$cb_db = new cb_db(USER, PASSWORD, NAME, HOST);
$result_set = $cb_db->query( $sql );
$object_array = array();
while( $row = $cb_db->fetch_array( $result_set ) ) {
$object_array[] = self::instantiate( $row );
}
return $object_array;
}
}
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
Hi, I have a question.
Somebody, who was working on my code before me, created some method and passed Runnable as parameter, more likely:
void myMethod(Runnable runnable){ runnable.run(); }
Then calling myMethod out of main looks like:
public static void main(String args[])
{ try
{ myMethod(new Runnable(){ public void run() { //do something...; }}); }
catch (Throwable t) { } }
So, to supply parameter to myMethod I need to instantiate object of (in this case anonymous) class implementing Runnable.
My question is: is it necessary to use Runnable in this example? Can I use any different interface? I mean I can create new interface with single method i.e.
interface MyInterface{ void doThis(); }
then change look of myMethod: void myMethod(MyInterface myObject){ myObject.doThis(); }
And of course client too:
public static void main(String args[]) {
try { myMethod(new MyInterface (){ public void doThis()
{ //do something...; }}); }
catch (Throwable t) { } }
Or maybe something is about Runnable?!
How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee?
Here is the current structure:
CREATE TABLE [dbo].[Employees](
[NodeId] [hierarchyid] NOT NULL,
[EmployeeId] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [varchar](120) NULL,
[MiddleInitial] [varchar](1) NULL,
[LastName] [varchar](120) NULL,
[DepartmentId] [int] NULL,
[Title] [varchar](120) NULL,
[PhoneNumber] [varchar](20) NULL,
[IM] [varchar](120) NULL,
[Photo] [varbinary](max) NULL,
[Bio] [varchar](400) NULL,
[Active] [bit] NULL,
[ManagerId] [int] NULL
)
I am pulling categories from an xml file. I only have 5 categories but the code below keeps pulling categories indifitely! Weird thing, I dont even have a loop in the xml function.
Test link:
http://www.refinethetaste.com/FLPM/
$.ajax({
dataType: "xml",
url: "/FLPM/content/home/index.cs.asp?Process=ViewVCategories",
success: function(xml) {
$(xml).find('row').each(function(){
var id = $(this).attr('id');
var CategoryName = $(this).find('CategoryName');
$("<div class='tab fleft'><a href='http://www.refinethetaste.com/FLPM/content/home/index.cs.asp?Process=ViewVideos&CATEGORYID="+ id +"'>"+ CategoryName.text() + "</a></div>").appendTo("#VCategories");
CategoryName.find("div.row-title .red").tabs("div.panes > div");
});
}
});
I'm sure that there's an easy answer to this, but I can't find it.
I have a table 'myTable' which I stripe using the following
$("#myTable tr:even").css({ "background-color": "#FEE996" });
$("#myTable tr:odd").css({ "background-color": "#FFEFAF" });
This works fine.
I am also using a table filter plugin as follows
$('#myTable').tableFilter();
This plugin places a blank field at the top of each column into which the filter criteria can be typed. When the table is filtered it removes unmatched rows, which in turn messes up the striping. I would like to be able to re-invoke the lines to re-stripe the table.
Something like
$('#myTable').tableFilter().find("tr:even").css({ "background-color": "#FEE996" }).find("tr:even").css({ "background-color": "#FFEFAF" });
Is this possible please?
I have an architecture similar to this:
<div id="container">
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
</div>
I want to, using jQuery, hide the cursor when the mouse enters #container. However as the nested divs appear on top it doesn't quite work that way. How can I hide the mouse cursor when hovering over any of the divs within #container. Below is the cursor hiding code.
$('#container').mouseover(function()
{
$(this).css({cursor: 'none'});
});
Below is my example script:
<li><a <?php if ($_GET['page']=='photos' && $_GET['view']!=="projects"||!=="forsale") { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos\""); } ?>>Photos</a></li>
<li><a <?php if ($_GET['view']=='projects') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&view=projects\""); } ?>>Projects</a></li>
<li><a <?php if ($_GET['view']=='forsale') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&view=forsale\""); } ?>>For Sale</a></li>
I want the PHP to echo the "href="#" class="active" only when it is not on the two pages:
?page=photos&view=forsale
or
?page=photos&view=projects