Search Results

Search found 4722 results on 189 pages for 'john abraham'.

Page 23/189 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • beginner's ruby question: how to use erb to output file after binding

    - by john
    Hi, I got the following example: require 'erb' names = [] names.push( { 'first' => "Jack", 'last' => "Herrington" } ) names.push( { 'first' => "LoriLi", 'last' => "Herrington" } ) names.push( { 'first' => "Megan", 'last' => "Herrington" } ) myname = "John Smith" File.open( ARGV[0] ) { |fh| erb = ERB.new( fh.read ) print erb.result( binding ) accompanied by text.txt <% name = "Jack" %> Hello <%= name %> <% names.each { |name| %> Hello <%= name[ 'first' ] %> <%= name[ 'last' ] %> <% } %> hi, my name is <%= myname %> } it prints nicely to screen. what is the simplest way to output another file: "text2.txt"? thank you!!!

    Read the article

  • Sending binary data from ASP to .net component

    - by john
    The ASP application allows uploading of image files (jpg, gif, tif). These files are sent to a .net component registered in the GAC of the server. In the component file is encoded using System.Text.Unicode to byte[] array. This encoding is done with some data loss. The byte array has values 253 and 255 in consequetive elements. What could be the problem ? I'm sending the binary data as a string. Please help me... Thanks in advance, John

    Read the article

  • Find top "n" nearby coordinates.

    - by John Hamelink
    I have a coordinate. I want to find the top "n" (n being a variable value) nearest coordinates out of several thousand rows stored on a MySQL database. I also want to be able to define maximum and minimum distances between the coordinate in question and the coordinates in the database. How best am I to go about this? Would it be bonkers to use PHP as I understand the syntax much better than MySQL? If I use a MySQL function, how do I move it between databases if I choose to switch servers? How is it stored? Lastly, what is the most efficient method of getting through all these coordinates accurately - the coordinates are all relatively close to one another? Thanks for your time, John.

    Read the article

  • Join Query Help

    - by John
    Hello, The query below works well. It pulls data from two MySQL tables, "submission" and "login." I would like to also pull data from a third table called "comment" in the same database. The table "comment" has the following fields: commentid, loginid, submissionid, comment, datecommented Two of the fields in the table "login" are called "loginid" and "username." In the query below, I would like to count all "commentid" in "comment" where "loginid" equals the "loginid" in "login" where "username" equals "$profile." How can I do this? Thanks in advance, John $sqlStr1 = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl, l.created, count(s.submissionid) countSubmissions FROM submission AS s INNER JOIN login AS l ON s.loginid = l.loginid WHERE l.username = '$profile'";

    Read the article

  • Adding value to an Input field on click

    - by Wazdesign
    I have this structure on form, <input type="test" value="" id="username" /> <span class="input-value">John Smith</span> <a href="#" class="fill-input">Fill Input</a> when user click on the Fill Input , the data from span which has class input-value will be added to value, after clicking a tag the code should be look like this, <input type="test" value="john Smith" id="username" /> <span class="input-value">John Smith</span> <a href="#" class="fill-input">Fill Input</a> there are many forms element/input on the single page.

    Read the article

  • How to initialize an Object?

    - by John
    I have a class like this, public class person { name Name {set; get;} string Address {set; get;} } public class name { string First {set; get;} string Last {set; get;} } Now when I create the object an try to set the first or last name I get an error. "Object reference not set to an instance of an object." person Person = new person(); Person.Name.First = "John"; Person.Name.Last ="Smith"; What am I doing wrong?

    Read the article

  • Django - transactions in the model?

    - by orokusaki
    Models (disregard typos / minor syntax issues. It's just pseudo-code): class SecretModel(models.Model): some_unique_field = models.CharField(max_length=25, unique=True) # Notice this is unique. class MyModel(models.Model): secret_model = models.OneToOneField(SecretModel, editable=False) # Not in the form spam = models.CharField(max_length=15) foo = models.IntegerField() def clean(self): SecretModel.objects.create(some_unique_field=self.spam) Now if I go do this: MyModel.objects.create(spam='john', foo='OOPS') # Obviously foo won't take "OOPS" as it's an IntegerField. #.... ERROR HERE MyModel.objects.create(spam='john', foo=5) # So I try again here. #... IntegrityError because SecretModel with some_unique_field = 'john' already exists. I understand that I could put this into a view with a request transaction around it, but I want this to work in the Admin, and via an API, etc. Not just with forms, or views. How is it possible?

    Read the article

  • Tool(s) to lower the friction of programming against Interfaces in Visual Studio C#?

    - by John
    Hi I am a relatively new user of Visual Studio and I am trying "program against interfaces". I can see that when I create a class I can "Extract Interface" from the Refactor menu but you seem to only get one shot at this. ie. If I add a read only property FullName to my Customer class I would like to be able to right click and update the interface. At the moment I can only create a new interface from the Refactor menu. I want to update the interface I have already created not create new one. So the kind of tool I would be looking for would display check boxes for all valid members of the class with those already in the interface checked. It would also be handy to be able to to create the initial interface file in a different project (in the same solution), and for the tool to keep track of this. Does such a tool / add in / menu item exist (other than Ctrl C / V)? Thanks, John

    Read the article

  • Why use MySQL over flatfiles?

    - by John
    A friend and I were debating about whether he should use MySQL or a flatfile database for his website's backend. I told him to go with MySQL because it was structured, held records well, and was consistent. He on the other hand said that he would rather go for speed. Reading files is a lot quicker than connecting to MySQL and it made me wonder whether he was right. For example, why not just create a folder for each table, like so: users/ groups/ posts/, within the folders have the files named by ID (1, 2, 3) and then for the data use a format like so: username: John\npassword: e2fc714c4727ee9395f324cd2e7f331f\nemail: [email protected]? In other words, what are the advantages of MySQL over flatfiles?

    Read the article

  • Implementing an interface using an asynchronous WCF service?

    - by John K.
    Hello, I am trying to figure out if it is possible to implement a .NET interface, where the interface method has to return something and you are implementing that particular interface method with an asynchronous WCF service? Hopefully you should already see the issue I am encountering. Here is the interface: public interface IDataService { IDataServiceResponse SendDataRequest(); } IDataServiceResponse is supposed to represent a simple container that holds the result of my asynchronous WCF callback. Here is the code snippet where I am implementing the interface method, SendDataRequest() public IDataServiceResponse SendDataRequest() { InitializeDataServiceParameters(); // Call the web service asynchronously, here.... _client.BeginQueryJobs(_parameters, DataServiceQueryCallBack, _client); // How do I return _dataServiceResponse, if I am calling the WCF service // asynchronously?? return _dataServiceResponse; } And the callback method signature: void DataServiceQueryCallBack(IAsyncResult result) { // ... implementation code } Thanks in advance, John

    Read the article

  • Adding valut to Input field on click

    - by Wazdesign
    I have this structure on form, <input type="test" value="" id="username" /> <span class="input-value">John Smith</span> <a href="#" class="fill-input">Fill Input</a> when user click on the Fill Input , the data from span which has class input-value will be added to value, after clicking a tag the code should be look like this, <input type="test" value="john Smith" id="username" /> <span class="input-value">John Smith</span> <a href="#" class="fill-input">Fill Input</a> there are many forms element/input on the single page. thanks!

    Read the article

  • How to put .com at the end of email addressed by regex?

    - by terces907
    Example I received a email-list from my friends but the problem is some people typed an email in full form ([email protected]) and some people typed (xxx@xxx without .com). And i want to improve it into the same format. How can i improve it if i want to edit them on vi? In my emaillist.txt foo@gmail [email protected] bas@gmail [email protected] mike@abc john@email My try: i tried to use an easy regex like this to catch the pattern like xxx@xxx :%s/\(\w*@\w*\)/\0.com/g and :%s/\(\w*@\w*[^.com]\)/\0.com/g But the problem is this regex include [email protected] also And the result become like this after i enter the command above [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] So, My expectation after substitution is should be like this: [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] How to use regex in this situation?

    Read the article

  • Constructing T-SQL WHERE condition at runtime

    - by Nickson
    I would like to implement a search function where a user passes all the arguments to the "WHERE" clause at runtime. For example in query below, SELECT Col1, Col2, Col3, Col4 FROM MyTable WHERE Col2 = John 1.Now what i want is to give the user a dropdownlist of columnns such that the user selects a column to search by at runtime Also instead of precoding Col2 = John, i want the user to choose their own operator at runtime(such as choosing between =, <, <, <, LIKE, IN) i basically want to contruct a query like SELECT Col1, Col2, Col3, Col4 FROM MyTable WHERE (@FieldToSearchBy e.g Col3, @OperatorToUserInSearach e.g LIKE, @ValueToSearch e.g John) I want to pass @FieldToSearchBy, @OperatorToUserInSearach, @ValueToSearch) as user specified parameters at runtime I want to do this with a TableAdpter like in this example http://www.codeproject.com/KB/database/TableAdapter.aspx

    Read the article

  • Checking if a blob exists in Azure Storage

    - by John
    Hi, I've got a very simple question (I hope!) - I just want to find out if a blob (with a name I've defined) exists in a particular container. I'll be downloading it if it does exist, and if it doesn't then I'll do something else. I've done some searching on the intertubes and apparently there used to be a function called DoesExist or something similar... but as with so many of the Azure APIs, this no longer seems to be there (or if it is, has a very cleverly disguised name). Or maybe I'm missing something simple... :) John

    Read the article

  • Opening Office 2007 Documents from in memory storage - How?

    - by John S
    Hi there, I'm a C++ developer wrestling with updating an application that had made extensive use of the IStorage interface to open pre-Office 2007 documents from in-memory storage (via ILockBytes). If you are still following me so far, you probably know that the new Office Document formats are incompatible with IStorage containers. The application I'm trying to update, relied upon the IPersistStorage interface that all Office applications have, and the code as written calls the load method of IPersistStorage to read in a document from IStorage interface. So the question is.... What kind of COM interfaces are available to me to read in, from an in memory container, an Office 2007 document? John "S"

    Read the article

  • SelfReferenceProperty vs. ListProperty Google App Engine

    - by John
    Hi All, I am experimenting with the Google App Engine and have a question. For the sake of simplicity, let's say my app is modeling a computer network (a fairly large corporate network with 10,000 nodes). I am trying to model my Node class as follows: class Node(db.Model): name = db.StringProperty() neighbors = db.SelfReferenceProperty() Let's suppose, for a minute, that I cannot use a ListProperty(). Based on my experiments to date, I can assign only a single entity to 'neighbors' - and I cannot use the "virtual" collection (node_set) to access the list of Node neighbors. So... my questions are: Does SelfReferenceProperty limit you to a single entity that you can reference? If I instead use a ListProperty, I believe I am limited to 5,000 keys, which I need to exceed. Thoughts? Thanks, John

    Read the article

  • How do i create a view that can filter unique titles from a checkbox?

    - by buws
    I'm currently creating a view in Drupal that contains a number of fields. What I want to do is to create an exposed filter that is able to filter duplicate titles. The filter would be a checkbox. This is an example of the list NAME TIME RACE DISTANCE John Doe 2.07.54 Boston Marathon 42km Jane Boss 2.15.21 Boston Marathon 42km John Doe 2.02.22 Boston Marathon 42km Jane Boss 2.15.44 Boston Marathon 42km What I want to have is an exposed filter that only shows one unique NAME and sorts it by its best time. The resulting list would look as follows: NAME TIME RACE DISTANCE Jane Boss 2.15.21 Boston Marathon 42km John Doe 2.02.22 Boston Marathon 42km Any help is appreciated!

    Read the article

  • Mapping one to one foreign key relationships in Entity Framework 4.0?

    - by John K.
    Hello all, I'm sure I'm missing something very simple, but let's say I have two entities, Employee and EmployeeType. Employee type would contain values like 'Full time', 'Contractor', 'Intern', etc. An Employee entity would contain one, and only one EmployeeType value. So I am designing a new .edmx model using the Model-First approach and generating my actual sql server data schema from the model. I want to add an integer type foreign key id into my Employee entity, EmployeeTypeId, which will map to the primary key of the EmployeeType entity. So I've gone ahead and done that in my Employee entity. Where I'm stuck is how, though the Entity Framework designer, to enforce the 1:1 referential constraint on that EmployeeTypeId property? Or does the EF handle that automatically behind the scenes? thanks in advance, John

    Read the article

  • Powerpoint file can be deleted without consequence

    - by John Maloney
    I am working on a license management type application that copies a password protected zip file to the applications root. The user clicks a button "Open Presentation" and the zipped file is extracted into the root folder and then I use the Office interop to open the file in Powerpoint. At this point to my surprise I am able to delete the extracted file that is currently open in the Powerpoint application. I had assumed that trying to delete the file would fail as the file is still open in Powerpoint. Why is it allowing me to delete the file? Is the file somehow copied to a temp folder and then opened in PowerPoint? Can I move forward with the application relying on this ability to delete the file as soon as it is opened in Powerpoint? This would be optimal because it helps insure that the file cannot be copied(I am also using the xml to stop "Save As" and "Save" from appearing int Powerpoint). Thanks for the insight, John

    Read the article

  • JTextPane insert component, faulty vertical alignment

    - by John O
    I have a JTextPane, into which I need to insert a JComponent. I'm using JTextPane.insertComponent(Component). The item is indeed inserted, but the vertical positioning is too high. Instead of having the bottom of the component aligned with the baseline of the current line of text, the component is way above that position, blocking out/over-painting lines of text appearing above. I have tried calling setAlignmentY(float) with various values, on both the inserted component and the JTextPane, but it doesn't affect the behavior at all. My guess: there seems to be some state inside my JTextPane or its Document that I need to be changing. But I don't know what it is. John

    Read the article

  • How to have multiple tables with multiple joins

    - by williamsdb
    I have three tables that I need to join together and get a combination of results. I have tried using left/right joins but they don't give the desired results. For example: Table 1 - STAFF id name 1 John 2 Fred Table 2 - STAFFMOBILERIGHTS id staffid mobilerightsid rights --this table is empty-- Table 3 - MOBILERIGHTS id rightname 1 Login 2 View and what I need is this as the result... id name id staffid mobilerightsid rights id rightname 1 John null null null null 1 login 1 John null null null null 2 View 2 Fred null null null null 1 login 2 Fred null null null null 2 View I have tried the following : SELECT * FROM STAFFMOBILERIGHTS SMR RIGHT JOIN STAFF STA ON STA.STAFFID = SMR.STAFFID RIGHT JOIN MOBILERIGHTS MRI ON MRI.ID = SMR.MOBILERIGHTSID But this only returns two rows as follows: id name id staffid mobilerightsid rights id rightname null null null null null null 1 login null null null null null null 2 View Can what I am trying to achieve be done and if so how? Thanks

    Read the article

  • Track/Display Array Index As Part Of Cout (C++)

    - by John Smith
    Hi, I have a command line C++ program that lets you enter basic information about a person (ID number, name, age, etc.) and I want to output to a console in the following manner: ------------------------------------------------------------------- Index ID # First Name Last Name Age ------------------------------------------------------------------- 0 1234 John Smith 25 The person objects are stored in an array of Persons and I've overload the ostream (<<) operator to print out all of the fields like you see. The dashed lines and header come from a displayHdg() function. Anyhow, I have not been able to figure out how to get the proper index value for the array. Ideally, I'd like to generate the indices for each line, but all my attempts have failed. The array is looped through and each object printed in the main() function, and the ostream is overloaded in a person class, so I tried to use global variables as well as static variables, and all of those produce incorrect numbering (i.e. show 0, 1 the first time (for 2 objects), then change to 1, 2 on the next display). Any ideas?

    Read the article

  • AJAX response inside jqplot not working

    - by JuanGesino
    I'm trying to render data from an AJAX response as a bar chart with jqplot. To render this bar chart I use two variables: s1 which contains the numbers ex: s1 = [22,67,32,89] ticks which contains the name corresponding to a number inside s1 ex: ticks = ["Jack", "Mary", "Paul", "John"] So my AJAX returns two variables, data1 and data2. When I console.log(data1) I get 22,67,32,89 When I console.log(data2) I get "Jack", "Mary", "Paul", "John" I then add the square brackets and change variable: s1 = [data1] ticks = [data2] When I console.log(s1) I get ["22,67,32,89"] When I console.log(ticks) I get "Jack", "Mary", "Paul", "John" And the graph does not render, this is my code: s1 = [data]; ticks = [data]; plot4 = $.jqplot('chartdiv4', [s1], { animate: !$.jqplot.use_excanvas, series:[{color:'#5FAB78'}], seriesDefaults:{ renderer:$.jqplot.BarRenderer, pointLabels: { show: true } }, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks }, yaxis:{min:0, max:100, label:'%',labelRenderer: $.jqplot.CanvasAxisLabelRenderer} }, highlighter: { show: false } }); });

    Read the article

  • Querying Two Tables At Once

    - by John
    Hello, I am trying to do what I believe is called a join query. First, in a MySQL table called "login," I want to look up what "loginid" is in the record where "username" equals $profile. (This will be just one record / row in the MySQL table). Then, I want to take that "loginid" and look up all rows / records in a different MySQL table called "submission," and pull data that have that "loginid." This could possibly be more than one record / row. How do I do this? The code below doesn't seem to work. Thanks in advance, John $profile = mysql_real_escape_string($_GET['profile']); $sqlStr = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl FROM submission AS s, login AS l WHERE l.username = '$profile', s.loginid = l.loginid ORDER BY s.datesubmitted DESC";

    Read the article

  • Twig Template For loop Results

    - by user981480
    I am trying to print out a the contents of an array but am not getting the expected results. any help is much appreciated: PHP code: $list[1]['first_name'] = 'Joe'; $list[1]['last_name'] = 'Smith'; $list[2]['first_name'] = 'John'; $list[2]['last_name'] = 'brand'; $data = array( 'customer' => $list ); echo $template->render($data); Template Markup: <html> <head><title>My first Twig template!</title></head> <body> {% for person in customer %} {{ person.first_name }} {% endfor %} </body> RESULTS: Array ( [first_name] = Joe [last_name] = Smith ) first_name Joe Array ( [first_name] = John [last_name] = brand ) first_name John

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >