Daily Archives

Articles indexed Friday May 14 2010

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

  • Generating Insert Statements

    This article from new author Oleg Netchaev describes the cursor-less script used to generate insert statements. This allows you to efficiently and easily add data generation statements to your project deployments.

    Read the article

  • multi_index composite_key replace with iterator

    - by Rohit
    Is there anyway to loop through an index in a boost::multi_index and perform a replace? #include <iostream> #include <string> #include <boost/multi_index_container.hpp> #include <boost/multi_index/composite_key.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> using namespace boost::multi_index; using namespace std; struct name_record { public: name_record(string given_name_,string family_name_,string other_name_) { given_name=given_name_; family_name=family_name_; other_name=other_name_; } string given_name; string family_name; string other_name; string get_name() const { return given_name + " " + family_name + " " + other_name; } void setnew(string chg) { given_name = given_name + chg; family_name = family_name + chg; } }; struct NameIndex{}; typedef multi_index_container< name_record, indexed_by< ordered_non_unique< tag<NameIndex>, composite_key < name_record, BOOST_MULTI_INDEX_MEMBER(name_record,string, name_record::given_name), BOOST_MULTI_INDEX_MEMBER(name_record,string, name_record::family_name) > > > > name_record_set; typedef boost::multi_index::index<name_record_set,NameIndex>::type::iterator IteratorType; typedef boost::multi_index::index<name_record_set,NameIndex>::type NameIndexType; void printContainer(name_record_set & ns) { cout << endl << "PrintContainer" << endl << "-------------" << endl; IteratorType it1 = ns.begin(); IteratorType it2 = ns.end (); while (it1 != it2) { cout<<it1->get_name()<<endl; it1++; } cout << "--------------" << endl << endl; } void modifyContainer(name_record_set & ns) { cout << endl << "ModifyContainer" << endl << "-------------" << endl; IteratorType it3; IteratorType it4; NameIndexType & idx1 = ns.get<NameIndex>(); IteratorType it1 = idx1.begin(); IteratorType it2 = idx1.end(); while (it1 != it2) { cout<<it1->get_name()<<endl; name_record nr = *it1; nr.setnew("_CHG"); bool res = idx1.replace(it1,nr); cout << "result is: " << res << endl; it1++; } cout << "--------------" << endl << endl; } int main() { name_record_set ns; ns.insert( name_record("Joe","Smith","ENTRY1") ); ns.insert( name_record("Robert","Brown","ENTRY2") ); ns.insert( name_record("Robert","Nightingale","ENTRY3") ); ns.insert( name_record("Marc","Tuxedo","ENTRY4") ); printContainer (ns); modifyContainer (ns); printContainer (ns); return 0; } PrintContainer ------------- Joe Smith ENTRY1 Marc Tuxedo ENTRY4 Robert Brown ENTRY2 Robert Nightingale ENTRY3 -------------- ModifyContainer ------------- Joe Smith ENTRY1 result is: 1 Marc Tuxedo ENTRY4 result is: 1 Robert Brown ENTRY2 result is: 1 -------------- PrintContainer ------------- Joe_CHG Smith_CHG ENTRY1 Marc_CHG Tuxedo_CHG ENTRY4 Robert Nightingale ENTRY3 Robert_CHG Brown_CHG ENTRY2 --------------

    Read the article

  • Nested loop with dependent bounds trip count

    - by aaa
    hello. just out of curiosity I tried to do the following, which turned out to be not so obvious to me; Suppose I have nested loops with runtime bounds, for example: t = 0 // trip count for l in 0:N for k in 0:N for j in max(l,k):N for i in k:j+1 t += 1 t is loop trip count is there a general algorithm/way (better than N^4 obviously) to calculate loop trip count? I am working on the assumption that the iteration bounds depend only on constant or previous loop variables.

    Read the article

  • Class inheriting from several Interfaces having same method signature

    - by Manish
    Say, I have three interfaces: public interface I1 { void XYZ(); } public interface I2 { void XYZ(); } public interface I3 { void XYZ(); } A class inheriting from these three interfaces: class ABC: I1,I2, I3 { // method definitions } Questions: If I implement like this: class ABC: I1,I2, I3 { public void XYZ() { MessageBox.Show("WOW"); } } It compiles well and runs well too! Does it mean this single method implementation is sufficient for inheriting all the three Interfaces? How can I implement the method of all the three interfaces and CALL THEM? I know it can done using explicit implementation but I'm not able to call them. :(

    Read the article

  • How to delete multiple rows from datatable in VB.net 2008 ?

    - by KuldipMCA
    How to delete multiple rows from datatable in VB.net 2008 with out looping ? I do not want to delete from database. I want to delete from Local data table. I know the Select Method and also Remove and Remove at method too. but that needs looping to delete the ROWs from Datatable. I have 40000 Rows and i want to Delete selected 1000 Rows from that Datatable.

    Read the article

  • Java document parsing over internet using POST

    - by Travis
    I've looked all around and decided to make my own library for accessing the EVE API. Requests are sent to a server address such as /account/Characters.xml.aspx. Characters.xml.aspx requires two item be submitted in POST and then it returns an XML file. So far I have this but it does not work, probably becuase I am using GET instead of POST: //Get the API data DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); String url = "http://api.eveonline.com/account/Characters.xml.aspx?userID="+ userID+"?apiKey="+key; Document doc = builder.parse(url); How would I go about being able to parst an XML file that is generated by submitting variables in POST?

    Read the article

  • How can I split my conkeror-rc config over multiple files?

    - by Ryan Thompson
    Short version: can you help me fill in this code? var conkeror_settings_dir = ".conkeror.mozdev.org/settings"; function load_all_js_files_in_dir (dir) { var full_path = get_home_directory().appendRelativePath(dir); // YOUR CODE HERE } load_all_js_files_in_dir(conkeror_settings_dir); Background I'm trying out Conkeror for web browsing. It's an emacs-like browser running on Mozilla's rendering engine, using javascript as configuration language (filling the role that elisp plays for emacs). In my emacs config, I have split my customizations into a series of files, where each file is a single unit of related options (for example, all my perl-related settings might be in perl-settings.el. All these settings files are loaded automatically by a function in my .emacs that simply loads every elisp file under my "settings" directory. I am looking to structure my Conkeror config in the same way, with my main conkeror-rc file basically being a stub that loads all the js files under a certain directory relative to my home directory. Unfortunately, I am much less literate in javascript than I am in elisp, so I don't even know how to "source" a file.

    Read the article

  • ASP.NET MVC CookieTempDataProvider: any experience?

    - by Igor Brejc
    UPDATE: looks like I've misunderstood what TempData is for and what it isn't. It definitively shouldn't be used to "keep certain session-wide data" as I asked initially (see ASP.NET MVC TempData Is Really RedirectData why). I've modified the question accordingly. Has anyone used CookieTempDataProvider for TempData storage? Are there any caveats to watch out for (apart from keeping the session storage small)? Any issues with using it on Web farms?

    Read the article

  • problem with filtering the dropdownlist in scroll window

    - by Rahul
    Hi all, Problem with filtering Dropdown list. The scenario is : in scroll window there are two fields Document types and type id: Document type is Dropdown list: As per document type selection type id look should display the values. For ex. If I select quote type from document type and if I open type id look up it should display only quotation in the look window. It should work for all the values of document type drop down list values. Its working fine. The item in the document types are: Quote, Order, Invoice, Return, BackOrder. The problem is after saving the data when I am displaying the same record in scroll window, suppose after displaying document type is QUOTE and document id is QTOARD, and in this position I am changing the document type from dropdown QUOTE to ORDER at this time warning message should c ome this range entered is in valid. Because in database table there is no document QTOARD for ORDER type. The same should work for all the condition. The table name is SOP_ID_Setp and key is SOP Type and DocumentID. For that I have written the Stored procedure : create procedure DocTypeFilter @DocumentType as int, @DocumentID as varchar(30) as --declare --@documentype int, --@documentID varchar(30), select * from sop40200 where soptype=@DocumentType and docid=@DocumentID and I have called this SP in Dropdownlist change event. local long retcode; range clear table SOP_ID_SETP; clear field 'SOP Type' of table SOP_ID_SETP; clear field 'Document ID' of table SOP_ID_SETP; range start table SOP_ID_SETP; fill field 'SOP Type' of table SOP_ID_SETP; fill field 'Document ID' of table SOP_ID_SETP; range end table SOP_ID_SETP; if err()=OKAY then call DocTypeFilter,retcode,'Document Type' of window 'Is_Document Type Site_Scroll','Document ID' of window 'Is_Document Type Site_Scroll'; else warning "The range entered is invalid"; clear window 'Is_Document Type Site_Scroll'; fill window 'Is_Document Type Site_Scroll' table is_sop_site_line_temp; end if; Above code not giving the expected output any help pls.

    Read the article

  • Member Function Pointer not quite right

    - by BlackDuck
    I have a SpecialisedRedBlackTree class that is templated. My Month class is not. In my Month class I have a private member which is an instance of SpecialisedRedBlackTree: SpecialisedRedBlackTree<Day> m_windSpeedTree; As you can see it will take the Day class/object (please correct me on any terms I get wrong). In my Month class, I have a method passing a method function pointer to this method: bool Month::CompareWindSpeed(Day a, Day b) { return ( a.GetData(WIND_SPEED_CODE) < b.GetData(WIND_SPEED_CODE)? true : false); } bool (Month::*myFuncPtr)(Day, Day); myFuncPtr = &Month::CompareWindSpeed; m_windSpeedTree.Insert(dayReading, myFuncPtr); But because I am passing a bool (Day, Day) pointer to a templated class expecting bool (T, T) T being part of this .... template Error 1 error C2664: 'SpecialisedRedBlackTree<T>::Insert' : cannot convert parameter 2 from 'bool (__thiscall Month::* )(Day,Day)' to 'bool (__cdecl *)(T,T)' Any advice?

    Read the article

  • What is the term(s) used to describe programming language syntax?

    - by Mr Roys
    Is there an exact/correct term to describe this difference between the syntax/constructs of programming langauges e.g VB6 with its (if ... else ... endif) and C# with its curly braces for conditional statements. I'm using VB6 syntax and C# as examples since I'm more familiar with their syntax. For example, Visual Basic 6's syntax uses a more verbose, natural language like structure. If (id = 0) Then id = MyObject.Add(Me) Else Call MyObject.Update(Me) End If while C# has more concise syntax like: if (id == 0) { id = MyObject.Add(this); } else { MyObject.Update(this); } Conciseness? Natural languageness? Or is there a more "scientific" word for describing syntax?

    Read the article

  • Mobile security solutions

    - by techzen
    What are the mobile security solutions used by you / your organization. What are the pro's and cons of usage of these solution - and how far have you been successful in implementing these - were there any loopholes / issues faced in using them?. In general, can you suggest a set of guidelines to watch for when going for going for selecting a specific solution in this context.

    Read the article

  • What's the best way to check that environment variables are set in Unix shellscript

    - by AndrewR
    I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing: if [ -z "$STATE" ]; then echo "Need to set STATE" exit 1 fi if [ -z "$DEST" ]; then echo "Need to set DEST" exit 1 fi which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set? EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset.

    Read the article

  • Create and Backup Multiple Profiles in Google Chrome

    - by Asian Angel
    Other browsers such as Firefox and SeaMonkey allow you to have multiple profiles but not Chrome…at least not until now. If you want to use multiple profiles and create backups for them then join us as we look at Google Chrome Backup. Note: There is a paid version of this program available but we used the free version for our article. Google Chrome Backup in Action During the installation process you will run across this particular window. It will have a default user name filled in as shown here…you will not need to do anything except click on Next to continue installing the program. When you start the program for the first time this is what you will see. Your default Chrome Profile will already be visible in the window. A quick look at the Profile Menu… In the Tools Menu you can go ahead and disable the Start program at Windows Startup setting…the only time that you will need the program running is if you are creating or restoring a profile. When you create a new profile the process will start with this window. You can access an Advanced Options mode if desired but most likely you will not need it. Here is a look at the Advanced Options mode. It is mainly focused on adding Switches to the new Chrome Shortcut. The drop-down menu for the Switches available… To create your new profile you will need to choose: A profile location A profile name (as you type/create the profile name it will automatically be added to the Profile Path) Make certain that the Create a new shortcut to access new profile option is checked For our example we decided to try out the Disable plugins switch option… Click OK to create the new profile. Once you have created your new profile, you will find a new shortcut on the Desktop. Notice that the shortcut’s name will be Google Chrome + profile name that you chose. Note: On our system we were able to move the new shortcut to the “Start Menu” without problems. Clicking on our new profile’s shortcut opened up a fresh and clean looking instance of Chrome. Just out of curiosity we did decide to check the shortcut to see if the Switch set up correctly. Unfortunately it did not in this instance…so your mileage with the Switches may vary. This was just a minor quirk and nothing to get excited or upset over…especially considering that you can create multiple profiles so easily. After opening up our default profile of Chrome you can see the individual profile icons (New & Default in order) sitting in the Taskbar side-by-side. And our two profiles open at the same time on our Desktop… Backing Profiles Up For the next part of our tests we decided to create a backup for each of our profiles. Starting the wizard will allow you to choose between creating or restoring a profile. Note: To create or restore a backup click on Run Wizard. When you reach the second part of the process you can go with the Backup default profile option or choose a particular one from a drop-down list using the Select a profile to backup option. We chose to backup the Default Profile first… In the third part of the process you will need to select a location to save the profile to. Once you have selected the location you will see the Target Path as shown here. You can choose your own name for the backup file…we decided to go with the default name instead since it contained the backup’s calendar date. A very nice feature is the ability to have the cache cleared before creating the backup. We clicked on Yes…choose the option that best suits your needs. Once you have chosen either Yes or No the backup will then be created. Click Finish to complete the process. The backup file for our Default Profile at 14.0 MB in size. And the backup file for our Chrome Fresh Profile…2.81 MB. Restoring Profiles For the final part of our tests we decided to do a Restore. Select Restore and click Next to get the process started. In the second step you will need to browse for the Profile Backup File (and select the desired profile if you have created multiples). For our example we decided to overwrite the original Default Profile with the Chrome Fresh Profile. The third step lets you choose where to restore the chosen profile to…you can go with the Default Profile or choose one from the drop-down list using the Restore to a selected profile option. The final step will get you on your way to restoring the chosen profile. The program will conduct a check regarding the previous/old profile and ask if you would like to proceed with overwriting it. Definitely nice in case you change your mind at the last moment. Clicking Yes will finish the restoration. The only other odd quirk that we noticed while using the program was that the Next Button did not function after restoring the profile. You can easily get around the problem by clicking to close the window. Which one is which? After the restore process we had identical twins. Conclusion If you have been looking for a way to create multiple profiles in Google Chrome, then you might want to add this program to your system. Links Download Google Chrome Backup Similar Articles Productive Geek Tips Backup and Restore Firefox Profiles EasilyBackup Different Browsers Easily with FavBackupBackup Your Browser with the New FavBackupStupid Geek Tricks: Compare Your Browser’s Memory Usage with Google ChromeHow to Make Google Chrome Your Default Browser TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Acronis Online Backup DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows Tech Fanboys Field Guide Check these Awesome Chrome Add-ons iFixit Offers Gadget Repair Manuals Online Vista style sidebar for Windows 7 Create Nice Charts With These Web Based Tools Track Daily Goals With 42Goals

    Read the article

  • iPhone: Push Navigation Controller (w/ TableViewController) onto stack. Is this possible?

    - by Nic Hubbard
    I have a view which contains a UIButton. When this is clicked, it calls a method that loads another NIB. Now, normally, that nib would load a view onto the stack, and everything would be fine. But, I am trying to load a Navigation Controller (so that I can have table views that are multiple levels deep), and all I get it errors. What is the proper method for loading a Navigation Controller and putting it on the top of the stack?

    Read the article

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