Search Results

Search found 1545 results on 62 pages for 'manipulation'.

Page 50/62 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • mysql_close(): supplied argument is not a valid MySQL-Link resource

    - by Illes Peter
    Here's what I'm trying to do: I've got a db.php file that does all the db manipulation. It has 2 static methods, connect and deconnect. In my other file i simply use db::connect() and db::deconnect(). The mysql_close($con) in the deconnect method just doesn't know who $con is. Since I don't want to instantiate my class static is the only way to go. Declaring 'private $con' in class db doesn't seem to have an effect. Any ideas? class db { public static function connect() { $dbData = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/config.ini'); $con = mysql_connect($dbData['host'],$dbData['user'],$dbData['pass']); $db = mysql_select_db($dbData['db']); if ((!$con) || (!$db)) return 0; else return 1; } public static function deconnect() { mysql_close($con); } }

    Read the article

  • Idioms for a three-state toggle?

    - by Alex Mcp
    I have a table column where each row has one of three states, and the purpose of the row is to offer manipulation AND display of this property with three states. My current development view is to have three tightly packed radio buttons with labels at the head of the columns (and every 50 rows or so) and onClick they send an AJAX request and thar she blows. This is fugly. Is there a standard idiom for a control like this? I'm currently mocking up something similar to the iPhone on/off toggle, but with a "middle" state. Any input would be welcome.

    Read the article

  • AspectJ join point with simple types

    - by Jon
    Hi! Are there defined join points in arithmetics that I can catch? Something like: int a = 4; int b = 2; int c = a + b; Can I make a pointcut that catches any one of those lines? And what context will I be able to get? I would like to add a before() to all int/float/double manipulation done in a particular method on a class, is that possible. I see in the AspectJ docs that there are defined join points for object initialization and method calls. Is declaring an int an object initialization and does the + operator count as a method call? Thanks!

    Read the article

  • Easy way to replicate web page across machines?

    - by Mike_G
    I am trying to replicate a browser page to another browser on another machine. I basically want to reproduce a page exactly how it appears to a customer for viewing by the website owner. I have done this before using some impersonation trickery, but found that it would throw the session state out of wack when the site owner would switch customers. So I would like to stay away from cookie and authentication manipulation. Anybody done anything like that? Is there a way to easily transfer the DOM to a webservice? The tech/programming at my disposal are C#, javascript, WCF.

    Read the article

  • Regular expression help parsing SQLIO output

    - by jaspernygaard
    Hi I've been working on a regular expression to parse the output of a series of SQLIO runs. I've gotten pretty far, but not quite there yet. I'm seeking a 100% regex solution and no pre-manipulation of the input. Could anyone assist with a little guidance with the following regular expression: .*v(?<SQLIOVersion>\d\.\d).*\n.*\n(?<threads>\d*)\s.*for\s(?<Seconds>\d+).*\n.*using\s(?<clustersize>[0-9]*)KB.*\n.*\n.*size:\s(?<currentfilesize>\d+).*\n.*\n.*\n.*\n.*\s(?<IOs>\d*\.\d*).*\n.*\s(?<MBs>\d*\.\d*).*\n.*\n.*\s(?<MinLatency_ms>\d+).*\n.*\s(?<AvgLatency_ms>\d+).*\n.*\s(?<MaxLatency_ms>\d+).*\n.*\n.*\n\%\:..(?<ms>\d*\s+)* Here's a snippet of the output - note the headers, which change during the SQLIO batch run: File

    Read the article

  • How do I alternate table row colors in asp.net mvc using jquery?

    - by grenade
    Probably a dumb question but I'm new to MVC and jQuery. I want to alternate the row colors of my tables and I've decided that I'm going to use jQuery to do it. I know that I could write an extension method (http://haacked.com/archive/2008/08/07/aspnetmvc_cycle.aspx), etc but after reading SH's comment on the article at http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc.aspx I've picked jQuery as the solution I want to implement. I want to implement the method described at http://www.packtpub.com/article/jquery-table-manipulation-part2 but I haven't figured out where to put the initial jQuery call (eg: $(document).ready(function() {...}); Like I said, I'm new to jQuery...

    Read the article

  • Silverlight/WPF: Retreiving the size of a `UIElement` once it has been rendered on screen

    - by ondesertverge
    I have the following simple piece of code: var canvas = new Canvas(); foreach (var ztring in strings) { var textblock = new TextBlock(); textblock.Text = ztring; panel.Children.Add(textblock); textblock.Measure(infiniteSize); } At this point I would expect any of the size properties (Height/Width, ActualHeight/ActualWidth, DesiredSize, RenderSize) to give me the size of the textblock. None of them do. ActualHeight always gives 16.0 no matter what size font. ActualWidth changes according to the text length but not the font size. I change the font size on the parent container and not the TextBlock itself. I feel like I am missing some basic element of understanding the manipulation of silverlight elements from within the codebehind. The question is: how do I get the real actual pixel size of my TextBlock?

    Read the article

  • A 'do' statement at the end of my perl script never runs

    - by Jeremy Petzold
    In my main script, I am doing some archive manipulation. Once I have completed that, I want to run a separate script to upload my archives to and FTP server. Separately, these scripts work well. I want to add the FTP script to the end of my archive script so I only need to worry about scheduling one script to run and I want to guarantee that the first script completes it work before the FTP script is called. After looking at all the different methods to call my FTP script, I settled on 'do', however, when my do statement is at the end of the script, it never runs. When I place it in my main foreach loop, it runs fine, but it runs multiple times which I want to avoid since the FTP script can handle having multiple archives to upload. Is there something I am missing? Why does it not run? Thanks

    Read the article

  • Using WPF class in a web application, problem with hosting permission

    - by tanathos
    I'm developing a DLL that uses WPF classes to make image manipulation. It works fine in my local environment, but when I try to use it in an hosted web site I retrieve this error: Request for the permission of type 'System.Security.Permissions.MediaPermission, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' failed. exactly when I try to call the EndInit() of a BitmapImage object: BitmapImage originalImage = new BitmapImage(); originalImage.BeginInit(); originalImage.CacheOption = BitmapCacheOption.OnLoad; originalImage.UriSource = new Uri(physical_imagepath); originalImage.EndInit(); Any suggestion?

    Read the article

  • How can I return JSON from node.js backend to frontend without reloading or re-rendering the page?

    - by poleapple
    I am working with node.js. I want to press a search button, make some rest api calls to another server in the backend and return the json back to the front end, and reload a div in the front end so that I won't have to refresh the page. Now I know I can reload just a div with jQuery or just Javascript dom manipulation. But how do I make it call a method on the server side? I could have a submit button and it will make a post request and I can catch it and make my api calls from there, however from the node.js side, when I return, I will have to render the page again. How do I go about returning JSON from the back end to the front end without re-rendering or refreshing my page? Thanks.

    Read the article

  • What is the best way to maintain an entity's original properties when they are not included in MVC binding from edit page?

    - by kingdango
    I have an ASP.NET MVC view for editing a model object. The edit page includes most of the properties of my object but not all of them -- specifically it does not include CreatedOn and CreatedBy fields since those are set upon creation (in my service layer) and shouldn't change in the future. Unless I include these properties as hidden fields they will not be picked up during Binding and are unavailable when I save the modified object in my EF 4 DB Context. In actuality, upon save the original values would be overwritten by nulls (or some type-specific default). I don't want to drop these in as hidden fields because it is a waste of bytes and I don't want those values exposed to potential manipulation. Is there a "first class" way to handle this situation? Is it possible to specify a EF Model property is to be ignored unless explicitly set?

    Read the article

  • How can Excel 2007 / 2010 consume a REST web service?

    - by jallen
    What options exist to consume a REST web service from within Excel 2007 / 2010? I can use XML Maps to consume a basic XML list, but that doesn't let me build a dynamic URL (so I could include parameters). For example, I can add an XML Map to Excel for http://machine/service/level/5 and display the values in the workbook just fine - no problem there. The real question is, how can I dynamically change the /5 part of the URL to come from another cell in excel? That way I can have a couple of cells that have the options (what ID, what name, etc.) and whenever those values change (ideally) a new dynamic URL would be constructed and the XML map would be refreshed. Is such a thing possible? Does anyone else have a better way to take some parameters, call a web service (REST or SOAP, I'm not picky) and shove the results back into excel for further manipulation?

    Read the article

  • c++ library for endian-aware reading of raw file stream metadata?

    - by Kache4
    I've got raw data streams from image files, like: vector<char> rawData(fileSize); ifstream inFile("image.jpg"); inFile.read(&rawData[0]); I want to parse the headers of different image formats for height and width. Is there a portable library that can can read ints, longs, shorts, etc. from the buffer/stream, converting for endianess as specified? I'd like to be able to do something like: short x = rawData.readLeShort(offset); or long y = rawData.readBeLong(offset) An even better option would be a lightweight & portable image metadata library (without the extra weight of an image manipulation library) that can work on raw image data. I've found that Exif libraries out there don't support png and gif.

    Read the article

  • ASP.NET: How to assign ID to a field in DetailsView?

    - by jawonlee
    I have a master-detail page, in which I use GridView to display multiple rows of data, and DetailsView + jQuery dialog to display the details of a single records. only one DetailsView is open at a time. I need to be able to pull out a single field of the open DetailsView, for manipulation using JavaScript. Is there a way to give a unique ID to a given field in DetailsView, so I can use getElementByID? Or is there another way to accomplish what I'm trying to do? Thank you in advance.

    Read the article

  • Multivalue Mysql Inserts using HibernateTemplate

    - by Langali
    I am using Spring HibernateTemplate and need to insert hundreds of records into a mysql database every second. Not sure what is the most performant way of doing it, but I am trying to see how the multi value mysql inserts do using hibernate. String query = "insert into user(age, name, birth_date) values(24, 'Joe', '2010-05-19 14:33:14'), (25, 'Joe1', '2010-05-19 14:33:14')" getHibernateTemplate().execute(new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { return session.createSQLQuery(query).executeUpdate(); } }); But I get this error: 'could not execute native bulk manipulation query.' Please check your query ..... Any idea of I can use a multi value mysql insert using Hibernate? or is my query incorrect? Any other ways that I can improve the performance? I did try the saveOrUpdateAll() method, and that wasn't good enough!

    Read the article

  • Is there a variable in Rails that equates to the template that is being rendered?

    - by Sean Ahrens
    I can do request.path_parameters['controller'] and request.path_parameters['action'], but is there anything like request.path_parameters['template'] so I can discern which template file (such as index.html.erb) is being rendered? I'm writing a method that automatically sets the body id to the template being rendered, for easy css manipulation: class ApplicationController < ActionController::Base ... after_filter :define_body_selector ... def define_body_selector # sets @body_id to the name of the template that will be rendered # ie. if users/index.html.erb was just rendered, @body_id gets set to "index" @body_id = ??? end ...

    Read the article

  • Why doesn't MySQL support millisecond / microsecond precision?

    - by Byron Whitlock
    So I just found the most frustrating bug ever in MySQL. Apparently the TIMESTAMP field, and supporting functions do not support any greater precision than seconds!? So I am using PHP and Doctrine, and I really need those microseconds (I am using the actAs: [Timestampable] property). I found a that I can use a BIGINT field to store the values. But will doctrine add the milliseconds? I think it just assigns NOW() to the field. I am also worried the date manipulation functions (in SQL) sprinkled through the code will break. I also saw something about compiling a UDF extension. This is not an acceptable because I or a future maintainer will upgrade and poof, change gone. Has anyone found a suitable workaround?

    Read the article

  • How does c# type safety affect the garbage collection?

    - by Indeera
    I'm dealing with code that handles large buffers ( 100MB) and manipulation of these is done in unsafe blocks. I'd like to refactor these to avoid unsafe code. I'm wondering about the likely memory performance gains (positive/negative/neutral) before I embark on that. I assert that if the compiler can verify types, it could possibly generate better code and that could also mean good GC performance. Is this a valid assertion? What is your experience? Thanks.

    Read the article

  • jQuery - get a list of values of an attribute from elements of a class

    - by Ankur
    I have a class called object which has an element called 'level'. I want to get a list of all the different values of level on the page so I can select the highest one. If I do something like: $(".object").attr("level") will that get me a list of values that are the values of the level attribute? I suspect not, but then how do you do something like that. Note: I don't want to select an HTML object for manipulation as is more common, rather I want to select values of the attribute.

    Read the article

  • How to load an image in matlab from java

    - by Ian
    Basically I am trying to create a little program that will allow me to make calls in matlab from a jave GUI It's mainly going to be used for image manipulation and deblurring but I am struggling to find a way that will effectively give me full matlab control from the java end I am hoping to have it work like so: { //create matlab execution call String loadImage = " image1 = imread ('imageOnComputer.jpg'); "; //send instruction to matlab and save the path to it so java can //use the newly created variable resultingVariablePath = java.sendInstructionToMatlab(loadImage); //display on the screen java.displayImage(resultingVariablePath); } Basically I am just trying to find out if there is a plugin for matlab (or some java package) that will grant you (pretty much) full control over matlab.

    Read the article

  • Java reduce CPU usage

    - by steve
    Greets- We gots a few nutters in work who enjoy using while(true) { //Code } in their code. As you can imagine this maxes out the CPU. Does anyone know ways to reduce the CPU utilization so that other people can use the server as well. The code itself is just constantly polling the internet for updates on sites. Therefore I'd imagine a little sleep method would greatly reduce the the CPU usage. Also all manipulation is being done in String objects (Java) anyone know how much StringBuilders would reduce the over head by? Thanks for any pointers

    Read the article

  • Good way to parse query string

    - by m.edmondson
    I have a String that contains the following: ?workarea=London+&+Home+Counties+Ltd&sub=fs&&&FASh*5 which resembles a URI query string. What is the best way to parse the elements of this string (workarea and sub) without messing about with string manipulation? If I use HttpUtility.ParseQueryString is gets stuck as both elements include &. However if I encode the whole thing first I lose the seperations of the elements. Ideally the output would be: workarea = London & Home Counties Ltd sub = fs&&&FASh*5

    Read the article

  • Which JavaScript Libraries do not rely on a document and navigator object?

    - by Julian Weimer
    I'm currently looking for some libraries which might help me during iPhone Development using Appcelerator Titanium. I've heard that since version 1.0 it isn't dependant on webkit anymore and it makes app-development more exiting of course, please correct me if i'm wrong. As many people out there i love Javascript Frameworks such as JQuery and Mootools much, but they were build specifically to do a great job within a browser and most of the functionality is not needed within the environment Titanium now provides (DOM-Manipulation etc). Is there any other small library of useful functions i can use for development? Thx in advance.

    Read the article

  • How to convert "9:00 PM EST" to a Date object

    - by Bara
    I am developing an Android application and require some basic datetime manipulation. I have a Date object (from Java.util.Date) holding a specific date. I need to add a specific time to it. The time I have is a string in this format: "9:00 PM EST" How would I "add" this time to the previous date? If the Date object currently has: "4/24/10 00:00:00" How would I change it to instead be: "4/24/10 09:00:00 EST" I would prefer to do this without the use of an external library, if possible.

    Read the article

  • How can i keep a data table thorough out my page?

    - by Jibu P C_Adoor
    Hii, I have a data table, and this datatable will be dynamically manipulated. After certain manipulation at the end we will populate that to the database. Which state mechanism can i use for this to retain. I have tried both Session and ViewState but ViewState can't use with AJAX rich appplications. Session will be clear after the user session. i can't afford both these difficulties. Does any other mechanism to keep the datatable through out the page.

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >