Daily Archives

Articles indexed Saturday March 27 2010

Page 18/84 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • I need to iterate a loop to every time find the string appearing after a particular string say "if(O

    - by Parth
    I need to iterate a loop to every time find the string appearing after a particular string say "if(OLD.", then which PHP function will be helpful for me? Suppose I have a variable say, $string, according to any select query say "select * friends", Now any of its value contain a string say "how are you Jack?" Now I want to iterate a loop around the above value containing variable to get the varying name of friends after a string "how are you "... Hence I need a function of PHP to accomplish it... Please help

    Read the article

  • How to generate a stacktrace when my gcc C++ app crashes

    - by KPexEA
    When my c++ app crashes I would like to generate a stacktrace. I already asked this but I guess I needed to clarify my needs. My app is being run by many different users and it also runs on Linux, Windows and Macintosh ( all versions are compiled using gcc ). I would like my program to be able to generate a stack trace when it crashes and the next time the user run's it, it will ask them if it is ok to send the stack trace to me so I can track down the problem. I can handle the sending the info to me but I don't know how to generate the trace string. Any ideas?

    Read the article

  • How to calculate commision based on referred memebrs?

    - by RAJKISHOR SAHU
    Hello everybody, I am developing a small software in C# WPF for a consultancy which does chain system business. I have coded tree structure to show who referred whom. Now it has commission depending on level. If 1 referred 2 & 3 then 1 will get level-1 commission. If 2 referred 4, 5 & 3 referred 6, 7 then 1 will receive level-2 commission. This chain will go on to certain total number. My problem is how I would implement this logic; I am able to calculate who has referred how many members via UDF written for adding TreeViewItem to TreeView. Or tell me how I can count items in treeview in certain level? Node adding UDF: public void AddNodes(int uid, TreeViewItem tSubNode) { string query = "select fullname, id from members where refCode=" + uid + ";"; MySqlCommand cmd = new MySqlCommand(query, db.conn); MySqlDataAdapter _DA = new MySqlDataAdapter(cmd); DataTable _DT = new DataTable(); tSubNode.IsExpanded = true; _DA.Fill(_DT); foreach (DataRow _dr in _DT.Rows) { TreeViewItem tNode = new TreeViewItem(); tNode.Header = _dr["fullname"].ToString()+" ("+_dr["id"].ToString()+")"; tSubNode.Items.Add(tNode); if (db.HasMembers(Convert.ToInt32(_dr["id"].ToString()))) { AddNodes(Convert.ToInt32(_dr["id"]), tNode); } } //This line tracks who has referred how many members Console.WriteLine("Tree node Count : "+tSubNode.Items.Count.ToString()+", UID "+uid); } Help me PLEASE!!!!

    Read the article

  • how to use a parameterized function for the Default Binding of a Sql Server column

    - by Walt Gaber
    I have a table that catalogs selected files from multiple sources. I want to record whether a file is a duplicate of a previously cataloged file at the time the new file is cataloged. I have a column in my table (“primary_duplicate”) to record each entry as ‘P’ (primary) or ‘D’ (duplicate). I would like to provide a Default Binding for this column that would check for other occurrences of this file (i.e. name, length, timestamp) at the time the new file is being recorded. I have created a function that performs this check (see “GetPrimaryDuplicate” below). But I don’t know how to bind this function which requires three parameters to the table’s “primary_duplicate” column as its Default Binding. I would like to avoid using a trigger. I currently have a stored procedure used to insert new records that performs this check. But I would like to ensure that the flag is set correctly if an insert is performed outside of this stored procedure. How can I call this function with values from the row that is being inserted? USE [MyDatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[FileCatalog]( [id] [uniqueidentifier] NOT NULL, [catalog_timestamp] [datetime] NOT NULL, [primary_duplicate] nchar NOT NULL, [name] nvarchar NULL, [length] [bigint] NULL, [timestamp] [datetime] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_id] DEFAULT (newid()) FOR [id] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_catalog_timestamp] DEFAULT (getdate()) FOR [catalog_timestamp] GO ALTER TABLE [dbo].[FileCatalog] ADD CONSTRAINT [DF_FileCatalog_primary_duplicate] DEFAULT (N'GetPrimaryDuplicate(name, length, timestamp)') FOR [primary_duplicate] GO USE [MyDatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[GetPrimaryDuplicate] ( @name nvarchar(255), @length bigint, @timestamp datetime ) RETURNS nchar(1) AS BEGIN DECLARE @c int SELECT @c = COUNT(*) FROM FileCatalog WHERE name=@name and length=@length and timestamp=@timestamp and primary_duplicate = 'P' IF @c > 0 RETURN 'D' -- Duplicate RETURN 'P' -- Primary END GO

    Read the article

  • Embedding swf with players

    - by uswaretech
    I want too display PPTs as inline on webpage via swf. So I convert them to swf using OpenOffice scripting. I can embed them into webpage via swfobject, however this has two major problems, Swfobject require me to tell the size of uploaded swfs, which I dont know in advance, as size/aspect ratio of swf depends on uploaded presentation. This doesnot put next/previous controls. Is there a tool/library using which I can emebed swf player in page without these problems.

    Read the article

  • How to show unread subforums?

    - by bilygates
    I have written a simple forum in PHP using PostgreSQL. The forum consists of a number of subforums (or categories, if you like) that contain topics. I have a table that stores when was the last time a user visited a topic. It's something like this: user_id, topic_id, timestamp. I can easily determine what topics should be marked as unread by comparing the timestamp of the last topic reply with the timestamp of the last user visit. My question is: how do I efficiently determine what subforums (categories) should be marked as unread? All I've come up with is this: every time a user visits a topic, update the visit timestamp and check if all the topics from the current subforum are read or unread. If they are all read, mark the subforum as read for the user. Else, mark it as unread. But I think there must be another way. Thank you in advance.

    Read the article

  • SubSonic-based app that connects to multiple databases

    - by Fervelas
    Hello there, I currently developed an app that connects to SQL Server 2005 database, so my DAL objects where generated using information from that DB. It will also be possible to connect to an Oracle and MySQL db, all with the same table structures (aside from the normal differences in fields, such as varbinary(max) in SQL Server and BLOB in Oracle, and so on). For this purpose, I already defined multiple connection strings and multiple SubSonic providers for the different DB's the app will run on. My question is, if I generated my objects using a SQL Server database, should the generated objects work transparently with the other DB's or do I need to generate a different DAL for each database engine I use? Should I be aware of any possible bugs I may encounter while performing these operations? Thanks in advance for any advice on this issue.

    Read the article

  • MDB 2 CSV batch.

    - by darhipo
    Does anybody know what I could use to write a script to convert all MDB files in a directory to CSV files? I'm working on Windows but have been using Cygwin for some work.

    Read the article

  • Memory leak dyld dlopen

    - by imthi
    I am getting leak and I cannot detect from where this is happening. The stack trace does not give full info after dyld open. For few leaks I am not getting any stack trace info. All I get is only object memory address. Is anyone else facing the same issue. I am using XCode 3.2 on show leopard. 18 0x103038 17 0x1033c7 16 0x1034a1 15 0x90145f48 14 dyld dlopen 13 dyld dyld::link(ImageLoader*, bool, ImageLoader::RPathChain const&) 12 dyld ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, ImageLoader::RPathChain const&) 11 dyld ImageLoader::recursiveLoadLibraries(ImageLoader::LinkContext const&, bool, ImageLoader::RPathChain const&) 10 dyld dyld::libraryLocator(char const*, bool, char const*, ImageLoader::RPathChain const*) 9 dyld dyld::load(char const*, dyld::LoadContext const&) 8 dyld dyld::loadPhase0(char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) 7 dyld dyld::loadPhase1(char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) 6 dyld dyld::loadPhase3(char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) 5 dyld dyld::loadPhase4(char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) 4 dyld dyld::loadPhase5(char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) 3 dyld dyld::mkstringf(char const*, ...) 2 dyld strdup 1 dyld mallocenter

    Read the article

  • C: How come an array's address is equal to its value?

    - by Alexandre
    In the following bit of code, pointer values and pointer addresses differ as expected. But array values and addresses don't! How can this be? Output my_array = 0022FF00 &my_array = 0022FF00 pointer_to_array = 0022FF00 &pointer_to_array = 0022FEFC ... #include <stdio.h> int main() { char my_array[100] = "some cool string"; printf("my_array = %p\n", my_array); printf("&my_array = %p\n", &my_array); char *pointer_to_array = my_array; printf("pointer_to_array = %p\n", pointer_to_array); printf("&pointer_to_array = %p\n", &pointer_to_array); printf("Press ENTER to continue...\n"); getchar(); return 0; }

    Read the article

  • Concept of creating static Map

    - by chetan
    I want to create a Map object that can lose value only if we explicitly delete it from map. I have created Map object like public static Map<Long,String> listUser =new HasMap<Long,String>(); but every time class object is created new instance of Map is also created that contain null value. I want to create a Map instance that contain value we stored before.

    Read the article

  • What type of websites does memcached speed up

    - by Saif Bechan
    I have read this article about 400% boost of your website. This is done by a combination of nginx and memcached. The how-to part of this website is quite good, but i mis the part where it says to what types of websites this applies. I know nginx is a http engine, I need no explanation for that. I thought memcached had something to do with caching database result. However i don't understand what this has to do with the http request, can someone please explain that to me. Another question I have is for what types of websites is this used. I have a website where the important part of the website consist of data that changes often. Often being minutes. Will this method still apply to me, or should I just stick with the basic boring setup of apache and nothing else.

    Read the article

  • how to enable sqlite3 for php?

    - by terrani
    Hi, I am trying to install sqlite3 for php in ubuntu. I install apt-get php5-sqlite3 and edited php.ini to include sqlite3 extension. When I run phpinfo(); I get SQLITE3 SQLite3 support enabled sqlite3 library version 3.4.2 as shown above, sqlite3 is enabled. However, I get "Class SQLite3 not found" when I use new SQLite3("database");

    Read the article

  • How can I override the attribute assignment in an active record object?

    - by ryeguy
    I know you can do this with virtual attributes, but what if the column actually exists? For example, my model has a raw_topic column. When raw_topic is set, I want artist and song_title to be set based off of raw_topic's contents. Ideally, I'd like to override the raw_topic= method, but rails doesn't seem to like that. What's the proper way of doing this? Is a callback the only way?

    Read the article

  • Shell script to control user initiated processes

    - by Gnanam
    Hi, I'm not a shell script expert. I'm looking for a shell script which checks for maximum number of Java processes (MyJavaStandalone) running in the system before starting/executing the current Java process. Example: Script: /home/myfolder/script.sh script.sh contains /usr/java/jdk1.6.0/bin/java MyJavaStandalone >> $DATE.log & Here, before executing "MyJavaStandalone", if there are already 10 processes running, then this current process should not be started.

    Read the article

  • VNC - Is there any way to turn off logging/log files

    - by Ke
    Hi, I've looked everywhere for a solution to this. Is there any way to turn off this logging in VNC? VNC seems to be logging some large updates I'm doing in mysql and taking up my whole hard drive space. The only way to get rid of the log file is to reboot, which I would prefer not to have to do if possible. Cheers

    Read the article

  • MySQL "Host" permissions

    - by Wayne M
    Exactly what is the best way to configure this? I have a user account for a web app specified, but I also want to connect to the database via a GUI. The host is specified as % but the GUI tool repeatedly says access denied although I am using the proper password. If I change this to localhost then I can connect via the command line, but not via the GUI. If I add two entries, then I can connect via the command line and not the GUI. Leaving only the % doesn't let me connect via the command line OR the GUI. I want to be able to connect both on the actual server (via the web app itself) AND via the GUI tool.

    Read the article

  • memory cards capacity needs to be the same?

    - by balalakshmi
    I am not a hardware guy. I just heard this from a service engineer Memory cards of unequal capacities should not be used. that is if there is a 1 GM already in the slot, we need to add another 1 GB card only. Not 512 MB or 2 GB. Is there a problem if we use memory cards which are not equal capacities?

    Read the article

  • How do you explain what the BIOS is to non-Super User?

    - by David Johnstone
    In a particularly nerdy Facebook status update I mentioned that I had flashed my BIOS. One of my friends asked what the BIOS is. My question is: How do you explain what the BIOS is and does to a layperson? (Hint: "The BIOS is the basic input/output system" is not going to be accepted as the answer.) (Of course, the real question is "does she like me?", but I'm not sure there's a site for this :-p )

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >