Daily Archives

Articles indexed Friday April 16 2010

Page 28/120 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Deploying application with ClickOnce to network share while being offsite

    - by MadBoy
    I have application written in Visual Studio 2008 which I deploy with ClickOnce to network share while at work. Sometimes I work from home and I don't have VPN that allows access of shares to deploy application from outside of company. Is there a way that I could simple pack it, send thru FTP and unpack it on the server so that ClickOnce never notices it's been delivered differently and so it doesn't loose numeration and everything associated with normal network deployment? It's C#, .NET 3.5 application.

    Read the article

  • Deleting duplicates in Delphi listview

    - by radick
    I am trying to remove duplicates in my listview. This function: procedure RemoveDuplicates(const LV:TbsSkinListView); var i,j: Integer; begin LV.Items.BeginUpdate; LV.SortType := stText; try for i := 0 to LV.Items.Count-1 do begin for j:=i+1 to LV.Items.Count-1 do begin if SameText(LV.Items[i].SubItems[0], LV.Items[j].SubItems[0]) and SameText(LV.Items[i].SubItems[1], LV.Items[j].SubItems[1]) and SameText(LV.Items[i].SubItems[2], LV.Items[j].SubItems[2]) and SameText(LV.Items[i].SubItems[3], LV.Items[j].SubItems[3]) then LV.Items.Delete(j); end; end; finally LV.SortType := stNone; LV.Items.EndUpdate; end; ShowMessage('Deleted'); end; does not delete the duplicates. What is wrong with it?

    Read the article

  • Record/Playback with AudioQueue on iPhone

    - by Biranchi
    Hi, I am currently using Audio Queues on the iPhone to record and playback audio. What I would like to be able to do is to record some audio, allow the user to pause the record queue, and to seek back and forward through the audio to select a position from where they can start recording from again. I have got over the seeking issue by making the playback AudioQueueBuffer sizes small enough so that the play audio queue callback happens at a rate that allows the user to use a slider control to hear the audio as they adjust the slider back and forth. I think I can achieve the recording at a new position by setting the inStartingPacket parameter of the AudioFileWritePackets function that I call from the Audio Recording Queue callback. The trouble is this only inserts audio over the previously recorded audio. The file length obviously doesn't change so if the user were to go backwards and record less audio than before, the old audio still remains after the end of the newly recorded audio. Is there a way I can get the AudioFile to truncate at the point the user starts to insert the new audio, is there some other way I can remove the old audio starting at the insert position or is there a better way about going about this task? Thanks

    Read the article

  • can a webservice load jars during run time

    - by KItis
    I have created a simple web-service using Java. i want to load jars related to web-service during runtime. I have done this task for normal Java application. there what I did was JarFile jar = new JarFile(f.getPath()); final Manifest manifest = jar.getManifest(); final Attributes mattr = manifest.getMainAttributes(); // Read the manifset in jar files and get the Name attribute // whare it specified the class that need to load //for (Object a : mattr.keySet()) { for (Iterator iter = mattr.keySet().iterator(); iter.hasNext();) { Object obj = (Object)iter.next(); if ("ServiceName".equals(obj.toString())) className = mattr.getValue((Name) obj); //System.out.println(className); } /* * Create the jar class loader and use the first argument passed * in from the command line as the jar file to use. */ JarClassLoader jarLoader = new JarClassLoader(f.getPath()); /* Load the class from the jar file and resolve it. */ Class c = jarLoader.loadClass(className, true); My problem is can I put jars that need to be loaded during run time in to separate folder rather than putting in to WEBINF folder. do i have to put jars both in axis and web-application. thanks in advance for any contribution for this question.

    Read the article

  • "Anagram solver" based on statistics rather than a dictionary/table?

    - by James M.
    My problem is conceptually similar to solving anagrams, except I can't just use a dictionary lookup. I am trying to find plausible words rather than real words. I have created an N-gram model (for now, N=2) based on the letters in a bunch of text. Now, given a random sequence of letters, I would like to permute them into the most likely sequence according to the transition probabilities. I thought I would need the Viterbi algorithm when I started this, but as I look deeper, the Viterbi algorithm optimizes a sequence of hidden random variables based on the observed output. I am trying to optimize the output sequence. Is there a well-known algorithm for this that I can read about? Or am I on the right track with Viterbi and I'm just not seeing how to apply it?

    Read the article

  • curl multiple request session issue

    - by embedded
    I'm using curl multi API for multiple curl requests. first I'm using a single request to login to a site and save the cookie file. then I'm using the curl multi API to get some data from that site. The problem I'm facing is that from some reason the cookie file does not get read and I'm redirecting to the main login page. I must say that this work once in awhile so I can't point what went wrong. Any help would be much appreciated. Thanks

    Read the article

  • friendship and operator overloading help

    - by sil3nt
    hello there, I have the following class #ifndef Container_H #define Container_H #include <iostream> using namespace std; class Container{ friend bool operator==(const Container &rhs,const Container &lhs); public: void display(ostream & out) const; private: int sizeC; // size of Container int capacityC; // capacity of dynamic array int * elements; // pntr to dynamic array }; ostream & operator<< (ostream & out, const Container & aCont); #endif and this source file #include "container.h" /*----------------------------********************************************* note: to test whether capacityC and sizeC are equal, must i add 1 to sizeC? seeing as sizeC starts off with 0?? */ Container::Container(int maxCapacity){ capacityC = maxCapacity; elements = new int [capacityC]; sizeC = 0; } Container::~Container(){ delete [] elements; } Container::Container(const Container & origCont){ //copy constructor? int i = 0; for (i = 0; i<capacityC; i++){ //capacity to be used here? (*this).elements[i] = origCont.elements[i]; } } bool Container::empty() const{ if (sizeC == 0){ return true; }else{ return false; } } void Container::insert(int item, int index){ if ( sizeC == capacityC ){ cout << "\n*** Next: Bye!\n"; return; // ? have return here? } if ( (index >= 0) && (index <= capacityC) ){ elements[index] = item; sizeC++; } if ( (index < 0) && (index > capacityC) ){ cout<<"*** Illegal location to insert--"<< index << ". Container unchanged. ***\n"; }//error here not valid? according to original a3? have i implemented wrong? } void Container::erase(int index){ if ( (index >= 0) && (index <= capacityC) ){ //correct here? legal location? int i = 0; while (i<capacityC){ //correct? elements[index] = elements[index+1]; //check if index increases here. i++; } sizeC=sizeC-1; //correct? updated sizeC? }else{ cout<<"*** Illegal location to be removed--"<< index << ". Container unchanged. ***\n"; } } int Container::size()const{ return sizeC; //correct? } /* bool Container::operator==(const Container &rhs,const Container &lhs){ int equal = 0, i = 0; for (i = 0; i < capacityC ; i++){ if ( rhs.elements[i] == lhs.elements[i] ){ equal++; } } if (equal == sizeC){ return true; }else{ return false; } } ostream & operator<< (ostream & out, const Container & aCont){ int i = 0; for (i = 0; i<sizeC; i++){ out<< aCont.elements[i] << " " << endl; } } */ I dont have the other functions in the header file (just a quikie). Anyways, the last two functions in "/* */" I cant get to work, what am I doing wrong here? the first function is to see whether the two arrays are equal to one another

    Read the article

  • Sqlite3 query in objective c

    - by user271753
    -(IBAction)ButtonPressed:(id)sender { const char *sql = "SELECT AccessCode FROM UserAccess"; NSString *sqlns; sqlns = [NSString stringWithUTF8String:sql]; if([Password.text isEqual:sqlns]) { NSLog(@"Correct"); } else { NSLog(@"Wrong"); } NSLog(@"%@",sqlns); } Noob here , At NSLog I am able to print "SELECT AccessCode FROM UserAccess" where as let say the access code is 1234 , which I want . In the appdelegate I Have : /// - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after app launch [self createEditableCopyOfDatabaseIfNeeded]; [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } /// - (void)createEditableCopyOfDatabaseIfNeeded { NSLog(@"Creating editable copy of database"); // First, test for existence. BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"UserAccess.sqlite"]; success = [fileManager fileExistsAtPath:writableDBPath]; if (success) return; // The writable database does not exist, so copy the default to the appropriate location. NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"UserAccess.sqlite"]; success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&error]; if (!success) { NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]); } } /// +(sqlite3 *) getNewDBConnection{ sqlite3 *newDBconnection; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"UserAccess.sqlite"]; // Open the database. The database was prepared outside the application. if (sqlite3_open([path UTF8String], &newDBconnection) == SQLITE_OK) { NSLog(@"Database Successfully Opened :) "); } else { NSLog(@"Error in opening database :( "); } return newDBconnection; } Please help :(

    Read the article

  • How to dispose off custom object from within custom membership provider

    - by IrfanRaza
    I have created my custom MembershipProvider. I have used an instance of the class DBConnect within this provider to handle database functions. Please look at the code below: public class SGIMembershipProvider : MembershipProvider { #region "[ Property Variables ]" private int newPasswordLength = 8; private string connectionString; private string applicationName; private bool enablePasswordReset; private bool enablePasswordRetrieval; private bool requiresQuestionAndAnswer; private bool requiresUniqueEmail; private int maxInvalidPasswordAttempts; private int passwordAttemptWindow; private MembershipPasswordFormat passwordFormat; private int minRequiredNonAlphanumericCharacters; private int minRequiredPasswordLength; private string passwordStrengthRegularExpression; private MachineKeySection machineKey; **private DBConnect dbConn;** #endregion ....... public override bool ChangePassword(string username, string oldPassword, string newPassword) { if (!ValidateUser(username, oldPassword)) return false; ValidatePasswordEventArgs args = new ValidatePasswordEventArgs(username, newPassword, true); OnValidatingPassword(args); if (args.Cancel) { if (args.FailureInformation != null) { throw args.FailureInformation; } else { throw new Exception("Change password canceled due to new password validation failure."); } } SqlParameter[] p = new SqlParameter[3]; p[0] = new SqlParameter("@applicationName", applicationName); p[1] = new SqlParameter("@username", username); p[2] = new SqlParameter("@password", EncodePassword(newPassword)); bool retval = **dbConn.ExecuteSP("User_ChangePassword", p);** return retval; } //ChangePassword public override void Initialize(string name, NameValueCollection config) { if (config == null) { throw new ArgumentNullException("config"); } ...... ConnectionStringSettings ConnectionStringSettings = ConfigurationManager.ConnectionStrings[config["connectionStringName"]]; if ((ConnectionStringSettings == null) || (ConnectionStringSettings.ConnectionString.Trim() == String.Empty)) { throw new ProviderException("Connection string cannot be blank."); } connectionString = ConnectionStringSettings.ConnectionString; **dbConn = new DBConnect(connectionString); dbConn.ConnectToDB();** ...... } //Initialize ...... } // SGIMembershipProvider I have instantiated dbConn object within Initialize() event. My problem is that how could i dispose off this object when object of SGIMembershipProvider is disposed off. I know the GC will do this all for me, but I need to explicitly dispose off that object. Even I tried to override Finalize() but there is no such overridable method. I have also tried to create destructor for SGIMembershipProvider. Can anyone provide me solution.

    Read the article

  • Pass object to dynamically loaded ListView ItemTemplate

    - by mickyjtwin
    I have been following the following post on using multiple ItemTemplates in a ListView control. While following this example does produce output, I am trying ot figure out how to psas an object through to the ItemTemplate's user control, which I do not seem to be able to do/figure out. protected void lvwComments_OnItemCreated(object sender, ListViewItemEventArgs e) { ListViewDataItem currentItem = (e.Item as ListViewDataItem); Comment comment = (Comment)currentItem.DataItem; if (comment == null) return; string controlPath = string.Empty; switch (comment.Type) { case CommentType.User: controlPath = "~/layouts/controls/General Comment.ascx"; break; case CommentType.Official: controlPath = "~/layouts/controls/Official Comment.ascx"; break; } lvwComments.ItemTemplate = LoadTemplate(Controlpath); } The User Control is as follows: public partial class OfficialComment : UserControl { protected void Page_Load(object sender, EventArgs e) { } } In the example, the values are being output in the ascx page: <%# Eval("ItemName") %> however I need to access the ListItem in this control to do other logic. I cannot figure out how I to send through my Comment item. The sender object and EventArgs do not contain the info.

    Read the article

  • Getting rid of index.php in the URL when using recess framework and lighttpd

    - by spudnik1979
    I am using the recess php framework with lighttpd Does anyone know how I can use the shorter urls of: http://www.myserver.com/recess Instead of: http://www.myserver.com/index.php/recess The recess readme file says that if I have mod_rewrite I can use the shorter url: -- "Do you have mod_rewrite? -- Yes: Open your browser to the location you unzipped -- No: Open your browser to the location you unzipped followed by index.php" I do have mod_rewrite enabled on lighttpd and i have removed the index.php but I get a 404. Do I need any special rules in my lighttpd.conf?

    Read the article

  • Security behaviour in Adobe Air

    - by t.stamm
    Hi everyone! I am trying to load external SWFs in my Adobe AIR App. The loaded SWF is trying to access an URL to retrieve some informations via XML. When starting the SWF by itself it works fine. When loading the SWF from the File.applicationStorageDirectory i will get an Security-Error because the loaded App is executed in a local-with-filesystem Sandbox appareantly. First Question: Is there a way to change this? That the loaded SWF is running in a network Sandbox? Since that first attempt didn't worked i've moved the SWF to the app:// directory. Now i'll get a Security-Error because there is no policy file on the Server available where the XML data should be retrieved. Second Question: Why is the policy file not necessary when running the SWF by itself, but is necessary when trying to load the data from the application Sandbox? What am i doing wrong? Thanks in advance!

    Read the article

  • Getting array of Values of Textboxes with the same class

    - by nCdy
    I setup custom CSS class for array of dynamic TextBoxes (inputs as HTML) so... now I need to get array of it : <input type="text" style="width: 50px;" class="DynamicTB" id="ctl00_ContentPlaceHolder1_GridView1_ctl02_id" readonly="readonly" value="1" name="ctl00$ContentPlaceHolder1$GridView1$ctl02$id"> sure client don't really knows the count of inputs. That's why I use class and here is what I'm trying to make : $.each( { id : $("input.DynamicTB").css("value") }, function(id){ CallPageMethod("SelectBook", success, fail, "id",id); }); I'm not sure if this $("input.DynamicTB").css("value") will works correct :( but How can I transfer whole array of values to SelectBook Method ? My javascript is bad and my debugger don't show me javascript errors but it just doesn't works because of something wrong with each. And ... finally I just need to get array of values of dynamic textboxes and transfer them to server side ... mt [WebMethode] can't see server side :( [Web.Services.WebMethod] public static SelectBook(id : array) : string { id } And sure I have no idea how can I use jQuery .live and binding here.

    Read the article

  • How to set the attributes of cell progamatically without using nib file ?

    - by srikanth rongali
    - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line to display an Edit button in the navigation bar for this view controller. self.title = @"Library"; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; self.tableView.rowHeight = 80; } -(void)close:(id)sender { // } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; UILabel *dateLabel = [[UILabel alloc]init]; dateLabel.frame = CGRectMake(85.0f, 6.0f, 200.0f, 20.0f); dateLabel.tag = tag1; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; cell.contentView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 80.0f); [cell.contentView addSubview:dateLabel]; [dateLabel release]; } // Set up the cell... //[(UILabel *)[cell viewWithTag:tag1] setText:@"Date"]; cell.textLabel.text = @"Date"; return cell; } But the control is not entering into the tableView: method. So I could not see any label in my table. How can I make this ? Thank You

    Read the article

  • Can we run MVC 2.0 on .Net 2.0

    - by Vinni
    Hello guys, I have an asp.net website which is already developed in .net 3.5, Now I asked to develop few pages in MVC 2.0 and few pages in DynamicData. Now Can I Run the MVC 2.0 and Dynamic Data in 3.5. When I run this i am getting lot of errors in web.config..

    Read the article

  • Merging two ASF files

    - by sijith
    I have an ASF file which contain 8 audios and 1 video. Now i want to merge this file with other of same ASF type. Is it possible to do with windows media SDK. My language is VC++ Please give some help

    Read the article

  • LocationListener is being called multiple times

    - by sujitjitu
    Hi, I am working on an Location Based Application. In this application i am using LocationListener class to update the location when the Location is changed.In each Activity i have different LocationListener to update location and do some specific work on updated location. But my problem is that when i am changing my location through DDMS , the LocationListener is being called of that current Activity as well as all the activities of the whole application where LocationListener has been defined. I don't know whether there should be one LocationListener for the whole application or for each Activity we should have different LocationListener. Please help me......Its urgent..........Thanks in Advance.....

    Read the article

  • Comparing tables with filtering in different databases and visualizing diffs/pushing changes

    - by MicMit
    I am building certain GUI in C# for a content manager and looking for the tools or code snippets or open libraries ( code ideally in C# ) which allow me the following : 1. For table A in database X (test ) and table A in database Y (production) and for a simple filter ( e.g. listname = "XYZ" ) I need to show additions/deletions/updates in some way. which might be side-by-side or just 2 record added table with some fields 2 record deleted table with some fields Considering that this task is very common, I guess, certain components should exist ? Components either return some collections from parameters given for further visualizing or just produce for e.g. html report. 2. I need to push changes for the filter I mentioned in 1 and update table in production database for this filter only ( ie for the particular list approved by content person). Again probably there are certain SQL code generators - components in addition to diffs or standalone.

    Read the article

  • Retrieving only the first record or record at a certain index in LINQ

    - by vik20000in
    While working with data it’s not always required that we fetch all the records. Many a times we only need to fetch the first record, or some records in some index, in the record set. With LINQ we can get the desired record very easily with the help of the provided element operators. Simple get the first record. If you want only the first record in record set we can use the first method [Note that this can also be done easily done with the help of the take method by providing the value as one].     List<Product> products = GetProductList();      Product product12 = (         from prod in products         where prod.ProductID == 12         select prod)         .First();   We can also very easily put some condition on which first record to be fetched.     string[] strings = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };     string startsWithO = strings.First(s => s[0] == 'o');  In the above example the result would be “one” because that is the first record starting with “o”.  Also the fact that there will be chances that there are no value returned in the result set. When we know such possibilities we can use the FirstorDefault() method to return the first record or incase there are no records get the default value.        int[] numbers = {};     int firstNumOrDefault = numbers.FirstOrDefault();  In case we do not want the first record but the second or the third or any other later record then we can use the ElementAt() method. In the ElementAt() method we need to pass the index number for which we want the record and we will receive the result for that element.      int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };      int fourthLowNum = (         from num in numbers         where num > 5         select num )         .ElementAt(1); Vikram

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >