|-|x 126 Junior Poster in Training

I suppose it depends on the industry and market you are looking in. For me, I see a lot of demand for PHP, DotNet (usually C#/ASP.NET though also VB, not that there is a lot of difference between the two IMHO).

I haven't seen much in the way of Python or Java for that matter, unless its J2EE. Having said that, they are both good and flexible languages, and I feel that the more exposure to different technologies you have experienced is better for your development as a programmer in general.

You will find that a good knowledge of web standards CSS, HTML and javascript will help regardless of what backend language is being used. More and more systems programming is becomming web based rather than client side applications, with more companies converting legacy systems into intranets and the like.

</mytwocents>
/H

|-|x 126 Junior Poster in Training

http://www.albahari.com/threading/

This was the best resource I found when starting to work with threads. If I understand your problem correctly, you either want to Sleep each thread to wait for the other to do its work, or possible create a resource lock until your data acquisition thread completes its work, and then the communication thread will gain access to the resource and, well, presumably it will communicate with something.

Anyways, hope this helps.
/H

kvprajapati commented: :) excellent link +14
|-|x 126 Junior Poster in Training

I have a query in which I need to display some group function figures SUM COUNT etc from a joined table. I also need to select the latest version (by datetime) of a matching record from a separate table, which I can do using an ordered subquery in the join.

My issue is that the group functions appear to be joining on every row in the subquery (not just the latest one) and thus displaying incorrect inflated results of the SUM/COUNT functions.

So I guess what I'm looking for is one of the following:
1) a better way to do the group functions so that the joins don't affect them
2) a way to select only the single latest row in my subquery so the extraneous rows aren't included in the join
3) a different approach to the joins themselves that aleviates the problem.

Here is a simplified version of the query, any ideas greatly appreciated.

SELECT p.field1, p.field2, p.field3,
       SUM(pp.amount1), SUM(pp.amount2),
       COUNT(c.field1), SUM(c.field1),
       s.Status,
       l.lookupvalues
FROM tableP p
LEFT JOIN tableP pp ON pp.field1 = p.field1 AND pp.field2 = p.field2 AND pp.field3=0
LEFT JOIN someotherlookuptables l on l.id=p.lookupid
LEFT JOIN tableC c ON c.id = p.cid
LEFT JOIN (SELECT * FROM status ORDER BY dateChanged DESC) s ON s.pid = p.id
GROUP BY p.field1

I should add that I have narrowed it down to eliminate other LEFT JOINed tables in the query, which I have tested and have no affect on the group functions.

Also, …

|-|x 126 Junior Poster in Training
 var days(7);
 days(0) = "Sunday";
 ...
 function SetDay (day) {
   document.GetElementById("Daybox").value = "You Selected " + days(day) + " for your delivery";
 }

I think the rest is the same.

|-|x 126 Junior Poster in Training

I believe (and someone please correct me if I'm wrong) that you will need to do a separate replace for the space->slash.
Although you could match both cases using and OR case in the Regex, I don't think there is any way to specify different replacement text for each case in a single statement.

Something like this should work: underscoredWord = Regex.Replace(word.Replace(" ","/"), "[^" + correctLetters + "]", " _");

|-|x 126 Junior Poster in Training

I think String.split() requires a specified character to 'split' on. If you only need exactly the first four characters, you might be better to do a String.substring(0,3) and String.substring(4) to get the rest of the line.

|-|x 126 Junior Poster in Training

good catch..

also looks like there might be too many closing quotes on '%$each%''"

|-|x 126 Junior Poster in Training

afik there isn't any function that will do this for you automatically, which means you will have to write one.

you will need to read the lines of the file using something like File.ReadAllLines() or possibly the StreamReader ReadLine()
your choice here may depend on the size of the file and available memory etc.

you then need to loop through each line and check if it contains the text you are looking for, if it does increment a counter.

the code might look something like this:

int countHands(string handToSearch) {
  int counter = 0;
  foreach (string line in File.ReadAllLines("c:\hands.txt");
    if (line.Contains(handToSearch))
      counter++;
  Return counter;
}
|-|x 126 Junior Poster in Training

It is possible that the page variable hAns is losing its value on postBack. You could try storing this in a Session or Viewstate variable instead.

However, as the other guys have suggested, you should place a breakpoint on the line of code for the comparison and check what value each has at that time. Making the assumption that a variable/object has a value because you have set a value at some previous time is not necessarily valid.

Lusiphur commented: Agree with you and Consider, I'll have to look into that this week to see if it's the case... +9
|-|x 126 Junior Poster in Training

Assuming you are using an SQLDataSource to bind the gridview, you can add a control parameter linked to your dropdown like so

<SelectParameters>
   <asp:ControlParameter Name="TypeFilter" ControlID="DropDownList1" PropertyName="SelectedValue" />
</SelectParameters>

Your select query must then include the parameter in the where clause, something like

WHERE Type = @TypeFilter

You can set the DropDownList to AutoPostBack="true" so that the grid will refresh whenever the selection changes.

That's essentially all you need to do.

|-|x 126 Junior Poster in Training

2 things I see there...

don't forget to quote your array indexes echo $SuperRecordSet['diagnosisName']; your loop is incrementing to the wrong variable, while ($superNumRows = mysql_fetch_assoc($run_superQuery)) should be using $SuperRecordSet

|-|x 126 Junior Poster in Training

actually I just noticed, strtotime is not the correct function to format your date string.

Try using date('Y-m-d', $datefrom) instead.

|-|x 126 Junior Poster in Training

Do you need to send email from localhost?

Possibly for development and testing purposes - it can be useful, but is not your primary concern I think.

If you have installed something like WAMP on your local machine then it will handle the mail() functions. HOWEVER, this still requires the access through the network relay etc. for the mail to actually arrive at the other end.

|-|x 126 Junior Poster in Training

check out PHP's SMTP configuration and check your server settings. These can be set (as your error message suggests) either hard coded in the PHP.ini file, or on the fly in code by calling ini_set()

Also, check that there is no firewall or anything blocking SMTP on your local machine and/or webserver, and of course that there is an SMTP server available. I am guessing you are in a Windows server environment, so if you are using Exchange you will need to point your PHP config to the exchange server and provide valid credentials for sending mail.

Hope this helps some.
/H

|-|x 126 Junior Poster in Training

WHERE DATE BETWEEN

Correct me if I'm wrong but isn't DATE a reserved word?

If that's the name of your field in the `medicalrecords` table, you may need to use backticks around it, ie:

WHERE `DATE` BETWEEN
diafol commented: good spot +15
karthik_ppts commented: Yes +7
|-|x 126 Junior Poster in Training

Thanks! That does exactly what I need.

I didn't realise you could call DataBind expressions on controls without a DataSource assigned.

Just in case this is useful/interesting to anyone else, I am also able to use this to restrict controls Enable/Visible properties based on security settings loaded into the Session at login time.
eg:

<asp:Button ID="btnDelete" runat="server" Text="Delete" Enabled='<%# Session["PermissionLevel"] > 3 %>' />
|-|x 126 Junior Poster in Training

try something like this

UserControl.FindControl("Button1").Enabled = True
|-|x 126 Junior Poster in Training

Is it possible t set a control's property in the markup using server tags? Specifically in this case I need to set it from a Session value, ideally something like this:

<asp:Label ID="Label1" runat="server" Text='<%= Session["value"] %>' />

Of course the above simply prints as literal text, rather than evaluating the expression.

I know I can do it in the code behind, but in the circumstances it would be a lot cleaner if I could somehow do it in the markup or "bind" the property to the Session value.

Open to ideas, any suggestions appreciated.

Cheers
/H

|-|x 126 Junior Poster in Training

Apologies for the delay, was off last week for the holidays.

The page code looks like this

corp-info/order-form

<?php include './public/forms/order.php'; ?>
forms/order.php

<?php if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// check the POST data
//   do some stuff with the database
}
...
<form action="<?php echo URL_PUBLIC; ?>corp-info/order-form.html" method="post" enctype="multipart/form-data" name="order">
...

For some reason it seems like the POST data is coming back to the page empty. If I do a print_r($_POST); at the top, I just get an empty Array() printed to the page.

|-|x 126 Junior Poster in Training

if you are using Windows authentication, rather than Forms (in your web.config)

<authentication mode="Windows">

Then the User.Identity.Name == "DOMAIN\\UserName" which you can split and use to validate via the DirectorySearcher class.

Hope this helps
/H

|-|x 126 Junior Poster in Training
For Each row As GridViewRow In GridView1.Rows
Dim cb As CheckBox = CType(GridView1.FindControl("ChkSelect"), CheckBox)

I believe you should be looking for the control inside the row, not the whole grid.
ie:

For Each row As GridViewRow In GridView1.Rows
Dim cb As CheckBox = CType(row.FindControl("ChkSelect"), CheckBox)
|-|x 126 Junior Poster in Training

Are you getting any specific error messages?

|-|x 126 Junior Poster in Training

Hi all

Is anyone here familiar with coding in WolfCMS?

I have been asked to add a form page to an existing website based on WolfCMS, but have little experience on the platform. For some reason my form doesn't seem to be receiving the POST data, or executing the processing properly. Any guidance as to the requirements or configuration for the cms would be appreciated.

cheers
/H

|-|x 126 Junior Poster in Training

I would do the same as you did for the figures.
note, you can specify multiple css classes where needed.
eg:

<div class="article"> ... </div>
<div class="section testi-left">

also class="header" is different from id="header" so you could do that, and your css would look like

#header {...}
#header .header {...}
#header .nav {...}
|-|x 126 Junior Poster in Training

No offense chrislim2888, but you aren't 100% correct.

Below is the header information from a post on a Google group. While the specific details are irrelevant, it clearly shows email address, server name, ip address and a variety of other data that could be used to track a users virtual identity. The amount of information a person could glean from this depends on their intent, interest, and technical skill. Given that Google groups operates based on email, and email always contains IP data in the header, there is not much you can do besides looking into an anonymous server host of some sort.

However, the type of information you are talking about theguitarist, requires virtually no skill and only minimal knowledge to obtain and represents little threat to you. Geo-spacial data for example can be obtained from a number of free services once they know the source IP address.

Received: by 10.43.53.72 with SMTP id vp8mr2814576icb.0.1322663078573;
        Wed, 30 Nov 2011 06:24:38 -0800 (PST)
X-BeenThere: backbox-linux@googlegroups.com
Received: by 10.231.11.72 with SMTP id s8ls4042618ibs.3.gmail; Wed, 30 Nov
 2011 06:24:37 -0800 (PST)
Received: by 10.43.48.202 with SMTP id ux10mr2730390icb.6.1322663077799;
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Received: by 10.43.48.202 with SMTP id ux10mr2730388icb.6.1322663077780;
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Return-Path: <raffaele.fo...@gmail.com>
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172])
        by gmr-mx.google.com with ESMTPS id ib2si372785icc.4.2011.11.30.06.24.37
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 30 Nov 2011 06:24:37 -0800 (PST)
Received-SPF: pass (google.com: domain of raffaele.fo...@gmail.com designates 209.85.210.172 as permitted sender) client-ip=209.85.210.172;
Authentication-Results: gmr-mx.google.com; spf=pass …
|-|x 126 Junior Poster in Training

you need to do the same with the other tags section article header footer nav and also don't forget the closing tags </figure> should all be </div> although Arkinder is correct in that it is recommended to specify the exact doctype you are using, IE should actually choose the latest version it knows about that is compatible with your document when you use <!DOCTYPE html>

Arkinder commented: I find that it makes a little more sense semantically, and IE7 has never been known for behaving the way that it should. Regardless you're correct in the behavior of the HTML5 DOCTYPE. +7
|-|x 126 Junior Poster in Training

I was just about to post asking how to do this when I stumbled across the solution. All my research on the web suggests that the only way is to use stored procedures with an output parameter. Unfortunately, my queries are necessarily dynamically generated, and output parameters do not work with text commands on MySQL. (I wont go into the cause of that issue here, but it is well documented online.)

I did manage to find that the class MySql.Data.MySqlClient.MySqlCommand actually contains the last_insert_id() as a property. So I was able to write code in my datasource Inserted event like this...

protected void datasource_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        int newID = ((MySqlCommand)e.Command).LastInsertedId;
    }

Anyway, since it took me a while to find, I thought I'd post this here to try and help someone else who may be having the same problem.

Cheers
/H

|-|x 126 Junior Poster in Training
|-|x 126 Junior Poster in Training

Its the specific tag names, such as article section figure figcaption etc. that are HTML5. You could change them to divs with a css class like

<div class="figure">

and change your css to match

#testimoni .figure{float:left}

hope this gives you the idea

|-|x 126 Junior Poster in Training

I don't believe IE7 will be capable of handling the HTML5 tags. I suggest either downloading IE9 (or the latest version of FireFox or Chrome) or replacing the HTML5 tags with HTML4 compatible tags, such as DIVs in order for your style sheets to function as expected in older browsers.

Depending on your target audience, you can't guarantee that the end users will be using the latest browser versions so you may want to look at backwards compatibility. I am not an HTML5 expert, but I'm sure there are plenty of fallback examples available.

|-|x 126 Junior Poster in Training

What version of IE are you using?

What does it look like in other browsers like FireFox or Chrome?

Are you specifying a DocType definition tag?

Since you are using HTML5 tags like <figure> it will only display properly in recent browser versions that support HTML5.

|-|x 126 Junior Poster in Training

You are never really anonymous on the web. Hence all the browser proxy servers and vpn services available for people who wish to obfuscate their identity.

All of that information can be obtained from simple analysis of your IP address, which is (as a matter of necessity) passed to the server with every web request. I'd say that person is just messing with you, and it is not really anything to worry about. This type of thing happens all the time, particularly on "hacker" forums and the like.

|-|x 126 Junior Poster in Training

I'd suggest maybe setup a virtual pc or something, but afik you can't go higher than your active screen resolution anyway.

|-|x 126 Junior Poster in Training

Sorry, Tariq

I think I misread your previous post. You will need to specify the filter on each menu link individually, as they all have different images.

Something like:

<div id="button">
    <ul>
      <li><a href="index.html" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/home.png', sizingMethod='scale'); padding-left:20px;">Home</a></li>

...

You will probably need to play a little with the position to get it right. Of course, the style can all be moved into a css file if you prefer.

|-|x 126 Junior Poster in Training

you can place the filter into your css file

#button {
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');
}
|-|x 126 Junior Poster in Training

I originally posted this over on the WordPress forums, and got no responses. Eventually I figured out what the problem was and fixed it, but thought I'd repost here in case anyone else is experiencing similar issues (I couldn't find any related articles in my initial search on the symptoms.)

My experience was during development of a WordPress plugin, but I can see the potential for this to affect any web development on pages containing relative links. I hope someone finds this helpful.

/H

I have an interesting issue here. For some reason, in FireFox only, the page content being passed to my WordPress plugin is not correct for the page being viewed. It seems to be passing the content for the next page in the list, or something similar. The correct page content is actually presented in the browser, but not passed into the plugin, which is causing processing logic to fail in this browser.

This occurs on all pages in the site, regardless if I have placed any custom code or reference to the plugin into the page. I have been testing for days trying to figure out what/where the problem is occurring. All other browsers appear to work fine, but FireFox (and I have tested basically every version currently available to download). I don't believe it is a caching issue, as we've tried clearing, refreshing, changing/not using proxies, different computers, etc.

I have also noticed that the PHP $_POST and $_REQUEST variables don't …

cereal commented: thanks for sharing +7
|-|x 126 Junior Poster in Training

Please note that IE6 does not provide native support for PNG transparency. You must use a special filter provided by MicroSoft.

<DIV STYLE="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale');" >

(example modified from linked MS knowledgebase article.)

|-|x 126 Junior Poster in Training

take a look at onkeypress

|-|x 126 Junior Poster in Training

I can't see where your variable a is getting defined or set, but presumably it is a java variable available in the current scope and all you need to do is build it into the sql string.

rs=statement.executeQuery("select * from customer where serialnumber like '%"+a.ToString()+"%' ");
|-|x 126 Junior Poster in Training
SELECT count(DISTINCT bodyNo) FROM paintshop WHERE `date`='2011-11-29'
|-|x 126 Junior Poster in Training

You don't really need the second mytable, as MDanz is essentially achieving the same thing in his original query.

I agree that this only works because MySQL doesn't restrict the select to true GROUP clauses/fields.

I am also surprised to see (in my own testing just now) that the subquery version runs consistently 0.0001 sec faster than the group by version. (we are talking a difference of 0.0004 to 0.0005 seconds here, it is only a tiny dataset after all). I'd be interested to see if your results are similar as I would have thought the subqueries to be less efficient in execution.

|-|x 126 Junior Poster in Training

Sorry, allow me to explain...

The first subquery will return the id of the first record with the lowest sid The second subquery will return the id of the first record with the second lowest sid so the actual resultant dataset will look like this:

+----+-----------+----------+
| id |       sid |      num |
+----+-----------+----------+
|  1 |        15 |      one |   
|  3 |        17 |    three |

which, from my understanding, was the desired outcome.

However as I mentioned the use of nested subqueries is significantly less efficient that using the original group by filter, and may not be appropriate or practical depending on the circumstance. If anyone can see a better way, please post. :)

smantscheff commented: Understood and explained the problem AND found a solution ! +10
|-|x 126 Junior Poster in Training

I don't think you need php, but you will probably have to use some javascript or something if you want to force the link to be downloaded or saved.

You could use the target link attribute if you just need to stop it from opening in the same window as your current page.

|-|x 126 Junior Poster in Training

you just need to grab the other values from the POST and include them in your sql query

eg:

//format:  $variable = $_POST['<input textbox id>'];

$pubdate = $_POST['updatepubdate'];
$title = $_POST['updatetitle'];
$publisher = $_POST['updatepublisher'];
//...etc, as many as you need...
 
$sql="UPDATE Books SET PublishDate='$pubdate', Title='$title', Publisher='$publisher' WHERE BookID = ".$bookid;
// check your field names are correct, and don't forget the quotes for string values
|-|x 126 Junior Poster in Training

If you move your update code php block to the top of the page, right before the SELECT, it will automatically display the updated data when the page loads after the POST.

|-|x 126 Junior Poster in Training

there are a few ways you could do it. One might be to use the query result, like:

if ($conn->query($sql))
   echo "Update Successful.";
else die("Cannot update");
|-|x 126 Junior Poster in Training

around the variable in the middle, so that MYSQL will treat it as a string value: "UPDATE Books SET PublishDate='$update' where BookID = '".$bookid."'"; is BookID an integer? if so, you will not need the single quotes around it and your code should look like: "UPDATE Books SET PublishDate='$update' where BookID = ".$bookid;

|-|x 126 Junior Poster in Training

don't forget you need quotes around your variable in the query, as I said previously

|-|x 126 Junior Poster in Training

you're setting $query at line 74 but trying to execute $sql on line 78

|-|x 126 Junior Poster in Training

OK... it looks like you are using MySQLi to handle the connection, should you therefore be using mysqli_query to perform the update operation?