Daily Archives

Articles indexed Tuesday March 23 2010

Page 32/130 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • redirect http to https for some page in site in APACHE

    - by Avinash
    Hi I want to one of my site's page will use only HTTPS. i have given manually link to all sites to https. But i want that if user manually types that page url with http then it should be redirected to https page. So if user types. http://mydomain.com/application.php then it should be redirected to https://mydomain.com/application.php Thanks Avinash

    Read the article

  • Recordset manipulation in SSIS

    - by JSacksteder
    In my SSIS job, I have a need to accumulate a set of rows and commit them all transitionally when processing has completed successfully. If this was pure SQL, I would use a temp table inside a transaction. In SSIS there are a number of issues complicating this. It's difficult to have multiple components share the same transaction and having temp tables that do not exist at design time is a pain. If I use Recordsets inside SSIS for this purpose, there are other issues. My understanding is that an 'Execute SQL' component will re-initialize the Recordset when it runs, so I can't use that to append an additional row. Is there a way to create an OLE DB connection that references an in-memory Recordset? Is there a better way to achieve this result?

    Read the article

  • Publishing to live website

    - by Alienfluid
    Hey there, My friend and I are collaborating on a ASP.NET powered website. To develop it locally, we use Visual Web Developer Express (good enough for our needs). Subversion (using Tortoise SVN) is our source control of choice with the repository residing on Unfuddle.com. We run into problems when we need to update the live site - since there's no version control on it. Currently we use the "Copy to Website" feature in VWD which copies the files using FTP. Here are some problems: VWD only keeps track of files uploaded by one user, so if the other user uploads a newer version of a file to the live site, VWD on my side cannot tell whether the live version of the file is newer or mine is. There's no way to tell whether all the latest changes are available on the live site. We have to be careful not to party all over the shared web.config file since the other user's local DB settings are different from mine, and of course, the live DB settings are a whole other story! What do you guys use to publish to a live site? Does anything out there tie into Subversion so that we can automate the process and always guarantee that the live site is synced to a change list number? Also, how do you manage the different web.config file settings? Thanks!

    Read the article

  • In a C++ template, is it allowed to return an object with spesific type parameters?

    - by nieldw
    When I've got a template with certain type parameters, is it allowed for a function to return an object of this same template, but with different types? In other words, is the following allowed? template<class edgeDecor, class vertexDecor, bool dir> Graph<edgeDecor,int,dir> Graph<edgeDecor,vertexDecor,dir>::Dijkstra(vertex s, bool print = false) const { /* Construct new Graph with apropriate decorators */ Graph<edgeDecor,int,dir> span = new Graph<edgeDecor,int,dir>(); /* ... */ return span; }; If this is not allowed, how can I accomplish the same kind of thing?

    Read the article

  • Code Explanation (MPICH)

    - by user243680
    #include "mpi.h" #include <stdio.h> #include <math.h> double f(double a) { return (4.0 / (1.0 + a*a)); } void main(int argc, char *argv[]) { int done = 0, n, myid, numprocs,i; double PI25DT = 3.141592653589793238462643; double mypi, pi, h, sum, x; double startwtime, endwtime; int namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); MPI_Get_processor_name(processor_name,&namelen); fprintf(stderr,"Process %d on %s\n", myid, processor_name); fflush(stderr); n = 0; while (!done) { if (myid == 0) { printf("Enter the number of intervals: (0 quits) ");fflush(stdout); scanf("%d",&n); startwtime = MPI_Wtime(); } MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD); if (n == 0) done = 1; else { h = 1.0 / (double) n; sum = 0.0; for (i = myid + 1; i <= n; i += numprocs) { x = h * ((double)i - 0.5); sum += f(x); } mypi = h * sum; MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); if (myid == 0) { printf("pi is approximately %.16f, Error is %.16f\n", pi, fabs(pi - PI25DT)); endwtime = MPI_Wtime(); printf("wall clock time = %f\n", endwtime-startwtime); } } } MPI_Finalize(); } Can anyone explain me the above code what it does??I am in lab and my miss has asked me to explain and i dont know what it is.please help

    Read the article

  • Daily tech links for .net and related technologies - Mar 23-25, 2010

    - by SanjeevAgarwal
    Daily tech links for .net and related technologies - Mar 23-25, 2010 Web Development Introducing Browsers Providers in ASP.NET 4 - osbornm ASP.NET 4.0 Part 14, More Control Over Session State - hmobius Editable MVC Routes (Apache Style) - nberardi ASP.NET Performance Framework - karlseguin Web Design Techniques for Squeezing Images for All They’re Worth - Walter 12 Useful and Free Downloadable Web Design Books - SpeckyBoy Getting Started with Xcode IDE for iPhone Development - keyvan Grid Accordion...(read more)

    Read the article

  • Google Apps - Can I configure a wildcard MX record and and catch all emai address for a domain

    - by Rohit
    I am using Google Apps Premier Edition. I want to create a disposable email address service and I want to catch all emails for a domain. This means that I should be able to catch all mails sent to an arbitrary userid and/or arbitrary domain and store them into a single Google Apps account. For example, in a single account I want to get all mails sent to: 1) [email protected] 2) [email protected] without requiring to do any extra configuration in Google Apps for abc or xyz. My app will download mails from this account and process accordingly. I have figured out that I could do (1) by specifying a catch all email address. Is the combination of both (1) and (2) possible?

    Read the article

  • How do you protect code from leaking outside?

    - by cubex
    Besides open-sourcing your project and legislation, are there ways to prevent, or at least minimize the damages of code leaking outside your company/group? We obviously can't block Internet access (to prevent emailing the code) because programmer's need their references. We also can't block peripheral devices (USB, Firewire, etc.) The code matters most when it has some proprietary algorithms and in-house developed knowledge (as opposed to regular routine code to draw GUIs, connect to databases, etc.), but some applications (like accounting software and CRMs) are just that: complex collections of routine code that are simple to develop in principle, but will take years to write from scratch. This is where leaked code will come in handy to competitors. As far as I see it, preventing leakage relies almost entirely on human process. What do you think? What precautions and measures are you taking? And has code leakage affected you before?

    Read the article

  • Can someone tell me why I'm seg faulting in this simple C program?

    - by user299648
    I keep on getting seg faulted, and for the life of me I dont why. The file I'm scanning is just 18 strings in 18 lines. I thinks the problem is the way I'm mallocing the double pointer called picks, but I dont know exactly why. I'm am only trying to scanf strings that are less than 15 chars long, so I don't see the problem. Can someone please help. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LENGTH 100 int main( int argc,char *argv[] ) { char* string = malloc( sizeof(char) ); char** picks = malloc(15*sizeof(char)); FILE* pick_file = fopen( argv[l], "r" ); int num_picks; for( num_picks=0 ; fgets( string, MAX_LENGTH, pick_file ) != NULL ; num_picks++ ) { printf("pick a/an %s ", string ); scanf( "%s", picks+num_picks ); } int x; for(x=0; x<num_picks;x++) printf("s\n", picks+x); }

    Read the article

  • UITableView: moving a row into an empty section

    - by Frank C
    I have a UITableView with some empty sections. I'd like the user to be able to move a row into them using the standard edit mode controls. The only way I can do it so far is to have a dummy row in my "empty" sections and try to hide it by using tableView:heightForRowAtIndexPath: to give the dummy row a height of zero. This seems to leave it as a 1-pixel row. I can probably hide this by making a special type of cell that's just filled with [UIColor groupTableViewBackgroundColor], but is there a better way? This is all in the grouped mode of UITableView UPDATE: Looks like moving rows into empty sections IS possible without any tricks, but the "sensitivity" is bad enough that you DO need tricks in order to make it usable for general users (who won't be patient enough to slowly hover the row around the empty section until things click)

    Read the article

  • A question about the order of pagination

    - by SpawnCxy
    Currently I'm deal with a history message page using Cakephp.And I got a problem about records' order.In the controller,codes about pagination as follows $this->paginate['Msg'] = array('order'=>'Msg.created desc'); $msgs = $this->paginate('Msg'); $this->set('historymsgs',$msgs); Then I got a page of messges like this: tom:I'm eighteen. Jerry:How old are you? tom:Tom. Jerry:what's your name? tom:Hi nice to meet you too! Jerry:Hello,nice to meet you! But what I need is the reversed order of the messages.How can I append a condition of Msg.created asc here? Thanks in advance.

    Read the article

  • Getting column info from db with C#

    - by lYriCAlsSH
    In PHP I am able to retrieve information from a db like so: <?php $sql = "SELECT * FROM users"; $result = mysql_query($sql); $data = array(); while($row = mysql_fetch_assoc($result)) { $data[] = $row; } I am trying to acomplish the same thing in C#: OdbcCommand cmd = new OdbcCommand("SELECT * FROM users WHERE id = @id"); cmd.Parameters.Add("@id", id); OdbcDataReader reader = cmd.ExecuteReader(); Dictionary<string, string> data = new Dictionary<string, string>(); while (reader.Read()) { data.Add("id", reader.GetString(0)); data.Add("username", reader.GetString(1)); data.Add("firstName", reader.GetString(2)); } return data; Is it possible to reference the column in the table by name without going through all this trouble?

    Read the article

  • WPF Validation & IDataErrorInfo

    - by Jefim
    A note - the classes I have are EntityObject classes! I have the following class: public class Foo { public Bar Bar { get; set; } } public class Bar : IDataErrorInfo { public string Name { get; set; } #region IDataErrorInfo Members string IDataErrorInfo.Error { get { return null; } } string IDataErrorInfo.this[string columnName] { get { if (columnName == "Name") { return "Hello error!"; } Console.WriteLine("Validate: " + columnName); return null; } } #endregion } XAML goes as follows: <StackPanel Orientation="Horizontal" DataContext="{Binding Foo.Bar}"> <TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=true}"/> </StackPanel> I put a breakpoint and a Console.Writeline on the validation there - I get no breaks. The validation is not executed. Can anybody just press me against the place where my error lies?

    Read the article

  • how to print correctly the handling thread on Windows?

    - by make
    Hi, Could someone please tell us on how to print correctly the handling thread in windows? Actually I tried several ways but it doesn't return the right number as in Unix-variant, as such e.g.: cout << " with thread " << pthread_self << endl; cout << " with thread " << pthread_self().p << endl; Thanks for your replies:

    Read the article

  • Flex RSL Understanding

    - by dta
    Till now I was using "Merged into code" for "Framework Linkage" in Flex Builder. Now, I changed it to "Runtime shared library". On doing a release build I got myapp.swf which is roughly 260 KB which was earlier close to 350 KB. It also generated framework.swz and framework.swf. But I copied only myapp.swf on my web site and not framework.swz. Still the website works just fine. I also cleared the flash player cache from here. It works just fine without the .swz file. So my questions are: Is the framework.swz file actually used or does the flash player have a copy of it beforehand. And is that copy not cleared by clearing cache of flash player? And, even after clearing the cache, I didn't see a request for framework.swz in firebug. Why?

    Read the article

  • wsdl return an array of complex types

    - by Anand
    hi, I have defined a web service that will return the data from my mysql data base. I have written the web service in php. Now I have defined a complex type as follows: $server->wsdl->addComplexType( 'Category', 'complexType', 'struct', 'all', '', array( 'category_parent_id' => array('name' => 'category_parent_id', 'type' => 'xsd:int'), 'category_child_id' => array('name' => 'category_child_id', 'type' => 'xsd:int'), 'category_list' => array('name' => 'category_list', 'type' => 'xsd:int') ) ); The above complex type is a row in a table in my database. Now my function must send an array of these rows so how do I achieve the same My code is as follows: require_once('./nusoap/nusoap.php'); $server = new soap_server; $server-configureWSDL('productwsdl', 'urn:productwsdl'); // Register the data structures used by the service $server-wsdl-addComplexType( 'Category', 'complexType', 'struct', 'all', '', array( 'category_parent_id' = array('name' = 'category_parent_id', 'type' = 'xsd:int'), 'category_child_id' = array('name' = 'category_child_id', 'type' = 'xsd:int'), 'category_list' = array('name' = 'category_list', 'type' = 'xsd:int') ) ); $server-register('getaproduct', // method name array(), // input parameters //array('return' = array('result' = 'tns:Category')), // output parameters array('return' = 'tns:Category'), // output parameters 'urn:productwsdl', // namespace 'urn:productwsdl#getaproduct', // soapaction 'rpc', // style 'encoded', // use 'Get the product categories' // documentation ); function getaproduct() { $conn = mysql_connect('localhost','root',''); mysql_select_db('sssl', $conn); $sql = "SELECT * FROM jos_vm_category_xref"; $q = mysql_query($sql); while($r = mysql_fetch_array($q)) { $items[] = array('category_parent_id'=$r['category_parent_id'], 'category_child_id'=$r['category_child_id'], 'category_list'=$r['category_list']); } return $items; } // Use the request to (try to) invoke the service $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server-service($HTTP_RAW_POST_DATA);

    Read the article

  • jQuery display problem?

    - by SLAPme
    How do I hide the #changes-saved code using jQuery? For example let's say the code is displayed when the user clicks the submit button and then leaves the current web page and then returns back to the web page and the #changes-saved is no longer displayed until the submit button is clicked again. Here is the jQuery code. $(function() { $('#changes-saved').hide(); $(".save-button").click(function() { $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) { $("div.contact-info-form").html(html); $('#changes-saved').append('<li>Changes saved!</li>').show().pause(1000).hide(); }); return false; // Prevent normal submit. }); });

    Read the article

  • Printing a sideways triangle in java

    - by Will
    I'm trying to print a sideways triangle in java. If the user enters 5, the output should be: * *** ***** *** * If the user enters 6, the output should be: * *** ***** ***** *** * I've gotten it to work for the case when the user enters 5, 3, or 1 but my code seems to work for those three cases only. I was wondering if anyone could help me get my code working for more cases. Here it is: public void printArrow( int n ) { int asterisks = 1; for ( int i = 0; i <= n/2; i++ ) { for ( int j = i; j < asterisks; j++ ) { System.out.print( "*" ); } asterisks += 3; System.out.println(); } asterisks = asterisks / 2 - 2; for ( int i = 0; i < n/2; i++ ) { for ( int k = i; k < asterisks; k++ ) { System.out.print( "*" ); } if ( i == 1 ) { System.out.print( "*" ); } asterisks -= 2; System.out.println(); } }

    Read the article

  • What is SSIS order of data transformation component method calls

    - by Ron Ruble
    I am working on a custom data transformation component. I'm using NUnit and NMock2 to test as I code. Testing and getting the custom UI and other features right is a huge pain, in part because I can't find any documentation about the order in which SSIS invokes methods on the component at design time as well as runtime. I can correct the issues readily enough, but it's tedious and time consuming to unregister the old version, register the new version, fire up the test ssis package, try to display the UI, get an obscure error message, backtrace it, modify the component and continue. One of the big issues involves the UI component needing access to the componentmetadata and buffermanager properties of the component at design time, and what I need to provide for to support properties that won't be initialized until after the user enters them in the UI. I can work through it; but if someone knows of some docs or tips that would speed me up, I'd greatly appreciate it. The samples I've found havn't been much use; they seem to be directed to showing off cool stuff (Twitter, weather.com) rather than actual work. Thanks in advance.

    Read the article

  • NSCFArray leak in the NSMutablearray allocation

    - by Srilakshmi Manthena
    Hi, I am getting the leak at this allocation filteredListContent = [[NSMutableArray alloc] initWithCapacity: [showList count]]; CODE: -(void)reloadTable { EventListAppDelegate *appDelegate = (EventListAppDelegate *)[[UIApplication sharedApplication] delegate]; contactList = [appDelegate getAllContactsList]; inviteeList = [appDelegate getInviteeListForEvent:event.primaryKey]; if (isInvited == YES) { showList=[appDelegate getInviteeListForEvent:event.primaryKey]; } else { showList =[appDelegate getAllContactsList]; } filteredListContent = [[NSMutableArray alloc] initWithCapacity: [showList count]]; [filteredListContent addObjectsFromArray: showList]; [self organizeContactItemsIntoIndexes]; self.title = [event.name capitalizedString]; [self getToolbar]; [theTableView reloadData]; } (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { [filteredListContent removeAllObjects]; ContactDTO *currentElement; NSRange range; for (currentElement in showList) { range = [currentElement.lastName rangeOfString:searchText options:NSCaseInsensitiveSearch]; if(range.location==0) { [filteredListContent addObject:currentElement]; } } [self organizeContactItemsIntoIndexes]; [theTableView reloadData]; } (void)dealloc { [filteredListContent release]; [super dealloc]; }

    Read the article

  • PDOStatement::bindParam() not setting AI value from MySQL insert?

    - by Alan
    I have a simple insert statement using PDO php class. $statement = $db->prepare('INSERT INTO demographics (id,location_id,male,ethnicity_id,birthyear) VALUES (:id,:location_id,:male,:ethnicity_id,:birthyear)'); $statement->bindParam(':id',$demo->id,PDO::PARAM_INT,4); $statement->bindParam(':location_id', $demo->locationid,PDO::PARAM_INT); $statement->bindParam(':male',$demo->male,PDO::PARAM_BOOL); $statement->bindParam(':ethnicity_id',$demo->ethnicityid,PDO::PARAM_INT); $statement->bindParam(':birthyear',$demo->birthyear,PDO::PARAM_INT); $statement->execute(); print_r($demo); Even though the statement executes correctly (row is correctly written), $demo-id is null. Any thoughts?

    Read the article

  • TCHAR end of line character

    - by Xaver
    int DownloadFtpDirectory(TCHAR* DirPath) { WIN32_FIND_DATA FileData; UINT a; TCHAR* APP_NAME = TEXT("ftpcli"); TCHAR* f; int j = 5; do { j++; f = _tcsninc(DirPath, j); }while (_tcsncmp(f, TEXT("/"), 1)); TCHAR* PATH_FTP = wcsncpy(new TCHAR[j], DirPath, j); After the last line gets a string in which there is no line ending character, how to fix this? P.S. how to do so would be out of line "ftp://ftp.microsoft.com/bussys/", get a string ftp.microsoft.com if both strings are TCHAR ?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >