Which programming language and tools can i use, to develope a complete stand-alone gui-application? This application will be burned on a cd and should run on every windows-pc without any installations.
I am programming a snake game using c++ and I first designed an array(grid) adn my question is how can create a character that i can control using arrows on keboard,, if possible can any one give me the exact code, thank you
RubyParser.new.parse "1+1"
s(:call, s(:lit, 1), :+, s(:array, s(:lit, 1)))
Above code is from this link
Why there is array after + in the Sexp. I am just trying to learn ruby parser and the whole AST thing. I have been programming for a while but have no formal education in computer science. So do point to good article which explains AST etc. Please no dragon book. I tried couple of times but couldn't understand much of that book
This is a sequel to a related post which asked the eternal question:
Can I have polymorphic containers with value semantics in C++?
The question was asked slightly incorrectly. It should have been more like:
Can I have STL containers of a base type stored by-value in which the elements exhibit polymorphic behavior?
If you are asking the question in terms of C++, the answer is "no." At some point, you will slice objects stored by-value.
Now I ask the question again, but strictly in terms of C++11. With the changes to the language and the standard libraries, is it now possible to store polymorphic objects by value in an STL container?
I'm well aware of the possibility of storing a smart pointer to the base class in the container -- this is not what I'm looking for, as I'm trying to construct objects on the stack without using new.
Consider if you will (from the linked post) as basic C++ example:
#include <iostream>
using namespace std;
class Parent
{
public:
Parent() : parent_mem(1) {}
virtual void write() { cout << "Parent: " << parent_mem << endl; }
int parent_mem;
};
class Child : public Parent
{
public:
Child() : child_mem(2) { parent_mem = 2; }
void write() { cout << "Child: " << parent_mem << ", " << child_mem << endl; }
int child_mem;
};
int main(int, char**)
{
// I can have a polymorphic container with pointer semantics
vector<Parent*> pointerVec;
pointerVec.push_back(new Parent());
pointerVec.push_back(new Child());
pointerVec[0]->write();
pointerVec[1]->write();
// Output:
//
// Parent: 1
// Child: 2, 2
// But I can't do it with value semantics
vector<Parent> valueVec;
valueVec.push_back(Parent());
valueVec.push_back(Child()); // gets turned into a Parent object :(
valueVec[0].write();
valueVec[1].write();
// Output:
//
// Parent: 1
// Parent: 2
}
I am a c# developer which finds himself having to relearn c++. The last time I programmed in c++ was in school and am looking for good books as a refresher. I want something that assumes previous programming exposure and gets straight to the point. Is there a book similar to K&R for c++? I know the language is bloated so a book that covers a subset of c++ would be ideal.
Using Git or Mercurial, how would you know when you do a clone or a pull, no one is checking in files (pushing it)? It can be important that:
1) You never know it is in an inconsistent state, so you try for 2 hours trying to debug the code for what's wrong.
2) With all the framework code -- potentially hundreds of files -- if some files are inconsistent with the other, can't the rake db:migrate or script/generate controller cause some damage or inconsistencies to the code base?
From this below script I am able to extract all links of particular website,
But i need to know how I can generate data from extracted links especially like eMail, Phone number if its there
Please help how i will modify the existing script and get the result or if you have full sample script please provide me.
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
'url must be in this format: http://www.example.com/
Dim aList As ArrayList = Spider("http://www.qatarliving.com", 1)
For Each url As String In aList
lstUrls.Items.Add(url)
Next
End Sub
Private Function Spider(ByVal url As String, ByVal depth As Integer) As ArrayList
'aReturn is used to hold the list of urls
Dim aReturn As New ArrayList
'aStart is used to hold the new urls to be checked
Dim aStart As ArrayList = GrabUrls(url)
'temp array to hold data being passed to new arrays
Dim aTemp As ArrayList
'aNew is used to hold new urls before being passed to aStart
Dim aNew As New ArrayList
'add the first batch of urls
aReturn.AddRange(aStart)
'if depth is 0 then only return 1 page
If depth < 1 Then Return aReturn
'loops through the levels of urls
For i = 1 To depth
'grabs the urls from each url in aStart
For Each tUrl As String In aStart
'grabs the urls and returns non-duplicates
aTemp = GrabUrls(tUrl, aReturn, aNew)
'add the urls to be check to aNew
aNew.AddRange(aTemp)
Next
'swap urls to aStart to be checked
aStart = aNew
'add the urls to the main list
aReturn.AddRange(aNew)
'clear the temp array
aNew = New ArrayList
Next
Return aReturn
End Function
Private Overloads Function GrabUrls(ByVal url As String) As ArrayList
'will hold the urls to be returned
Dim aReturn As New ArrayList
Try
'regex string used: thanks google
Dim strRegex As String = "<a.*?href=""(.*?)"".*?>(.*?)</a>"
'i used a webclient to get the source
'web requests might be faster
Dim wc As New WebClient
'put the source into a string
Dim strSource As String = wc.DownloadString(url)
Dim HrefRegex As New Regex(strRegex, RegexOptions.IgnoreCase Or RegexOptions.Compiled)
'parse the urls from the source
Dim HrefMatch As Match = HrefRegex.Match(strSource)
'used later to get the base domain without subdirectories or pages
Dim BaseUrl As New Uri(url)
'while there are urls
While HrefMatch.Success = True
'loop through the matches
Dim sUrl As String = HrefMatch.Groups(1).Value
'if it's a page or sub directory with no base url (domain)
If Not sUrl.Contains("http://") AndAlso Not sUrl.Contains("www") Then
'add the domain plus the page
Dim tURi As New Uri(BaseUrl, sUrl)
sUrl = tURi.ToString
End If
'if it's not already in the list then add it
If Not aReturn.Contains(sUrl) Then aReturn.Add(sUrl)
'go to the next url
HrefMatch = HrefMatch.NextMatch
End While
Catch ex As Exception
'catch ex here. I left it blank while debugging
End Try
Return aReturn
End Function
Private Overloads Function GrabUrls(ByVal url As String, ByRef aReturn As ArrayList, ByRef aNew As ArrayList) As ArrayList
'overloads function to check duplicates in aNew and aReturn
'temp url arraylist
Dim tUrls As ArrayList = GrabUrls(url)
'used to return the list
Dim tReturn As New ArrayList
'check each item to see if it exists, so not to grab the urls again
For Each item As String In tUrls
If Not aReturn.Contains(item) AndAlso Not aNew.Contains(item) Then
tReturn.Add(item)
End If
Next
Return tReturn
End Function
I am getting the MOdel.StudentID from data base in my view..
I need to put this StudentId in textaren?
<textarea> ?? </textarea>
how to assing this value?
so that in textare I can see StudentID?
thanks
A project that involves image processing, i.e. to calculate the angular shift of the same image when shifted by a medium of certain Refractive Index. We have to build an app that correlates the 2 images (phase/2D correlation?) and then plot using Chaco and Mayavi (2 libraries in Python).
Is there any other existing template software (FOSS) that we can base our app on, or use it as a reference?
Where could I find good resources and examples for learning how to utilize TCP/IP in c# 2.0? Any suggestions on where to start? I'm pretty new at socket programming.
Problem/Task:
Write an interface with one method and two classes that implement this interface.
Now write a main method with an array that holds an instance of each class. Using a for-each loop, invoke the method upon each item.
Is this an interview question? (I'm not sure if the author meant to post this as a question or was looking for an answer to the above.)
I would like to plot some image binary data on a grayscale matrix-like graph with custom values on axes. I'm using Perl on a Windows machine but I can't fine the right module to do this. I'm already using GD::Graph to plot other type of data but it seems unsuitable for this specific task.
I am trying to download a list of files from a ftp server using:
NSURL *ftpUrl = [NSURL URLWithString:@"ftp://xxx:[email protected]"];
I HAVE to use FTP, so please do not recommend an alternative. I want to know how to get the list of files from the root directory and also navigate inside folders (of FTP server).
P.S: I do not think external library would be required to accomplish such an easy task, but if I must, any recommendations would be appreciated.
Thank You :)
Hi, I`m looking for best mechanism for self update in .net programs!
solution should cover this subject:
1) Server - Client Program
2) When new update released, after installing that on the sever-program, all client-program must update itself base on server version.(no need automatic-update for server)
3) Full-Update : for example if server on version 3 and last update package version is 5, update package must contain any older package.
Hello guys
I am a web developer and sometimes I have to do some design myself for my customers but design actually is not my best thing to do. I am looking for a program that can help me getting fast and reliable design ideas but I am not looking for code generator like Artisteer.
Actually design is a hard task and my designs always look ugly and messy.
hi i am new to android programming, can someone please tell me how to get access to the files in a directory , i am using Environment.getExternalStorageDirectory() method?
Hi, guys! I have a question about remote control by wi-fi from pc or mobile phone.
I want to control a some robot by wi-fi, but i don't know about any wi-fi DYI modules, anyone have a links to pdf, blogs and others about this question? It's may be such a programming wi-fi protocol and others.
Thanks!
I mostly use Eclipse but have mentionned Netbeans on my cv. Are there any good concise and up-to-date tutorials apart from the official ones that could bring me up to speed on how to use the platform efficiently (shortcuts, debugging, views ...)? This excludes programming tutorials as I don't really need them unless there's a special manipulation involved.
I know this is possible in other programming languages. Suppose we have the following arrangement:
- (void) myMethod:(NSString*)variables, ... {
// Handle business here.
}
- (void) anotherMethod:(NSString*)variables, ... {
// We want to pass these variable arguments for handling
[self myMethod:variables, ...]; // Do not pass GO
}
// Start the party:
[self anotherMethod:@"arg1", @"arg2", @"arg3", @"arg4", nil];
What's the trick to get this working in ObjC?
Here is my problem.
I need more than one row from the database, and i need the first row for certain task and then go through all the list again to create a record set.
$query = "SELECT * FROM mytable";
$result = mysql_query($query);
$firstrow = //extract first row from database
//add display some field from it
while($row = mysql_fetch_assoc($result)) {
//display all of them
}
Now, how to extract just the first row?
What is good book for industry level C++ programming?
I am not looking for a beginners C++ book that talks about datatypes and control structures. I am looking for a more advanced book. For example, how to build system applications using C++.
Any kind of guidance will be very helpful.
I want to read a big text file, what i decided to create four threads and read 25% of file by each one.
and then join them.
but its not more impressive.
can any one tell me can i use concurrent programming for the same.
as my file structure have some data as
name contact compnay policyname policynumber uniqueno
and I want to put all data in hashmap at last.
thanks
Hello,
I am trying to get the Treemap plugin (http://www.jquery.info/spip.php?article40) working with jQuery v1.3.x. The plugin works with jQuery v1.1 and v1.2 but for some reason it fails with the v1.3 base.
This is the browser error "Error: uncaught exception: Syntax error, unrecognized expression: "
Does anyone know changes occurred between JQuery v1.2 and v1.3 that could cause this?
Cheers,
D