Daily Archives

Articles indexed Wednesday April 21 2010

Page 10/126 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to get data from other php scripts

    - by user225269
    I have 2 files, one is used to view the data in the mysql database, and list it on a table: if($_POST['general'] == 'ADDRESS'){ $result2 = mysql_query("SELECT * FROM student WHERE ADDRESS='$saddress'"); echo "<table border='1'> <tr> <th>IDNO</th> <th>ADDRESS</th> <th>LASTNAME</th> <th>FIRSTNAME</th> <th>VIEW</th> </tr>"; while($row = mysql_fetch_array($result2)) { echo "<tr>"; echo "<td>" . $row['IDNO'] . "</td>"; echo "<td>" . $row['ADDRESS'] . "</td>"; echo "<td>" . $row['LASTNAME'] . "</td>"; echo "<td>" . $row['FIRSTNAME'] . "</td>"; echo "<td><a href='update.php?id=" . $row['IDNO'] . "'>view</a></td>"; echo "</tr>"; } echo "</table>"; } And this one is the update.php which I am working on, I just want to be able to see the data that corresponds to the one the record that I clicked on the first one using the link "view". <?php mysql_select_db("school", $con); $result3 = mysql_query("SELECT * FROM student WHERE IDNO='?'"); ?> <tr> <td width="30" height="35"><font size="3">*I D Number:</td> <td width="30"><input name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $row["IDNO"]; ?>"></td> </tr> But I do not know how do I link the two, in such a way that the corresponding data in here: echo "<td><a href='update.php?id=" . $row['IDNO'] . "'>view</a></td>"; would be reflected in here: <td width="30"><input name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $row["IDNO"]; ?>"></td> </tr> Please give me an idea on how I can do this, thanks.

    Read the article

  • RenderPartial missing from Html Helper in ASP.NET MVC 2

    - by Guy
    I've just converted an application from MVC 1 to MVC 2 using the VS2010 wizard. Not found is the Html.RenderPartial which I have sprinkled around a number of views. I am guessing that this is something that I've done wrong because I see no mention of this as a breaking change in the white papers and docs. Everything I'm using is RTM/RTW and no beta or RC versions.

    Read the article

  • Using Entity Framework, how do I specify a sort on a navagation property?

    - by Jared
    I have two tables: [Category], [Item]. They are connected by a join table: [CategoryAndItem]. It has two primary key fields: [CategoryKey], [ItemKey]. Foreign keys exist appropriately and Entity has no problem pulling this in and creating the correct navigation properties that connect the entity objects. Basically each category can have multiple items, and items can be in multiple categories. The problem is that the order of items is specified per category, so that a particular item might be third in one category but fifth in another. In the past, I have added a [Sequence] field to the join table and modified the stored procedure to handle it. But since Entity is replacing my stored procedures, I need to figure out how to make Entity handle the sequence. Any suggestions?

    Read the article

  • using pthread in c++

    - by ogzylz
    I am using pthread.h in a *.cc file. when I try to use pthread_exit(0); or pthread_join(mythrds[yy],NULL); it says : .cc:(.text+0x3e): undefined reference to `pthread_exit' when complied very similar code in a *.c file with gcc it work perfect. How Can I use pthread's in c++.. (I also added -lpthread) .. void *myThreads ( void *ptr ) { ... pthread_exit(0); } .. flags: g++ -lpthread -Wall -static -W -O9 -funroll-all-loops -finline -ffast-math

    Read the article

  • Display a "Waiting Menssage" before the POST form send

    - by DomingoSL
    I have a upload file form, when you hit Submit it send the file to my server, but it takes a while, in the mean time i need to tell the user wait in order to get the file uploaded, because he can press Submit again because there is no menssage to prevent him. So, the user fill a few fields in the form, including a file. When he Send the form it sends the variables via POST to the same page: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="post"> A php script detect the page now have POST variables a do something. In the time between the send action and the page reload i need to display a mensage, how can i do that??? Thanks It will be nice if you now how to trigger that with colorbox. I know how to use it from a link but no from this POST action.

    Read the article

  • editing a file with vim that has no EOL marker on the last line but has CRLF line endings

    - by rmeador
    I often have to edit script files, the interpreter for which treats files that have an EOL marker on the last line of the file as an error (i.e. the file is treating CRLF as "newlines", not as "line endings"). Currently, I open these files in Vim using binary mode (-b on the command line). It autodetects the lack of EOL on the final line and sets the "noeol" option appropriately, which prevents it from writing an EOL on the last line. Because the file has CRLF line endings, I get lots of ^Ms at the end of my lines (because it interprets only Unix-style line endings in binary mode, it seems). I can't open it in text mode because the "noeol" option is ignored for non-binary files. This is very annoying, and I always have to remember to manually type the ^M at the end of each line! Is there some way I can force it to accept DOS-style line endings in binary mode, or force it to listen to the EOL option in text mode?

    Read the article

  • WPF View/ViewModels using Generics- how?

    - by Investor5555
    New to WPF, so please bear with me... Suppose I have 2 tables in SQL Thing OtherThing Both have the exact same fields: ID (int) Name (string) Description (string) IsActive (bit/bool) DateModified (DateTime) So, I want to create one Model (not two) and do something like this: BaseModel<T>() { public int ID {get;set;} ... } etc. (of course, using the INotifyPropertyChanged, just trying to keep the code simple). I want to be able to create a BaseView and BaseViewModel that would work with whatever model conforms to the Thing/OtherThing. I am really at a loss as to what to do here to make this generic, so I don't have to have a ThingView/ThingViewModel and a OtherThingView/OtherThingViewModel... It seems that this should be simple, but I cannot seem to figure it out. Does anyone have a code example where they could interchange various items from a dropdown list using one view, one ViewModel, and one base datamodel (and switching out the type from a dropdown)? For example, a combobox has 3 identical table structures for Thing OtherThing SomeThing and on selection changed, I want to pull the data from whatever table was selected, to be able to do standard CRUD operations on any of these 3 tables, without having to create concrete classes for each view/viewmodel.

    Read the article

  • Dividing sections inside an omp parallel for : OpenMP

    - by Sayan Ghosh
    Hi, I have a situation like: #pragma omp parallel for private(i, j, k, val, p, l) for (i = 0; i < num1; i++) { for (j = 0; j < num2; j++) { for (k = 0; k < num3; k++) { val = m[i + j*somenum + k*2] if (val != 0) for (l = start; l <= end; l++) { someFunctionThatWritesIntoGlobalArray((i + l), j, k, (someFunctionThatGetsValueFromAnotherArray((i + l), j, k) * val)); } } } for (p = 0; p < num4; p++) { m[p] = 0; } } Thanks for reading, phew! Well I am noticing a very minor difference in the results (0.999967[omp] against 1[serial]), when I use the above (which is 3 times faster) against the serial implementation. Now I know I am doing a mistake here...especially the connection between loops is evident. Is it possible to parallelize this using omp sections? I tried some options like making shared(p) {doing this, I got correct values, as in the serial form}, but there was no speedup then. Any general advice on handling openmp pragmas over a slew of for loops would also be great for me!

    Read the article

  • Windows Server cannot execute a py2exe-generated app

    - by Paul Oyster
    A simple python script needs to run on a windows server with no python installed. I used py2exe, which generated a healthy dist subdirectory, with script.exe that runs fine on the local machine. However, when I run it on the server (Windows Server 2003 R2), it produces this: The system cannot execute the specified program. and ERRORLEVEL is 9020. Any ideas?

    Read the article

  • How to format a money value from an ISOCurrencySymbol in C#

    - by nareshbhatia
    I have created a Money class to save money values in different currencies. The class uses 3 letter ISO symbols to store currency types: public class Money { public decimal Amount { get; set; } public string Currency { get; set; } } Is there a way in C# to use this information, say 100.00 USD, and format it as "$100.00"? Only way I know of requires CultureInfo like this: Amount.ToString("C", CultureInfo.CreateSpecificCulture("en-US")); However this does not work with my Money class. Is there another solution? I am open to changing my Money class. I have searched this site for similar questions (such as this), but couldn't find one that answers the above question.

    Read the article

  • Why is x86 ugly? aka Why is x86 considered inferior when compared to others?

    - by claws
    Hello, recently I've been reading some SO archives and encountered statements against x86 architecture. http://stackoverflow.com/questions/2667256/why-do-we-need-different-cpu-architecture-for-server-mini-mainframe-mixed-cor says "PC architecture is a mess, any OS developer would tell you that." http://stackoverflow.com/questions/82432/is-learning-assembly-language-worth-the-effort says "Realize that the x86 architecture is horrible at best" http://forums.anandtech.com/showthread.php?t=976577 says "Most colleges teach assembly on something like MIPS because it's much simpler to understand, x86 assembly is really ugly" and many more comments like Compared to most architectures, X86 sucks pretty badly. It's definitely the conventional wisdom that X86 is inferior to MIPS, SPARC, and PowerPC x86 is ugly I tried searching but didn't find any reasons. I don't find x86 bad probably because this is the only architecture I'm familiar with. Can someone kindly give me reasons for considering x86 ugly/bad/inferior compared to others.

    Read the article

  • Build Procedure

    - by sarah xia
    Hi all, My company is putting auto build and deploy procedure in place. What we are doing now is checking out source code from svn and specify the source folder in Ant script. Is it the right way? Can we omit the exporting process and build directly from SVN? Another question is to do with versioning. At the moment, we are creating a tag whenever there is a release and then use the tag number to name the build product, which will be shipped to a client's site. I've done search on the Internet and here and it seems the correct way to name a product is like this: x.y.z.revision. However, our company is quite small and the client always want quick changes and releases. I would like to know what the drawbacks of only using tag number to name the product? And what would be the best approach for small companies like us? Thankyou, Sarah

    Read the article

  • How to have Windows Server DNS use hosts file to resolve specific host names

    - by user41079
    Hello, everyone, I'm facing a small problem with Windows Server 2003 DNS service. In my corporation, I'm running Microsoft DNS server(172.16.0.12) to do name resolution to my company intranet(domain name ends in dev.nls. resolving to IP 172.16..), and it is also configured as a DNS forwarder to forward other domain names(e.g. *.google.com , *.sf.net) to Internet real DNS servers. This internal DNS server never tends to serve users from outside world. And, we are running a mail server(serving incoming mail for a real Internet domain @nlscan.com) inside company firewall which can be accessed in either way: by connecting to 172.16.0.10 from within intranet. by connecting to mail.nlscan.com(resolved to 202.101.116.9) from Internet. Note that 172.16.0.10 and 202.101.116.9 is not the same physical machine. The 202 one is a firewall machine who do port forwarding of port 25 and 110 to intranet address 172.16.0.10 . Now my question: If users inside corporate LAN want to resolve mail.nlscan.com, it resolves to 202.101.116.9. That's correct and workable, BUT NOT GOOD, because the mail traffic goes to the firewall machine then bounces to 172.16.0.10 . I hope that our internal DNS server can intercept the name mail.nlscan.com and resolve it to 172.16.0.10 . So, I hope that I can write an entry in "hosts" file on 172.16.0.12 to do this. But, how can Microsoft DNS server recognize this "hosts" file? Maybe you suggest, why not have intranet user use 172.16.0.10 to access my mail server? I have to say it is inconvenient, suppose a user(employee) works on his laptop, daytime in office and nighttime at home. When he is at home, he cannot use 172.16.0.10 . Creating a zone for nlscan.com on our internal DNS server is not feasible, because the name server for nlscan.com domain is on our ISP, and it is responsible for resolving other host names and sub-domains under nlscan.com . Thank you in advance.

    Read the article

  • XPS vs PDF. What's the status?

    - by Redandwhite
    XPS, the PDF alternative, seems to be almost dead in the water. That said, Windows 7 offers a built-in XPS printer and viewer. I believe Vista also offers a built-in printer. XPS seems lighter than PDF, perhaps it only appears so because of Adobe's bloated reader, but that's for another discussion. Is it worth it to begin encoding in XPS instead of PDF? Will Vista or above be able to read it without problems? What should I look out for?

    Read the article

  • Problems with synaptic touchpad

    - by penlite
    The "enhanced" features of the synaptics touchpad (ie scroll, pinch zoom) on my windows 7 64 bit dell studio 17 only work intermittently. This was an issue with the original OEM driver and also with the new driver from synaptics - please do not suggest that i update, reinstall, install as administrator, check or jiggle the driver - if i hear that one more time i will freak out. I have researched this for days and appears to be a common problem without a solution (many suggestions to update the driver though -argh). Dell and synaptics have not been helpful. I have checked that syntpehn.exe and syntphelper.exe are running (sometimes the UAC seems to block syntpehn.exe from running at startup). When the touchpad fails i can still use it to control the pointer and access the synaptics settings although some of the options are disabled (greyed out or simply unresponsive). It is the only pointing device i have installed - i had a logitech trackball attached but have uninstalled all software and drivers (including hidden devices) as per synaptic. It is also the only device using IRQ 12. Any help would be greatly appreciated except "update the driver".

    Read the article

  • Presenting an image cropping interface

    - by wkw
    I'm trying to engineer a UI for cropping images in iphone OS and suspect I'm going about things the hard way. My goal is pretty much what the Tapbots duo have done with Pastebot. In that app, they dim the source image but provide a movable and resizable cropping view and the image you're cropping is in a zoomable scrollview; when you resize or move the underlying image, the cropping view adjusts appropriately. I mocked up a composite image which will give a sense of the design I'm after, along with how I presently have my view hierarchy setup, viewable here The approach I've started with is the following: UIImageView with the image to crop is in a scrollview, a plain UIView with black fill and suitable transparency/alpha setting is added in front of the imageview. I then use a custom UIView which is a sibling to the scrollview at a higher level, which implements the drawRect: method and for the most part calls CGImageCreateWithImageInRect to get the portion of the image's bitmap that matches the position of the cropping view and draws that to the CGContext. in the viewcontroller I'm using the UIScrollViewDelegate methods to track scrolling and passing those changes to the custom cropping UIView so it stays in sync with the scroll contentOffset. That much is finally working. But trying to keep in sync as the scrollview zoomScale changes is when I figured I should ask for help. Looking for suggestions or guidance. My initial approach just seems like more work than is required. Could this be done with a masking layer in the ImageView? And if so, how would I setup the tracking for moving and resizing the cropping rect? My experience working with layers is non-nil, but very limited thus far.

    Read the article

  • Serializing Python bytestrings to JSON, preserving ordinal character values

    - by Doctor J
    I have some binary data produced as base-256 bytestrings in Python (2.x). I need to read these into JavaScript, preserving the ordinal value of each byte (char) in the string. If you'll allow me to mix languages, I want to encode a string s in Python such that ord(s[i]) == s.charCodeAt(i) after I've read it back into JavaScript. The cleanest way to do this seems to be to serialize my Python strings to JSON. However, json.dump doesn't like my bytestrings, despite fiddling with the ensure_ascii and encoding parameters. Is there a way to encode bytestrings to Unicode strings that preserves ordinal character values? Otherwise I think I need to encode the characters above the ASCII range into JSON-style \u1234 escapes; but a codec like this does not seem to be among Python's codecs. Is there an easy way to serialize Python bytestrings to JSON, preserving char values, or do I need to write my own encoder?

    Read the article

  • Whats happening to my HTML?

    - by user156814
    I am making changes to my website, and I just noticed that things look different. In IE, the content doesnt center, theres a margin on my content, and the font looks bigger in chrome.. I ran it through Yahoo's HTML validator and the error I get is line 1 - Error: character "" not allowed in prolog. I believe that there may be some sort of whitespace being sent before the DOC TYPE, but I cant seem to fix it. The HTML looks fine in my text editor (Notepad++) so I dont know what the problem is. Im using a strict DOC Type. Everything was fine before I made any changes, but I cant pinpoint what caused the change. If it helps, I'm using a Framework (Kohana). My initial thought was that something was being sent to the browser by an echo or something, but I couldnt find any echo statements. I dont know what could be causing this... If you want to see any code or HTML just ask. Thanks. Heres the HTML (only head and doctype) via the page source in Google Chrome There seems to be some foreign characters in the source that I've never seen before, yet dont show up anywhere else (yahoo, or otherwise) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Recent Debates - Clashing Thoughts</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="en-us" /> <meta name="description" content="Clashing Thoughts is a great place to argue! Search topics you feel passionate about, pick where you stand on the issue and get your point across. The votes are tallied up for every debate so you can even see which side is most popular." /> <meta name="keywords" content="debates, arguments, topics, popular topics, popular debates, surveys, choices" /> <link rel="stylesheet" type="text/css" href="http://localhost/css/master.css" media="screen" /> <link rel="stylesheet" type="text/css" href="http://localhost/css/clashingthoughts.css" media="screen" /> <link rel="icon" type="image/x-icon" href="http://localhost/images/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="http://localhost/images/favicon.ico" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head>

    Read the article

  • complex mysql query problem

    - by Scarface
    Hey guys I have a query that selects data and organizes but not in the correct order. What I want to do is select all the comments for a user in that week and sort it by each topic, then sort the cluster by the latest timestamp of each comment in their respective cluster. My current query selects the right data, but in seemingly random order. Does anyone have any ideas? select * from ( SELECT topic.topic_title, topic.topic_id FROM comments JOIN topic ON topic.topic_id=comments.topic_id WHERE comments.user='$user' AND comments.timestamp>$week order by comments.timestamp desc) derived_table group by topic_id

    Read the article

  • exceptions with python unicode encode/decode functions (why doesn't errors=ignore actually ignore th

    - by gatoatigrado
    Does anyone know why the string conversion functions throw exceptions when errors="ignore" is passed? How can I convert from regular Python string objects to unicode without errors being thrown? Thanks very much! python -c "import codecs; codecs.open('tmp', 'wb', encoding='utf8', errors='ignore').write('?????')" returns Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/codecs.py", line 686, in write return self.writer.write(data) File "/usr/lib/python2.6/codecs.py", line 351, in write data, consumed = self.encode(object, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

    Read the article

  • How do I track the method the user is looking at in VS 2010 IDE as an Addin

    - by Rob
    I have been wandering around the object model for VS 2010 and haven't been able to work out the best method for watching what the user is looking at in the main edit window. I know that each Class/method/property is broken down into its own . What I would ideally like is to hook to an event which says "The user has moved the cursor onto Project.Class.Method" and ideally "and is looking at line 4". Any suggestions?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >