78 Topics

Member Avatar for
Member Avatar for nadiam

Hello, i know this question has been asked a million times but I just cant seem to get it right. I googled and found [this](https://stackoverflow.com/questions/19611599/html5-phone-number-validation-with-pattern#19611675) and tried to use the pattern given but still the pop up still shows. I don't know what im doing wrong but its getting frustrating …

Member Avatar for diafol
0
400
Member Avatar for lanzslumber

Hi all. I am new in C language. I am learning to program by using C for my first step. Now I am reading a chapter about looping (while, for, do.. while, nested loop). In my exercise book, the question is about to: Using nested loop to print out this …

Member Avatar for markanderson4
0
3K
Member Avatar for letters1417

Hello! I have to print patterns using '*' and I am at a loss how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** …

Member Avatar for JamesCherrill
0
2K
Member Avatar for can-mohan

Hi All, Usually in factory method we need to check the existance of object based on given argument and then need to return the object and due to this we need to have multiple if and else statement and while adding one more type then again one more else block …

Member Avatar for rubberman
0
260
Member Avatar for vegaseat

If you draw a series of close spaced shapes your eyes get fooled to see Moire patterns. Here is one example of this.

2
2K
Member Avatar for Atlanta15Braves

I have a program that creates a right triangle from a loop reading "*". I have used the code to complete the first part, but the second part calls for a manipulation to take the current pattern, flip it upside down, and then add it to the first pattern. Here …

Member Avatar for stultuske
0
3K
Member Avatar for nikk8a

Hello, I have a string which consists of tokens enclosed in square brackets []. I need to identify these and process the string to replace them with some other derived values. I am unable to get list of tokens via Pattern matching. Below is my code snippet. String str = …

Member Avatar for nikk8a
0
239
Member Avatar for iConqueror

I am learning about design patterns in C# specifically the Bridge pattern. The GoF definition for the pattern states "Seerates an objects interface from its implementation". I have a question: Isnt an implementation of the interface always seperate from the interface itself? What exactly does the definition mean? Thankyou

Member Avatar for tinstaafl
0
180
Member Avatar for ParPau

I have been looking for a solution to isolate markings and have not found anything on the internet that is close to for what I am looking. I am trying to isolate the markings in a series of pictures. I have one, unmarked image. I then have a series of …

Member Avatar for Taywin
0
556
Member Avatar for piikun

we were given a task to create a for loop with where the user gives a number and became this output and we dont know if there is a sequence or an algorithm to it like fibonacci anyone recognize this pattern? input: 3 0|2 --- 0|2 Nice window. Thanks! input: …

Member Avatar for David W
0
146
Member Avatar for bm42

Hi all, I would like to pose a design pattern to discussion that is achieved in two different ways. Imagine the situation where you have an interface "IFoo" (aka virtual) and implementations "FooA", "FooB", ... that inherit and implement "IFoo". Now you want the user (of the library you are …

Member Avatar for bm42
0
1K
Member Avatar for mike_2000_17

# Introduction # The subject of this tutorial is a bit more advanced than the subjects I have tackled in the past, but I hope this will find some interested readers. From time to time in C++, programmers find themselves torn apart between using a *Generic Programming* style which primarily …

2
2K
Member Avatar for sarthak25
Member Avatar for pkrdimos

Hello. I am looking into mining API Usage Patterns for a project I am trying to work on. I would like if possible to avoid going through the trouble of building the (whole) tool from scratch as it will take quite some time. What I would like to avoid if …

0
127
Member Avatar for DeanMSands3

Hey Daniweb! What's a good site, or maybe someone could write up a quick-and-dirty example of a desktop app showing how to use the Model View Controller pattern? I'm no slouch at google-fu and found this lovely example through Wikipedia: http://www.songho.ca/opengl/gl_mvc.html which I'll look at after class tonight. I'd still …

Member Avatar for hulkishungry
0
298
Member Avatar for Zet_

Hi guys I want to develop a pattern recognition system for my final year project. The system will be an interface between a blind person and a mute person; I have chosen android platform for the system as most smart phones use it. I want the smart phone to use …

Member Avatar for JamesCherrill
0
218
Member Avatar for can-mohan

Guys, I need to write thread safe singleton class for my assignment. below is the code snippet for factory method in singleton class, I will appreciate if anyone is having suggestion for the same. *MySingleton * MySingleton::GetInstance() { if (m_pOnlyOneInstance == NULL) { pthread_mutex_lock(&mutex); m_pOnlyOneInstance = new MySingleton(); pthread_mutex_unlock(&mutex); } …

Member Avatar for mike_2000_17
0
4K
Member Avatar for dany12

Hy I want to understand what is a better approach on problem solving point of view for a php project , a framework or the mvc pattern? I would like to add that I know that both principels are quite the same but with a minor diffrence that a framework …

Member Avatar for dany12
0
368
Member Avatar for F_1

// CS 1063 Project 1: Print Text Patterns The Patterns Class Objectives This is one of three major programming projects this semester. You may NOT collaborate on this project. While you may ask for assistance in debugging, this project should be ENTIRELY your own work. [EDITED BY ADMIN ON COPYRIGHT …

Member Avatar for jwenting
-2
302
Member Avatar for diafol

What's with the current trend in weirdly patterned avatars? Seems like a lot of members now have them. Is this DW, Gravatar or what? e.g. Examples here: http://www.daniweb.com/members/120589/diafol/endorsements And is it me or are they constantly evolving? Doing my head in :)

Member Avatar for Dani
1
208
Member Avatar for PhilEaton

Here is the code: var Circle = function( radius ) { var _radius = radius, _area = function() { return Math.PI * _radius * _radius; }, _perimeter = function() { return 2 * Math.PI * _radius; }; this.radius = _radius; this.area = "Area" + _area(); this.perimeter = "Perimeter" + _perimeter(); …

Member Avatar for PhilEaton
0
152
Member Avatar for zai04

is it possible to input your name, middle name and surname and then will display initilas in large block letter made up of same character it represents???

Member Avatar for stultuske
0
201
Member Avatar for magicmarkuk

Hi I have a site built on Wordpress which has a over 4,000 posts all with the suffix -2 at the end of the post name (due to me forgetting to clear the trash) before running an import). I would like to remove the -2 from the post names with …

Member Avatar for magicmarkuk
0
278
Member Avatar for solomon_13000

I found some reading materials about factory design pattern (parallel hierarchy) whereby a class in a hierarchy has a corresponding class in the another hierarchy. So I wrote the code as below: package com.factory3; public abstract class Subject { abstract SubjectPlanner createPlanner(); } package com.factory3; public class English extends Subject{ …

0
153
Member Avatar for solomon_13000

I wrote a code to represent the factory design pattern as below: package com.factory2; public interface CreditCheck { Double creditLimit(int id); } package com.factory2; public class CreditCheckFactory { public boolean isAgencyUp(){ return true; } public CreditCheck createCreditCheck(){ if(isAgencyUp()){ return new CreditCheckOnline(); }else{ return new CreditCheckOffline(); } } } package com.factory2; …

Member Avatar for JamesCherrill
0
280
Member Avatar for solomon_13000

I wanted to verify is this a good example of a flyweight design pattern: package com.flyweight; public interface Chemical { String getName(); String getSymbol(); Double getAtomicWeight(); } package com.flyweight; import java.util.HashMap; import java.util.Map; public class ChemicalFactory { private static Map chemicals = new HashMap(); private static ChemicalFactory factory = new …

Member Avatar for ~s.o.s~
0
185
Member Avatar for solomon_13000

I wrote the following code: package com.chain; public interface Chain { void setNext(Chain chain); void process(int number); } package com.chain; public class ProcessNegative implements Chain{ private Chain chain; public void setNext(Chain chain){ this.chain = chain; } public void process(int number){ if(number < 0){ System.out.println("Negative"); }else{ chain.process(number); } } } package …

Member Avatar for solomon_13000
0
235
Member Avatar for solomon_13000

I am attempting to load an 3 icon image but my code doesn't do so: package com.proxy; import java.awt.Component; import java.awt.Graphics; import javax.swing.ImageIcon; import javax.swing.JFrame; public class ImageIconProxy extends ImageIcon implements Runnable{ static final ImageIcon ONE = new ImageIcon("/IFDesign/images/green.jpg"); static final ImageIcon TWO = new ImageIcon("/IFDesign/images/yellow.jpg"); ImageIcon CURRENT = ONE; …

Member Avatar for solomon_13000
0
361
Member Avatar for solomon_13000

Base on my understand a mediator is a central authority that varies the interaction between objects in the same group. So can I classify the code below as a mediator? package com.mediator; public class BaseMediator { public void store(){ System.out.println("store"); } public void retrieve(){ System.out.println("retrieve"); } } package com.mediator; public …

Member Avatar for solomon_13000
0
222
Member Avatar for anisha.silva

Hi I have a scenario that i need to implement. the scenario is below. I have a class handler and a class Healthmonitor. every 10 seconds i have to send a msg to HealthMonitor to update a variable. in one point if it didnt send a msg in a multiple …

Member Avatar for tinstaafl
0
255

The End.