Search Results

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

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

  • C#: Windows Forms: Getting keystrokes in a panel/picturebox?

    - by Rosarch
    I'm making a level editor for a game using windows forms. The form has several drop down menus, text boxes, etc, where the user can type information. I want to make commands like CTRL + V or CTRL + A available for working within the game world itself, not text manipulation. The game world is represented by a PictureBox contained in a Panel. This event handler isn't ever firing: private System.Windows.Forms.Panel canvas; // ... this.canvas = new System.Windows.Forms.Panel(); // ... this.canvas.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.canvas_PreviewKeyDown); What is the preferred way of doing this? Can a panel even receive keyboard input? I would like to allow the user to use copy/paste/select-all commands when working with the text input, but not when placing objects in the game world.

    Read the article

  • Pros and cons of programmatically enforcing foreign key than in database

    - by Jeffrey
    It is causing so much trouble in terms of development just by letting database enforcing foreign key. Especially during unit test I can’t drop table due to foreign key constrains, I need to create table in such an order that foreign key constrain warning won’t get triggered. In reality I don’t see too much point of letting database enforcing the foreign key constrains. If the application has been properly designed there should not be any manual database manipulation other than select queries. I just want to make sure that I am not digging myself into a hole by not having foreign key constrains in database and leaving it solely to the application’s responsibility. Am I missing anything? P.S. my real unit tests (not those that use mocking) will drop existing tables if the structure of underlying domain object has been modified.

    Read the article

  • ASP.NET access files on another computer shared folder

    - by Tomas
    Hello, I have ASP.NET project which do some file access and manipulation, the methods which I use for file access are below. Now I need to access files on another server shared folder, how to do that? I easily can change file path to shared folder path but I get "can't access" error because shares are password protected. As I understand I need somehow to send credentials to remote server before executing methods below. How to do that? FileStream("c:\MyProj\file.doc", FileMode.OpenOrCreate, FileAccess.Write) Context.Response.TransmitFile("c:\MyProj\file.doc"); Regards, Tomas

    Read the article

  • Shell Script Sequencing with Rake

    - by Haseeb Khan
    Hi All, I am working on a rake utility and want to implement something mentioned below: There are some shell commands in a sequence in my Rake file. What I want is that the sequence should wait for the previous command to finish processing before it moves to the next one. sh "git commit -m \"#{args.commit_message}\"" do |ok, res| # Do some processing end sh "git push heroku master" So, in the above example what I want is that sh "git push heroku master" shouldn't be executed until the processing in the sh "git commit -m \"#{args.commit_message}\"" do |ok, res| # Do some processing end is completed. Also another nice to have would be that if I can store the output of the shell command in a Ruby variable so it can be used in further manipulation if required. Looking forward to a reply from the fellow community member shortly. Thanks in advance.

    Read the article

  • XML/XHTML replace content?

    - by Daveo
    I have a XHTML string I want to replace tags in for example <span tag="x">FOO</span> <span tag="y"> <b>bar</b> some random text <span>another span</span> </span> I want to be able to find tag="x" and replace FOO with my own content and find tag=y and replace all the inner content with by own content. What is the best way to do this? I am thinking regex is definitely out of the question. Can XPATH do this or is that just for searching can it do manipulation?

    Read the article

  • Looking for the most painless non-RDBMS storage method in C#

    - by NateD
    I'm writing a simple program that will run entirely client-side. (Desktop programming? do people still do that?) and I need a simple way to store trivial amounts of data in a structured form, but really don't see any need to use a database system. What's more, some of the data needs to be serialized and passed around to different users, like some kind of "file" or perhaps a "document". (has anyone ever done that before?) So, I've looked at using .Net DataSets, LINQ, direct XML manipulation, and they all seem like they would get the job done, but I would like to know before I dive into any of them if there's one method that is generally regarded as easier to code than others. As I said, the amount of data to be stored is trivial, even if one hundred people all used the same machine we're not talking about more than 10 MB, so performance is not as large a concern as is codeability/maintainability. Thank you all in advance!

    Read the article

  • Drag and drop: jQuery UI or Scriptaculous?

    - by jpartogi
    Dear all, I am in the middle of the road whether to use jQuery UI or Scriptaculous for drag and drop. I am using Ruby on Rails, and Scriptaculous support in Ruby on Rails is superb with the existence of scriptaculous_helper.rb. But I have already use jQuery for the ajax and DOM manipulation. I do not mind to use scriptaculous since we can use jQuery.noConflict() in the code. I also kind of get the impression that scriptaculous drag and drop is better than jQuery UI drag and drop based on the online demos. So back to the original question, which one would you recommend as a drag and drop library and which one do you think is better than the other? Scriptaculous or jQuery UI?

    Read the article

  • shift happens videos

    - by hasan
    im sure you guys must have seen the shift happens video series. here's a link to them : http://www.youtube.com/results?search_query=shift+happens&search_type=&aq=f also, the recent hungry beast video about google, which can be found here: (SO doesnt allow new users more than one hyperlink, so please search on youtube for this one) what i'd like to ask you guys is this: is there a program that enables such videos to be made quickly or is it really just the creative genius of the respective authors? i think vidoes like these are extremely useful when you want to make an impact and would find many uses for such a program in my line of work. im hoping somebody can point me in the right direction. ps. i DO know of animoto, so please dont suggest that :P the problem with animoto is that it doesnt allow text manipulation like these videos. to be fair, that is a great product in itself, but im sure if you take a look, you'll see the difference that im talking abuot.

    Read the article

  • Using code in both Actionscript3 and Javascript

    - by Ian
    Here's an interesting architectural query. I have a piece of code that needs to run on the server (under Node.js) and on the client (in a Flash 10 app written with Actionscript 3). The code is mostly fairly intricate object manipulation, it doesn't make any API calls, and works fine in both contexts. So far the project is just a demo, so I've been happy to copy and paste the code into both places. But it might be quite interesting to move forward with this. So how would you do it? I assume there is no easy way to get the Flash SDK (has to build without an IDE) to read and do something useful with a .js file. My only thought is that I could write a code-generator that takes the .js file and places it in an ActionScript wrapper. Are there any obvious approaches that I've missed? Just to pre-empt an obvious answer, I know about cross-platform languages like HaXe.

    Read the article

  • how to run/compile java code from JTextArea at Runtime? ----urgent!!! college project

    - by Lokesh Kumar
    I have a JInternalFrame painted with a BufferedImage and contained in the JDesktopPane of a JFrame.I also have a JTextArea where i want to write some java code (function) that takes the current JInternalFrame's painted BufferedImage as an input and after doing some manipulation on this input it returns another manipulated BufferedImage that paints the JInternalFrame with new manipulated Image again!!. Manipulation java code of JTextArea:- public BufferedImage customOperation(BufferedImage CurrentInputImg) { Color colOld; Color colNew; BufferedImage manipulated=new BufferedImage(CurrentInputImg.getWidth(),CurrentInputImg.getHeight(),BufferedImage.TYPE_INT_ARGB); //make all Red pixels of current image black for(int i=0;i< CurrentInputImg.getWidth();i++) { for(int j=0;j< CurrentInputImg.getHeight(),j++) { colOld=new Color(CurrentInputImg.getRGB(i,j)); colNew=new Color(0,colOld.getGreen(),colOld.getBlue(),colOld.getAlpha()); manipulated.setRGB(i,j,colNew.getRGB()); } } return manipulated; } so,how can i run/compile this JTextArea java code at runtime and get a new manipulated image for painting on JInternalFrame???????   Here is my Main class: (This class is not actual one but i have created it for u for basic interfacing containing JTextArea,JInternalFrame,Apply Button) import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.JInternalFrame; import javax.swing.JDesktopPane; import java.awt.image.*; import javax.imageio.*; import java.io.*; import java.io.File; import java.util.*; class MyCustomOperationSystem extends JFrame **{** public JInternalFrame ImageFrame; public BufferedImage CurrenFrameImage; public MyCustomOperationSystem() **{** setTitle("My Custom Image Operations"); setSize((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(),(int)Toolkit.getDefaultToolkit().getScreenSize().getHeight()); JDesktopPane desktop=new JDesktopPane(); desktop.setPreferredSize(new Dimension((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(),(int)Toolkit.getDefaultToolkit().getScreenSize().getHeight())); try{ CurrenFrameImage=ImageIO.read(new File("c:/Lokesh.png")); }catch(Exception exp) { System.out.println("Error in Loading Image"); } ImageFrame=new JInternalFrame("Image Frame",true,true,false,true); ImageFrame.setMinimumSize(new Dimension(CurrenFrameImage.getWidth()+10,CurrenFrameImage.getHeight()+10)); ImageFrame.getContentPane().add(CreateImagePanel()); ImageFrame.setLayer(1); ImageFrame.setLocation(100,100); ImageFrame.setVisible(true); desktop.setOpaque(true); desktop.setBackground(Color.darkGray); desktop.add(ImageFrame); this.getContentPane().setLayout(new BorderLayout()); this.getContentPane().add("Center",desktop); this.getContentPane().add("South",ControlPanel()); pack(); setVisible(true); **}** public JPanel CreateImagePanel(){ JPanel tempPanel=new JPanel(){ public void paintComponent(Graphics g) { g.drawImage(CurrenFrameImage,0,0,this); } }; tempPanel.setPreferredSize(new Dimension(CurrenFrameImage.getWidth(),CurrenFrameImage.getHeight())); return tempPanel; } public JPanel ControlPanel(){ JPanel controlPan=new JPanel(new FlowLayout(FlowLayout.LEFT)); JButton customOP=new JButton("Custom Operation"); customOP.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent evnt){ JFrame CodeFrame=new JFrame("Write your Code Here"); JTextArea codeArea=new JTextArea("Your Java Code Here",100,70); JScrollPane codeScrollPan=new JScrollPane(codeArea,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); CodeFrame.add(codeScrollPan); CodeFrame.setVisible(true); } }); JButton Apply=new JButton("Apply Code"); Apply.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ // What should I do!!! Here!!!!!!!!!!!!!!! } }); controlPan.add(customOP); controlPan.add(Apply); return controlPan; } public static void main(String s[]) { new MyCustomOperationSystem(); } } Note: in above class JInternalFrame (ImageFrame) is not visible even i have declared it visible. so, ImageFrame is not visible while compiling and running above class. U have to identify this problem before running it.

    Read the article

  • As our favorite imperative languages gain functional constructs, should loops be considered a code s

    - by Michael Buen
    In allusion to Dare Obasanjo's impressions on Map, Reduce, Filter (Functional Programming in C# 3.0: How Map/Reduce/Filter can Rock your World) "With these three building blocks, you could replace the majority of the procedural for loops in your application with a single line of code. C# 3.0 doesn't just stop there." Should we increasingly use them instead of loops? And should be having loops(instead of those three building blocks of data manipulation) be one of the metrics for coding horrors on code reviews? And why? [NOTE] I'm not advocating fully functional programming on those codes that could be simply translated to loops(e.g. tail recursions) Asking for politer term. Considering that the phrase "code smell" is not so diplomatic, I posted another question http://stackoverflow.com/questions/432492/whats-the-politer-word-for-code-smell about the right word for "code smell", er.. utterly bad code. Should that phrase have a place in our programming parlance?

    Read the article

  • Essential skills of a Data Scientist

    - by harshsinghal
    I would like to know more about the relevant skills in the arsenal of a Data Scientist, and with new technologies coming in every day, how one picks and chooses the essentials. A few ideas germane to this discussion: Knowing SQL and the use of a DB such as MySQL, PostgreSQL was great till the advent of NoSql and non-relational databases. MongoDB, CouchDB etc. are becoming popular to work with web-scale data. Knowing a stats tool like R is enough for analysis, but to create applications one may need to add Java, Python, and such others to the list. Data now comes in the form of text, urls, multi-media to name a few, and there are different paradigms associated with their manipulation. What about cluster computing, parallel computing, the cloud, Amazon EC2, Hadoop ? OLS Regression now has Artificial Neural Networks, Random Forests and other relatively exotic machine learning/data mining algos. for company Thoughts?

    Read the article

  • How to properly use Gearman with my PHP application?

    - by luckytaxi
    For now I just want to use Gearman for background processing. For example, I need to email a recipient that they have a private message waiting for them once the sender submits their message into the DB. I assume I can run the worker/client and server on my primary server but I have no problems offloading some of the tasks to a different web server. Anyways, my question is how do I handle multiple "functions?" Let's say I need a job that handles the email portion and a job to handle image manipulation. Can I have multiple functions in the worker? I've followed a couple of examples I found online but each example only shows one function being initialized. Do I have to start up multiple "workers" to handle multiple functions?

    Read the article

  • Integration of Photoshop and MySQL

    - by NewToProgrammingWorld
    I’m working to integrate Photoshop (CS4, local) with MySQL (Linux, remote), such that: a) image file information, data and meta data can be exported from PS into MySQL where same can be manipulated both manually and calculated, and then b) the MySQL fields can be referenced in Photoshop scripting for further automated image file manipulation, and c) the MySQL fields can be referenced for other purposes such as dynamic propagation of files and associated file data to a website, for example. I’ve spent many hours running searches for these concepts on StackOverflow, Google, and Adobe Support. I’m coming up empty, which leads me to believe that it’s not natively possible, and that I’ll need some middle language like PHP. Does anyone know if it’s possible for Photoshop and MySQL to bi-directionally share data? If so, how? If that’s not possible, what solution(s) might you recommend, in terms of specific tools/technologies that I can research further. Thank you.

    Read the article

  • Possible apache/mysql/php wrapper?

    - by MrStatic
    I was tasked with writing a smallish program for data input and manipulation. My language of choice happens to be PHP. I have written out the program/site it all works fine is easily portable and everything but have one question. Is there anyway to wrap up apache/mysql/php into a bundle of one exe? I know of MoWes Portable and other options but I am looking to basically wrap everything up into a single exe without much fuss to the end user. My target users are very low on the computer savvy scale. I am trying to avoid a batch file for launching and don't really want them able to shutdown one part on accident and not another (IE shut off mysql but leave apache on).

    Read the article

  • How to model a social news feed on Google App Engine

    - by PEZ
    We want to implement a "News feed" where a user can see messages broadcasted by her friends, sorted with newest message first. But the feed should reflect changes in her friends list. (If she adds new friends, messages from those should be included in the feed, and if she removes friends their messages should not be included.) If we use the pubsub-test example and attach a recipient list to each message this means a lot of manipulation of the message recipients lists when users connect and disconnect friends. We first modeled publish-subscribe "fan out" using conventional RDBMS thinking. It seemed to work at first, but then, since the IN operator works the way it does, we quickly realized we couldn't continue on that path. We found Brett Slatkin's presentation from last years Google I/O and we have now watched it a few times but it isn't clear to us how to do it with "dynamic" recipient lists. What we need are some hints on how to "think" when modeling this.

    Read the article

  • How do I limit the permissions of a C# program to read only on an SQLServer Database?

    - by gav
    Hi Guys, I have written some C# which connects to a live production database. I want to give my application read only access to the DB but am unsure how to achieve this. Is there any trivial way to get this done by amending the connection string? My understanding is that the application will logon with the credentials of the person running the application and hence may or may not have write access to the db based on that fact. Can I statically limit the permissions of the application so that if someone changes the program to do something devastating at a later date any manipulation will fail? Apologies for how trivial the question may be but it's my first venture into the world of MS programming. Thanks, Gav

    Read the article

  • Cross platform unicode path handling

    - by Matt Joiner
    I'm using boost::filesystem for cross-platform path manipulation, but this breaks down when calls need to be made down into interfaces I don't control that won't accept UTF-8. For example when using the Windows API, I need to convert to UTF-16, and then call the wide-string version of whatever function I was about to call, and then convert any output back to UTF-8. While the wpath, and other w* forms of many of the boost::filesystem functions help keep sanity, are there any suggestions for how best to handle this conversion to wide-string forms where needed, while maintaining consistency in my own code?

    Read the article

  • MOSS Collect Data from user custom email

    - by nav
    Hi, I am trying to send out a custom email, after the Collect Data from user step in my primary workflow which starts when an item in list X is created. I have created a secondary workflow to start when a new Task item is created (this is created by the Collect Data from user action in the primary workflow). But I am having problem how I retrieve the information on the list X. I know the ID of the referenced item in List X is stored in a URL within the "Link" column in the Tasks lists. But can't see any string manipulation function that will grab this ID so I can use it to link back to relevant item in List X. Is there an easier way to do this? Many Thanks, Nav

    Read the article

  • Slow page unload in IE

    - by ForYourOwnGood
    I am developing a site which creates many table rows dynamically. The total amount of rows right now is 187. Everything works fine when creating the rows, but in IE when I leave the page, there is a large amount of lag. I do not know if this is some how related to the heavy DOM manipulation I am doing in the page? I do not create any function closures when building the dynamic content's event handlers so I do not believe this problem is related to memory leaks. Any insight is much appreciated.

    Read the article

  • How to position an element so that it does not flow off the visible screen

    - by rjray
    I am creating pseudo-tooltips on a page that has a lot of "a" and "span" elements that have these tips associated with them. Everything in the creation of the element is fine, and it displays fine. However, since this is a page with a lot of data, as you get towards the bottom of the visual area the tooltips start to flow past the bottom edge of the window. My initial attempt to compensate for this with window.innerWidth/innerHeight didn't come out too well. I'm using jQuery for DOM manipulation (but not jQuery UI). Given the event itself, and the height and width of the tooltip (which I can get with getBoundingClientRect()), how can I position this element so that the bottom of the tooltip is never below the edge of the window?

    Read the article

  • Communicate between content script and options page

    - by Gaurang Tandon
    I have seen many questions already and all are about background page to content script. Summary My extension has an options page, and a content script. The content script handles the storage functionality (chrome.storage manipulation). Whenever, a user changes a setting in the options page, I want to send a message to the content script to store the new data. My code: options.js var data = "abcd"; // let data chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { chrome.tabs.sendMessage(tabs[0].id, "storeData:" + data, function(response){ console.log(response); // gives undefined :( }); }); content script js chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { // not working }); My question: Why isn't the approach not working? Is there any other (better) approach for this procedure.

    Read the article

  • Convert Date to Datetime field.

    - by infant programmer
    The argument my C# function is getting is a string which is merely a Date or a DateTime. I am suppose to convert this String to DateTime, to carry on furthure calculation. Now I need to test whether the incoming data is a Date, if it is date(examle:"12/31/2009"), then I need to add "00:00:00" (24 hours format) to it, so that it will become "12/31/2009 00:00:00". If string manipulation is one possible way, I want to confirm whether there is some other way where we can automate the testing and conversion within DateTime.TryParseExact() method. This is my sample C# code : (which is now only able to convert string of format "MM/dd/yyyy HH:mm:ss" to DateTime.) private static string[] formats = new string[] { "MM/dd/yyyy HH:mm:ss" }; public string date_conv(string date_str) { DateTime date_value; DateTime.TryParseExact(date_str, formats, new global::System.Globalization.CultureInfo("en-US"), global::System.Globalization.DateTimeStyles.None, out date_value); /*Some useful instruction to use date_value*/ return(date_value.ToString("MM/dd/yyyy HH:mm:ss")); }

    Read the article

  • Statement hierarchy in programming languages

    - by sudo
    I quickly wrote an interpreter for some sort of experimental programing language i came up with, in PHP (yes, in PHP). The language itself doesn't have anything really special, I just wanted to give it a try. I got the basic things working (Hello World, input to output, string manipulation, arithmetics) but I'm getting stuck with the management of blocks and grouped statements. What I mean is: PHP and most other languages let you do this: ((2+2)*(8+2)+2), of course not only with mathematical computations. My program structure currently consists of a multidimensional array built like this: ID => Type (Identifier, String, Int, Newline, EOF, Comma, ...) Contents (If identifier, int or string) How could I allow statements to be executed in a defined order like in the PHP example above?

    Read the article

  • How to do relative imports in Python?

    - by Joril
    Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2. How should I do it? I tried from ..sub2 import mod2 but I'm getting an "Attempted relative import in non-package". I googled around but found only "sys.path manipulation" hacks. Isn't there a clean way? Edit: all my __init__.py's are currently empty Edit2: I'm trying to do this because sub2 contains classes that are shared across sub packages (sub1, subX, etc.). Edit3: The behaviour I'm looking for is the same as described in PEP 366 (thanks John B)

    Read the article

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