I'm writing a migration to convert a non-rails app into the right format for rails - one of the tables for some reason does not have auto increment set on the id column. Is there a quick way to turn it on while in a migration, maybe with #change_column or something?
I have the following:
LPSTR email // Has data in it already
LPSTR index=strchr(email,'@');
Now I want to Insert into a new string:
LPSTR username
the part of "email" from the beginning of the string to "index".
For example:
email="[email protected]"
so username="roel" .
Is there a function to do it quick or do I need to build one?
Roel
What is the language with the lowest barriers to entry, simplest syntax, easiest setup. I'm aware that there's not a best language but I am sure that there will be one that's got a good score in all three areas.
It's for teaching friends how to program, I like PHP and Python but I don't want to be narrow minded and limit myself when there is a better option out there.
Common suggestions
Ruby
Python
Basic
C
Java
C#
Useful links
Best Ways To Teach A Beginner to Program
Why's (Poignant) Guideto Ruby
Think Python
Hello,
I'm trying to pass parameters to a control in codeigniter, but I'm getting 404 page not found error, I don't get it, I did what the guide says: http://codeigniter.com/user_guide/general/controllers.html#passinguri
<?php
class Main extends Controller {
function index($username) {
echo $username;
}
}
?>
How can I get more info regarding this error from codeigniter?
Thank you.
I need a simple how-to tutorial on developing a simple CMS web site using the OFBiz CMS framework. There are absolutely no documentation of how OFBiz CMS works. Whatever is there in the official website is only about the data model used in OFBiz CMS application.
If somebody can illustrate just a "Hello World" like application in OFBiz CMS, it will great help for me. Or can guide me to similar documents in web.
From the docs:
When Core Data turns an object into a
fault, key-value observing (KVO)
change notifications (see Key-Value
Observing Programming Guide) are sent
for the object’s properties. If you
are observing properties of an object
that is turned into a fault and the
fault is subsequently realized, you
receive change notifications for
properties whose values have not in
fact changed.
So if an object turns into a fault, Core Data does send KVO notifications for changed properties? So I must always check for isFault == NO before beeing happy about the notification?
So I've made a game in Python and PyGame. Now I'm interested in submitting the game to Intel's March Developer Challenge. However, the developer challenge requires use of Intel's Atom Developer SDK (http://appdeveloper.intel.com/en-us/sdk), which only has API's for C and C++.
I'm new to Python and PyGame, and have no experience in C or C++. My question is, would it be possible to somehow implement Intel's Atom SDK through/with/from a Python application (as the first link above suggests)?
I've read up a little bit on embedding/extending Python into/with C, but I'm not entirely sure what to embed or where. I mean, I know I can do things like this in C:
#include <Python.h>
int
main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
But what do I do about all my dependencies on Python and Pygame, for people that don't have those installed on their machines? Normally Py2Exe takes care of compacting the required dependencies (I've managed to package my game into an exe/zip), but how do I take care of that stuff in the context of embedding within C? Can I somehow work with py2exe on this, or do I need to do something entirely different for embedding within C?
It seems like it would be a lot easier to go the route of extending Python with the C validation code, rather than trying to embed my whole game within C, but I think that's not an option, "because the library provided is currently only available as a Visual Studio 2008 '.lib'", meaning the application has to be compiled with Visual Studio...?
Any help, thoughts, or ideas are much appreciated!
You can find the complete SDK Developer's Guide on the intel site above, but here is their "Hello World" using the C Language API:
#include <stdio.h>
#include “adpcore.h”
int main( int argc, char* argv[] )
{
ADP_RET_CODE ret_code;
const ADP_APPLICATIONID myApplicationID = {{
0x12345678,0x11112222,0x33331234,0x567890ab}};
if ((ret_code = ADP_Initialize()) != ADP_SUCCESS ){
printf( “ERROR: exiting” );
exit( -1 );
}
if (( ret_code = ADP_IsAuthorized( myApplicationId )) == ADP_AUTHORIZED )
printf( “Hello World” );
else
printf( “Not authorized to run” );
exit 0;
}
35 Page SDK Developer Guide: http:// appdeveloper.intel.com/sites/files/pages/SDK%20Developer%20Guide.pdf
I want to add resources to my netbeans project but I don't know where to add or how to get the added resource via ResourceManager so that I can localize the text.
I could not find any dummy guideto add the resource files and read the localized strings using resource manager.
What is the format of the resource file? It is .properties or a xml file?
Can you help me?
I have a program that generates a .shp file, and exports this as a kml file. I would like to be able to display my output using the standard google map 'map' style (gray background, yellow streets, etc) in google earth, or in the google earth api.
Is there a style guide or method that I should be using?
Any thoughts appreciated - I wasn't sure how to structure this question.
Thank you.
I can't see to find a quick explanation of the differences so I can figure out which to use.
One is for a server one is for a Database? Im not sure what that means..
Basically we are doing a new web app and I want to see what these project types can offer me in terms of tracking the DB code/schema etc..
I am very interested in changing the way I tackle applications to integrate TDD / UnitTesting.. But I don't want to go down the MVC route just yet, and would like to see via Video a beginners guideto using TDD.
How you set it up, use it in VS2008 etc...
Hi
I'm learning Haskell and I'd like to write some multithreaded programs now to see the performance gains from that in a functional language. I can find some references to it on the internet but never a proper introduction to it. Can anyone point me to a guide which is understandable for someone who knows the syntax fairly well, but is not a wizard in Haskell?
Found UI guidelines of Launcher icon design http://d.android.com/guide/practices/ui_guidelines/icon_design.html but System Icons in recent Android releases doesn't seem to follow these guidelines (icons are flat instead simplified 3D perspective, as described in document).
Are they already obsolete and what are the current guidelines ?
Very quick question, does anyone know what the effect of setting an application pool in IIS7 o "Load User Profile" would have? Is it advisable etc.
Reference: http://dbvt.com/blog/post/AspNetHostingPermission-Security-Exception-Fix-with-Ajax-in-IIS7.aspx
I need to create a javascript function that checks if it has been a day since timeX (an instance of Date). I do NOT mean whether is has been 24 hours since timeX, but instead whether it has passed a midnight since timeX.
I am a PHP expert, not a JavaScript one, so I was wondering if anyone here had any quick answers. Thanks!
function(dateLast, dateNow) {...}
I want to change my window design rapidly. I have OnPaint function which I am calling when WM_PAINT message received. The design change only when the event occure. I want that design should automatically update doesn't depend on event kindly guide me how can I make it possible.
I would like to implement something similar to the Google quick scroll extension with jquery for the extracts of a search result, so when the full document is opened (within the same website) it gives the user the opportunity to go straight to the extract location.
Here is a sample of what I get returned from the search engine when I search for 'food'.
<doc>
<docid>129305</docid>
<title><span class='highlighted'>Food</span></title>
<summary>
<summarytext>Papers subject to Negative Resolution: 4 <span class='highlighted'>Food</span> <span class='highlighted'>Food</span> Irradiation (England) Regulations 2009 (S.I., 2009, No. 1584), dated 24 June 2009 (by Act), </summarytext>
</summary>
<paras>
<paraitemcount>2</paraitemcount>
<para>
<paraitem>1</paraitem>
<paraid>42</paraid>
<pararelevance>100</pararelevance>
<paraweights>50</paraweights>
<paratext>4 <span class='highlighted'>Food</span></paratext>
</para>
<para>
<paraitem>2</paraitem>
<paraid>54</paraid>
<pararelevance>100</pararelevance>
<paraweights>50</paraweights>
<paratext><span class='highlighted'>Food</span> Irradiation (England) Regulations 2009 (S.I., 2009, No. 1584), dated 24 June 2009 (by Act), with an Explanatory Memorandum and an Impact Assessment (</paratext>
</para>
</paras>
</doc>
As you see the search engine has returned a document that contains one summary and two extracts.
So let's say the user clicks on the second extract in the search resutls page, the browser would open the detailed document in the same website, and would offer the user the possibility to go to the extract as the Google quick scroll extension does.
Is there an existing jquery script for this? If not, can you suggest any jquery/javascript code that would simplify my task to implement this.
Notes:
I can access the extracts from the document details page.
I'm aware that the HTML in some cases could be slightly different in the extract than in the details page, finding no match.
The search engine does not return where the extract was located.
At the moment I'm trying to understand the JS code that the extension uses.
Apart from the argument of wicket's simplicity (that is, wicket is a simpler system IMHO) and GWT's responsiveness in the client (GWT's client side state and javascript - potentially complex client side code) and GWT's greater potential for scaling, what is the argument for using GWT over wicket?
Personally I've done a lot of wicket development, but have only had a quick look at GWT a long time ago.
Hi, I'm looking to write a quick program to read and inspect packets of a certain format and then blacklist ips with a certain style of packet-traffic (packet patterns of an attack against the network). Are there decent samples of reading and inspecting packet flow on a network?
Hello,
I am trying to develop an application which uses storekit api. The document (Store Kit guide) suggests that the api will not work on a simulator. I found out that memory leaks will not be able to work on a device. I was wondering if any one can tell me how to check for memory leaks while using a store kit api on a project?
How is it possible?
Mobile phone AT & T guidance?
i connect my china/ and nokia phone using bluetooth COM PORT CONNECTION it say com at 5,
i would like to use this connection to send and receive sms using c#.
please guide, resources, example code. thank you
Hi!
I'm interested in using unicode characters (like \apha) in function/varaible names in my c++ program which I will compile with clang++ on linux. Does anyone know of a good guide / list of rules to go by for making sure that everything ends up compiling fine / aoiding linking errors / ...
Thanks!
hello
i make a app for the ipad in objective-c about twitter with ouath autenthication , you can help me , how find a tutorail and documentacion about this ? . i try with oauth/code but the guide the this page no is clear
thans in advance
Hi,
I have build my custom webpart using the visual studio extensions. I want to deploy it. but getting error:
No SharePoint Site exists at the specified URL
for the solution I have tried to change the "Start browser with URL" from properties of the project in Debug tab. I gave my site name with port as,
http://myserver:500/
but still problem there, when a i say build or deploy. Please guide me.