Daily Archives

Articles indexed Saturday March 20 2010

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

  • Posting from JQuery to WCF Service

    - by Villager
    Hello, I have a WCF Service (called "myservice.svc") that takes a message from a user and saves it to the database. It returns a response to the user in the form of a number. This operation looks like this: [OperationContract] [WebGet] public string SubmitMessage(string message) { try { // SAVE TO DATABASE return "1"; } catch (Exception ex) { return "0"; } } I want to call this operation from some JQuery. I'm using the approach shown here: $.getJSON( "/services/myService.svc", {message:"some text"}, function (data) { alert("success"); } ); Oddly, the "success" alert is never displayed. In addition, I have set a breakpoint in my WCF service and it is never being tripped. What am I doing wrong? Thank you

    Read the article

  • Re-Convert timestamp DATE back to original format (when editing) PHP MySQL

    - by Jess
    Ok so I have managed to get the format of the date presented in HTML (upon display) to how I want (dd/mm/yyy)...However, the user also can change the date via a form. So this is how it's setup as present. Firstly, the conversion from YYYY-MM-DD to DD/MM/YYYY and then display in HTML: $timestamp = strtotime($duedate); echo date('d/m/Y', $timestamp); Now when the user selects to update the due date, the value already stored value is drawn up and presented in my text field (using exactly the same code as above).. All good so far. But when my user runs the update script (clicks submit), the new due date is not being stored, and in my DB its seen as '0000-00-00'. I know I need to convert it back to the correct format that MySQL wants to have it in, in order for it to be saved, but I'm not sure on how to do this. This is what I have so far in my update script (for the due date): $duedate = $_POST['duedate']; $timestamp = strtotime($duedate); date('Y/m/d', $timestamp); $query = "UPDATE films SET filmname= '".$filmname."', duedate= '".$duedate; Can somebody please point me in the right direction to have the new date, when processed, converted back to the accepted format by MySQL. I appreciate any help given! Thanks.

    Read the article

  • SQL Server 2005 Reporting Services (x64) on Windows 2K8 -> CleanCurrentUserName() not found

    - by Steven Pardo
    I have installed SQL Server 2005 three times now on the same box. I cleaned up registry settings, files, you name it. All along I have been trying to install SQL Server 2005 Database and Reporting Services (x64) on a Windows 2008 Server. I have also applied the SP3 patch. Installing and Restarting the Server at every point. I have installed multiple instances (SQLDEV64, SQLQA64, SQLSTAGE64) of the Database and Reporting Services. I started to go through the Reporting Services Configuration manager, installing the Reporting Database along with setting up IIS. When I go test the website I get the following and there lies my question. How can I get around this error? http://localhost/reportserver Reporting Services Error -------------------------------------------------------------------------------- An internal error occurred on the report server. See the error log for more details. (rsInternalError) Method not found: 'Void Microsoft.ReportingServices.Diagnostics.UserUtil.CleanCurrentUserName()'. -------------------------------------------------------------------------------- SQL Server Reporting Services Any help would be greatly appreciated.

    Read the article

  • .NET Reference "Copy Local" True / False Being Set Based on Contents of GAC

    - by D-Sect
    We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the Global Assembly Cache. When I checked the solution's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automatically because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that reference that DLL will change from Copy Local TRUE to FALSE.

    Read the article

  • MySql Query lag time?

    - by Click Upvote
    When there are multiple PHP scripts running in parallel, each making an UPDATE query to the same record in the same table repeatedly, is it possible for there to be a 'lag time' before the table is updated with each query? I have basically 5-6 instances of a PHP script running in parallel, having been launched via cron. Each script gets all the records in the items table, and then loops through them and processes them. However, to avoid processing the same item more than once, I store the id of the last item being processed in a seperate table. So this is how my code works: function getCurrentItem() { $sql = "SELECT currentItemId from settings"; $result = $this->db->query($sql); return $result->get('currentItemId'); } function setCurrentItem($id) { $sql = "UPDATE settings SET currentItemId='$id'"; $this->db->query($sql); } $currentItem = $this->getCurrentItem(); $sql = "SELECT * FROM items WHERE status='pending' AND id > $currentItem'"; $result = $this->db->query($sql); $items = $result->getAll(); foreach ($items as $i) { //Check if $i has been processed by a different instance of the script, and if so, //leave it untouched. if ($this->getCurrentItem() > $i->id) continue; $this->setCurrentItem($i->id); // Process the item here } But despite of all the precautions, most items are being processed more than once. Which makes me think that there is some lag time between the update queries being run by the PHP script, and when the database actually updates the record. Is it true? And if so, what other mechanism should I use to ensure that the PHP scripts always get only the latest currentItemId even when there are multiple scripts running in parrallel? Would using a text file instead of the db help?

    Read the article

  • Django select distinct sum

    - by yoshi
    I have the following (greatly simplified) table structure: Order: order_number = CharField order_invoice_number = CharField order_invoice_value = CharField An invoice number can be identical on more than one order (order O1 has invoice number I1, order O2 has invoice number I1, etc.). All the orders with the same invoice number have the same invoice value. For example: Order no. Invoice no. Value O1 I1 200 O2 I1 200 O3 I1 200 04 I2 50 05 I2 100 What I am trying to do is do a sum over all the invoice values, but don't add the invoices with the same number more than once. The sum for the above items would be: 200+50+100. I tried doing this using s = orders.values('order_invoice_id').annotate(total=Sum('order_invoice_value')).order_by() and s = orders.values('order_invoice_id').order_by().annotate(total=Sum('order_invoice_value')) but I didn't get the desired result. I tried a few different solutions from similar questions around here but I couldn't get the desired result. I can't figure out what I'm doing wrong and what I actually should do to get a sum that uses each invoice value just once.

    Read the article

  • How to speedup perforce auto resolve?

    - by Sorin Sbarnea
    I would like to know how to speedup the perforce auto resolve when doing integration (merge yours and theirs if no conflicts exists). Currently is taking hours for ~5000 files when running it using a proxy server even if the proxy server has the files pre-cached. Also p4v interface doesn't give you any hint regarding the progress of the task, you do not know if it will finish in a second or next year.

    Read the article

  • Linq: Why won't Group By work when Querying DataSets?

    - by jrcs3
    While playing with Linq Group By statements using both DataSet and Linq-to-Sql DataContext, I get different results with the following VB.NET 10 code: #If IS_DS = True Then Dim myData = VbDataUtil.getOrdersDS #Else Dim myData = VbDataUtil.GetNwDataContext #End If Dim MyList = From o In myData.Orders Join od In myData.Order_Details On o.OrderID Equals od.OrderID Join e In myData.Employees On o.EmployeeID Equals e.EmployeeID Group By FullOrder = New With { .OrderId = od.OrderID, .EmployeeName = (e.FirstName & " " & e.LastName), .ShipCountry = o.ShipCountry, .OrderDate = o.OrderDate } _ Into Amount = Sum(od.Quantity * od.UnitPrice) Where FullOrder.ShipCountry = "Venezuela" Order By FullOrder.OrderId Select FullOrder.OrderId, FullOrder.OrderDate, FullOrder.EmployeeName, Amount For Each x In MyList Console.WriteLine( String.Format( "{0}; {1:d}; {2}: {3:c}", x.OrderId, x.OrderDate, x.EmployeeName, x.Amount)) Next With Linq2SQL, the grouping works properly, however, the DataSet code doesn't group properly. Here are the functions that I call to create the DataSet and Linq-to-Sql DataContext Public Shared Function getOrdersDS() As NorthwindDS Dim ds As New NorthwindDS Dim ota As New OrdersTableAdapter ota.Fill(ds.Orders) Dim otda As New Order_DetailsTableAdapter otda.Fill(ds.Order_Details) Dim eda As New EmployeesTableAdapter eda.Fill(ds.Employees) Return ds End Function Public Shared Function GetNwDataContext() As NorthwindL2SDataContext Dim s As New My.MySettings Return New NorthwindL2SDataContext(s.NorthwindConnectionString) End Function What am I missing? If it should work, how do I make it work, if it can't work, why not (what interface isn't implemented, etc)?

    Read the article

  • Windows 7 BSOD at same occasions

    - by Tarnschaf
    Since I installed Win7 on my DELL Inspiron 1520 notebook, I frequently experience BSODs. I noticed that those nearly only happen on two occasions disconnecting a Bluetooth DUN connection selecting a file for upload in a browser (i.e. clicking on the button, shortly after the file dialog opened) The BSOD doesn't appear always on these actions. BluescreenView told me that most of the time it is srv2.sys+45883 or srv2.sys+42982 or ntoskrnl.exe+71f00 Now I read that srv2.sys is for NETBIOS sharing, which could be triggered when opening the file open dialog. All unused NICs are deactivated. Any ideas how to fix this?

    Read the article

  • Excel 2007 - Closing Using The Close Button When Using Personal.xlsb To Store Marcos

    - by XXXXXXXXXXXXXXXXX
    When I create and store macros in Excel 2007 using the Personal file in the XLstart folder then open and go to close Excel using the close buttom in the upper right hand corner I now have to click it twice to completely close Excel however if I use the Excel Exit button by clicking on the Office 2007 button first Excel will close on one. Is there away I can store macros for use with all workbooks I open with Excel and be able to close on one from the close button in the upper right hand corner after saving the current workbook I have be working on?

    Read the article

  • Change SVG Colour

    - by Rick
    I've never used SVG so I'm wondering if this is even possible, but can you change the color of a shape inside? Currently I'm using a PNG that I have to manually create in photoshop for each different menu and I'm wondering if I can make the whole process dynamic. Thanks!

    Read the article

  • mysql count query

    - by S.PRATHIBA
    Hi all, i have the following table: mysql select * from consumer1; Service_ID | Service_Type | consumer_feedback 31 Printer -1 34 Printer 0 31 Printer 0 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 34 Printer 1 I need a query such that I need THE COUNT(Service_ID)=2 AS Service_ID is 31 and 34.Please help me and give me some suggestions.

    Read the article

  • cpptask ordering of static libraries in gcc command line

    - by AC
    How do I force cpptask to move the static libraries to the end on arg list issued to the compiler? Here is the clause I am using <cpptasks:cc description="appname" subsystem="console" objdir="obj" outfile="dist/app_test"> <compiler refid="testsslcc" /> <linkerarg value="-L${libdir}" /> <linkerarg value="-L/usr/local/devl/lib" /> <linkerarg value="-Wl,-rpath,../lib" /> <libset libs="unittest ${libs} dsg readline ncurses gcov" /> <fileset dir="test/obj" includes="main.o" /> <fileset dir="." includes="${TCFILES}" /> <fileset dir="../lib" includes="libboost_thread.a libboost_date_time.a" /> </cpptasks:cc> when this executes, libboost_thread.a libboost_date_time.a are first files in the argument list passed the compiler, gcc -ggdb -Wl,-export-dynamic -Wshadow -Wno-format-y2k ../../lib/libboost_date_time.a ../../lib/libboost_thread.a x.cpp ... which causes compiler error. By manually moving them to the end of the argument list, the application compiles without error. gcc -ggdb -Wl,-export-dynamic -Wshadow -Wno-format-y2k x.cpp ... ../../lib/libboost_date_time.a ../../lib/libboost_thread.a And yes I have tried changing the order in the xml, and that of course didn't work. For now I am using an exec task to call gcc with the files in the correct order but this of course is a hack.

    Read the article

  • Correct way to (re)launch a Java application with hardware-dependent VM parameters?

    - by LowLevelAbstraction
    EDIT I don't want to use Java Web Start I've got a Java application that I'd like to run with different VM parameters depending on the amount of memory the system it is launched on has. For example if the machine has 1 GB of memory or less I'd like to pass "-Xmx200m" and "-Xmx400m" if it has 2 GB and "-Xmx800m" if it has 8 GB (these are just examples). Is there a portable way to do this? I've tried having a first tiny Java app (hence portable) that determines the amount of memory available and then launches a new Java app but I don't think this is very clean. As of now I've written Bash shell scripts that invoke the Java app with the correct parameters depending on the config but it only works on Linux on OS X. What is the correct way to solve this? Would application packager package ;) help ?

    Read the article

  • MySql Query lag time / deadlock?

    - by Click Upvote
    When there are multiple PHP scripts running in parallel, each making an UPDATE query to the same record in the same table repeatedly, is it possible for there to be a 'lag time' before the table is updated with each query? I have basically 5-6 instances of a PHP script running in parallel, having been launched via cron. Each script gets all the records in the items table, and then loops through them and processes them. However, to avoid processing the same item more than once, I store the id of the last item being processed in a seperate table. So this is how my code works: function getCurrentItem() { $sql = "SELECT currentItemId from settings"; $result = $this->db->query($sql); return $result->get('currentItemId'); } function setCurrentItem($id) { $sql = "UPDATE settings SET currentItemId='$id'"; $this->db->query($sql); } $currentItem = $this->getCurrentItem(); $sql = "SELECT * FROM items WHERE status='pending' AND id > $currentItem'"; $result = $this->db->query($sql); $items = $result->getAll(); foreach ($items as $i) { //Check if $i has been processed by a different instance of the script, and if so, //leave it untouched. if ($this->getCurrentItem() > $i->id) continue; $this->setCurrentItem($i->id); // Process the item here } But despite of all the precautions, most items are being processed more than once. Which makes me think that there is some lag time between the update queries being run by the PHP script, and when the database actually updates the record. Is it true? And if so, what other mechanism should I use to ensure that the PHP scripts always get only the latest currentItemId even when there are multiple scripts running in parrallel? Would using a text file instead of the db help?

    Read the article

  • How to increase the startup speed of the delphi app?

    - by Olaf
    What do you do to increase startup speed (or to decrease startup time) of your Delphi app? Other than application specific, is there a standard trick that always works? Note: I'm not talking about fast algorithms or the likes. Only the performance increase at startup, in terms of speed.

    Read the article

  • OpenGL - drawing 2D polygons shapes with texture

    - by plonkplonk
    I am trying to make a few effects in a C+GL game. So far I draw all my sprites as a quad, and it works. However, I am trying to make a large ring appear at times, with a texture following that ring, as it takes less memory than a quad with the ring texture inside. The type of ring I want to make is not a round-shaped GL mesh ring (the "tube" type) but a "paper" 2D ring. That way I can modify the "width" of the ring, getting more of the effect than a simple quad+ring texture. So far all my attempts have been...kind of ridiculous, as I don't understand GL's coordinates too well (and I can't really understand the available documentation...I am just a designer with no coder help or background. A n00b, basically). glBegin(GL_POLYGON); for(i = 0;i < 360; i += 10){ glTexCoord2f(0, 0); glVertex2f(Cos(i)*(H-10),Sin(i)H); glTexCoord2f(0, HP); glVertex2f(Sin(i)(H-10),Cos(i)*(H-10)); glTexCoord2f(WP, HP); glVertex2f(Cos(i)H,Sin(i)(H-10)); glTexCoord2f(WP, 0); glVertex2f(Sin(i)*H,Cos(i)*H); } glEnd(); This is my last attempt, and it seems to generate a "sunburst" from the right edge of the circle instead of a ring. It's an amusing effect but definitely not what I want. Other results included the circle looking exactly the same as the quad textured (aka drawing a sprite literally) or something that looked like a pop-art filter, by working on this train of thought. Seems like my logic here is entirely flawed, so, what would be the easiest way to obtain such a ring? No need to reply in code, just some guidance for a non-math-skilled user...

    Read the article

  • Why implement DB connection pointer object as a reference counting pointer? (C++)

    - by DVK
    At our company one of the core C++ classes (Database connection pointer) is implemented as a reference counting pointer. To be clear, the objects are NOT DB connections themselves, but pointers to a DB connection object. The library is very old, and nobody who designed is around anymore. So far, nether I, nor any C++ experts in the company that I asked have come up with a good reason for why this particular design was chosen. Any ideas? It is introducing some problems (partially due to awful reference pointer implementation used), and I'm trying to understand if this design actually has some deep underlying reasons? The usage pattern these days seems to be that the DB connection pointer object is returned by a DB connection manager class, and it's somewhat unclear whether DB connection pointers were designed to be able to be used independently of DB connection manager.

    Read the article

  • Software Craftsman Pilgrimage Comes Together

    - by Liam McLennan
    Last week on Software Craftsman Pilgrimage I was trying to organise where I will be travelling, and the companies I will be pairing with. I now have a confirmed itinerary. 9 - 11th April Alt.NET Seattle 12th April Craftsman visit with Didit (Long Island) 13th April rest day :) 14th April Craftsman visit with Obtiva (Chicago) 15th – 16th April Craftsman visit with 8th Light (Chicago) 17th – 18th April Seattle Code Camp I am looking forward to all of my visits and talking to all the smart people who work there. I will be blogging my progress and hopefully shooting some video. If you are in Seattle, New York or Chicago and would like to meet up to chat about craftsmanship, programming, ruby or .NET please email me.

    Read the article

  • modalpopupextender and commas appearing in my textbox asp.net

    - by SLC
    Some weird stuff is happening, I am converting an application that used to use javascript to open another web page in a tiny window for data input to use a ModalPopupExtender. It seems to work fine, but in the OK event, when I do txtData.Text (the textbox in my modal popup), it comes back with a comma before the data, so if you type "Rabbit", it comes back as ",Rabbit". Also when I use it multiple times, in another place where I might click to show it, and type "Fish", it starts coming back with stuff like ",Rabbit,,Fish" I don't know why or how to stop it from doing this... any ideas?

    Read the article

  • Pass array to client side for display

    - by Skoder
    Hey, I have an array which contains around 50-200 hyperlinks. How can I pass this array to the client-side so that I can iterate through the array and display each hyperlinks as a list item? The array will be stored in 'Application' as it's system wide and rarely changes. Could there be a more efficient way of achieving the hyperlinks as a list? Thanks

    Read the article

  • Install webapp to homescreen on iPhone?

    - by Stefan Kendall
    How do I go about allowing my webapp to be installed as an icon on a user's homescreen? Is the data cached locally, so that the webapp can be run when the user is outside of 3G? I did a quick google, but my search terms were lacking. I noticed that Google Buzz allowed me to install locally, and I'm wondering what the process is for creating web apps, and if they get special treatment (full caching/running offline).

    Read the article

  • Data loss when downloading data from LDAP server

    - by Ricky D'Amelio
    Hi there. This question comes from a previous one I asked about handling NSData objects: http://stackoverflow.com/questions/2453785/converting-nsdata-to-an-nsstring-representation-is-failing. I have reached the point where I am taking an NSImage, turning it into NSData and uploading those data bytes to the LDAP server. I am doing this like so; //connected successfully to LDAP server above... struct berval photo_berval; struct berval *jpegPhoto_values[2]; photo_berval.bv_len = [photo length]; photo_berval.bv_val = [photo bytes]; jpegPhoto_values[0] = &photo_berval; jpegPhoto_values[1] = NULL; mod.mod_type = "jpegPhoto"; mod.mod_op = LDAP_MOD_REPLACE|LDAP_MOD_BVALUES; mod.mod_bvalues = jpegPhoto_values; mods[0] = &mod; mods[1] = NULL; //perform the modify operation rc = ldap_modify_ext_s(ld, givenModifyEntry, mods, NULL, NULL); That happens with no errors, and you can see a big blob of data when you're in the command line. My problem is, when I go to access the same data at a later stage, I am getting an image file back that's about 120 times smaller than the original image. //find the jpegPhoto attribute photoA = ldap_first_attribute(ld, photoE, &photoBer); while (strcasecmp(photoA, "jpegphoto") != 0) { photoA = ldap_next_attribute(ld, photoE, photoBer); } //get the value of the attribute if ((list_of_photos = ldap_get_values_len(ld, photoE, photoA)) != NULL) { //get the first JPEG photo_data = *list_of_photos[0]; selectedPictureData = [NSData dataWithBytes:&photo_data length:sizeof(photo_data)]; [selectedPictureData writeToFile:@"/Users/username/Desktop/Photo 2.jpg" atomically:YES]; NSLog (@"%@", selectedPictureData); Has anyone successfully done this before or can anyone see what I might be doing wrong? I appreciate anyone's help. Sorry to post so many questions! Ricky.

    Read the article

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