Search Results

Search found 50994 results on 2040 pages for 'simple solution'.

Page 1/2040 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Boss solution vs Developer solution

    - by mahen23
    The problem: When we were sending newsletters to customers, there was no way to confirm if the customer already received the mail. So the boss decided to implement this idea: Boss's Idea: Each time mail was being sent, do an INSERT in a db with the title of the newsletter being sent and the email address which is receving the email address. To ensure that any email address does not receive the same email twice, do a SELECT in the table and find the title of the newsletter being sent: if (title of newsletter is found) { check to see of the email we are sending mail to is already present. if it does, do not send mail } else { send mail } MY idea: create a column called unique and mark it as UNIQUE. Each time mail was being sent, concatenate email + newsletter id and record it in the UNIQUE row. The next time we do a "mysql_affected_rows" check to see if our INSERT was successful, we send the mail, else, there is already a duplicate and no need to send it.

    Read the article

  • Simple scan not working after upgrading to 12.10 (Xubuntu)

    - by mydoghasworms
    Since upgrading to 12.10 (Xubuntu), Simple Scan is not working anymore. I got scanning working with Xsane, but only if Simple Scan has not run before. Otherwise I have to restart the printer/scanner (HP OfficeJet J5783). In kernel.log I see: kernel: [ 1214.120964] usb 2-1.4: >usbfs: process 4412 (simple-scan) did not claim interface 2 before use and in syslog simple-scan: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: No data available simple-scan: io/hpmud/musb.c 1933: invalid Dot4Credit from peripheral simple-scan: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: No data available simple-scan: io/hpmud/musb.c 1933: invalid Dot4Credit from peripheral simple-scan: sane_hpaio_cancel: already cancelled! simple-scan: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: No data available simple-scan: io/hpmud/musb.c 1933: invalid Dot4Credit from peripheral simple-scan: io/hpmud/dot4.c 231: unable to read Dot4ReverseReply header: No data available bytesRead=0 simple-scan: io/hpmud/dot4.c 319: invalid DOT4InitReply retrying command... simple-scan: io/hpmud/dot4.c 172: unable to read Dot4ReverseCmd header: No data available simple-scan: io/hpmud/musb.c 1933: invalid Dot4Credit from peripheral simple-scan: io/hpmud/hpmud.c 342: device_cleanup: device uri=hp:/usb/Officejet_J5700_series?serial=CN81LCV0V604TC simple-scan: io/hpmud/hpmud.c 354: device_cleanup: close device dd=1... simple-scan: io/hpmud/hpmud.c 356: device_cleanup: done closing device dd=1 Any ideas?

    Read the article

  • Ghost Solution Suite: Booting over PXE to WinPE for re-imaging, then booting to installed OS

    - by uberdanzik
    I have 40 networked computers that need to be re-imaged each night over a network via an automatic and unattended process. This is to reset the computers to a default state, as well as update the computers to the latest software loads. I'm using Symantec Ghost Solution Suite 2.5. My process so far is the following: Client begins in a powered down WakeOnLan accepting state. Ghost Console task uses WakeOnLan and PXE to boot the client into the WinPE environment. The client connects to the ghost console and reimages itself successfully. The client closes WinPE and restarts. PROBLEM: The client boots into the WinPE environment again, instead of the newly installed OS (Win7) I need it to boot into Win7 once so that I can run a few configuration batch files, then shut down into the WakeOnLan state again. Ghost console even reports an error on the process, that it never rebooted into the OS. Right now it seems that there is not an option to stop it from booting into the PXE server's WinPE image after re-imaging. Even if I set up a PXE boot menu with other boot options, its pointless, because it will always boot the default option. I would expect the ghost console task to be able to influence the PXE boot choice somehow. What do they expect us to do, turn the PXE server on and off manually? How can I get the client to boot to the OS after re-imaging? Thank you.

    Read the article

  • SQL SERVER – Solution of Puzzle – Swap Value of Column Without Case Statement

    - by pinaldave
    Earlier this week I asked a question where I asked how to Swap Values of the column without using CASE Statement. Read here: SQL SERVER – A Puzzle – Swap Value of Column Without Case Statement. I have proposed 3 different solutions in the blog posts itself. I had requested the help of the community to come up with alternate solutions and honestly I am stunned and amazed by the qualified entries. I will be not able to cover every single solution which is posted as a comment, however, I would like to for sure cover few interesting entries. However, I am selecting 5 solutions which are different (not necessary they are most optimal or best – just different and interesting). Just for clarity I am involving the original problem statement here. USE tempdb GO CREATE TABLE SimpleTable (ID INT, Gender VARCHAR(10)) GO INSERT INTO SimpleTable (ID, Gender) SELECT 1, 'female' UNION ALL SELECT 2, 'male' UNION ALL SELECT 3, 'male' GO SELECT * FROM SimpleTable GO -- Insert Your Solutions here -- Swap value of Column Gender SELECT * FROM SimpleTable GO DROP TABLE SimpleTable GO Here are the five most interesting and different solutions I have received. Solution by Roji P Thomas UPDATE S SET S.Gender = D.Gender FROM SimpleTable S INNER JOIN SimpleTable D ON S.Gender != D.Gender I really loved the solutions as it is very simple and drives the point home – elegant and will work pretty much for any values (not necessarily restricted by the option in original question ‘male’ or ‘female’). Solution by Aneel CREATE TABLE #temp(id INT, datacolumn CHAR(4)) INSERT INTO #temp VALUES(1,'gent'),(2,'lady'),(3,'lady') DECLARE @value1 CHAR(4), @value2 CHAR(4) SET @value1 = 'lady' SET @value2 = 'gent' UPDATE #temp SET datacolumn = REPLACE(@value1 + @value2,datacolumn,'') Aneel has very interesting solution where he combined both the values and replace the original value. I personally liked this creativity of the solution. Solution by SIJIN KUMAR V P UPDATE SimpleTable SET Gender = RIGHT(('fe'+Gender), DIFFERENCE((Gender),SOUNDEX(Gender))*2) Sijin has amazed me with Difference and Soundex function. I have never visualized that above two functions can resolve the problem. Hats off to you Sijin. Solution by Nikhildas UPDATE St SET St.Gender = t.Gender FROM SimpleTable St CROSS Apply (SELECT DISTINCT gender FROM SimpleTable WHERE St.Gender != Gender) t I was expecting that someone will come up with this solution where they use CROSS APPLY. This is indeed very neat and for sure interesting exercise. If you do not know how CROSS APPLY works this is the time to learn. Solution by mistermagooo UPDATE SimpleTable SET Gender=X.NewGender FROM (VALUES('male','female'),('female','male')) AS X(OldGender,NewGender) WHERE SimpleTable.Gender=X.OldGender As per author this is a slow solution but I love how syntaxes are placed and used here. I love how he used syntax here. I will say this is the most beautifully written solution (not necessarily it is best). Bonus: Solution by Madhivanan Somehow I was confident Madhi – SQL Server MVP will come up with something which I will be compelled to read. He has written a complete blog post on this subject and I encourage all of you to go ahead and read it. Now personally I wanted to list every single comment here. There are some so good that I am just amazed with the creativity. I will write a part of this blog post in future. However, here is the challenge for you. Challenge: Go over 50+ various solutions listed to the simple problem here. Here are my two asks for you. 1) Pick your best solution and list here in the comment. This exercise will for sure teach us one or two things. 2) Write your own solution which is yet not covered already listed 50 solutions. I am confident that there is no end to creativity. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Function, SQL Puzzle, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • how to add "Existing solution folder recursively" to my VS2005 solution

    - by user36753
    I tried drag and drop from the explorer, but no luck with following error: "Folders cannot be dropped or pasted as solution items. Choose an individual document instead." I know we can create each folders/subfolders manually and add each file, but any quick way to do this on visual studio 2005? Updated: Thank you for the reply, but I do not want the folders to be added under any project, It should appear as a separate node inside my solution, like any other project. In this case the show all files does not work, since the solution itself does not have any folder, it is only if we select any project it works. I know we can create each folders/subfolders manually and add each file, but any quick way, because there are few hundreds of files.

    Read the article

  • VSS - Solution file between multiple users

    - by BhejaFry
    Hi folks, we have a solution with multiple projects that is being developed by a team of developers. Project paths in the solution file checked in initially contains the path that are specific to that developer. Now when another dev gets latest of the solution, some of the projects won't load as the path differs. What's a better way to manage this ? TIA

    Read the article

  • Shared storage solution for our sql server backups

    - by Gokhan
    We have 3 clustered sql servers. We have 5+ multi terrabyte databases and their backup files (compressed using quest litespeed) are hitting over 600gb each, We are required to keep at least a week or two weeks (if we can) of weekly full backups and then 6 days differential backups, and a week or 2 weeks worth of log backups local. We are currently limited to 2TB volumes from our san team, we can have multiple volumes but they are expensive ($200 per raw TB per month) and having to deal with many backup volumes instead of a single big volume is difficult. I think if we could have a shared network storage of 20TB+ raid 10 or so for all our servers for keeping the backups and another department will copy them to tape from the network storage and delete files according to the retention period would be good, if this box would be a build in operating system (even unix a complete file storage system) that would be good. What do you guys think, does this make sense to you, is there any manufacturer that sells a storage product like that which that work in a clustered environment? Thank you

    Read the article

  • Web Site in solution where "Rebuild Solution" compile succeeds cannot launch debugger

    - by fordareh
    I have a solution that includes a Web Site (created using the web site template not the web app project template - converting isn't an option, btw). When I rebuild all, the compile succeeds, but strangely displays 3 errors, all of which are "Could not get dependencies for project reference 'PROJNAME'". When I try to launch the debugger, I get the "There were build errors." dialogue. Two questions: If I choose the 'Yes' option in the debug error dialogue to run the last successful build, will it run on the code that my Rebuild All just compiled? How do I resolve this issue? I checked this post and am disheartened by my prospects. What is strange, though, is that I added these same projects to a separate web site solution that compiled/debugged fine, removed the test web site and re-added the target website I would like to debug, and it failed in the same manner. Is there a secret web site .proj file for .NET web sites? http://stackoverflow.com/questions/863379/could-not-get-dependencies-for-project-reference

    Read the article

  • How to avoid serializing zero values with Simple Xml

    - by Bram Vandenbussche
    I'm trying to serialise an object using simple xml (http://simple.sourceforge.net/). The object setup is pretty simple: @Root(name = "order_history") public class OrderHistory { @Element(name = "id", required = false) public int ID; @Element(name = "id_order_state") public int StateID; @Element(name = "id_order") public int OrderID; } The problem is when I create a new instance of this class without an ID: OrderHistory newhistory = new OrderHistory(); newhistory.OrderID = _orderid; newhistory.StateID = _stateid; and I serialize it via simple xml: StringWriter xml = new StringWriter(); Serializer serializer = new Persister(); serializer.write(newhistory, xml); it still reads 0 in the resulting xml: <?xml version='1.0' encoding='UTF-8'?> <order_history> <id>0</id> <id_order>2</id_order> <id_order_state>8</id_order_state> </order_history> I'm guessing the reason for this is that the ID property is not null, since integers can't be null. But I really need to get rid of this node, and I'd rather not remove it manually. Any clues anyone?

    Read the article

  • Is any solution the correct solution?

    - by Eli
    I always think to myself after solving a programming challenge that I have been tied up with for some time, "It works, thats good enough". I don't think this is really the correct mindset, in my opinion and I think I should always be trying to code with the greatest performance. Anyway, with this said, I just tried a ProjectEuler question. Specifically question #2. How could I have improved this solution. I feel like its really verbose. Like I'm passing the previous number in recursion. <?php /* Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Find the sum of all the even-valued terms in the sequence which do not exceed four million. */ function fibonacci ( $number, $previous = 1 ) { global $answer; $fibonacci = $number + $previous; if($fibonacci > 4000000) return; if($fibonacci % 2 == 0) { $answer = is_numeric($answer) ? $answer + $fibonacci : $fibonacci; } return fibonacci($fibonacci, $number); } fibonacci(1); echo $answer; ?> Note this isn't homework. I left school hundreds of years ago. I am just feeling bored and going through the Project Euler questions

    Read the article

  • Simple HTTP Framework and time issue

    - by Deniz Acay
    I'm using Simple Framework for my recent project, and there is a problem with the date headers generated by the system. I can get my local time from Date class correctly, but setDate method of Simple's Response class sets date in milliseconds and when i do that by calling System.currentTimeInMillis, dates in response headers are incorrect. is there any way to solve this problem with Simple Framework? If not, what can i do except calling set method with a date string? Thanks in advance... EDIT: Date in the headers are in wrong timezone. And i also tried Calendar.getInstance().getTimeInMilis() method.

    Read the article

  • MySQL INJECTION Solution...

    - by Val
    I have been bothered for so long by the MySQL injections and was thinking of a way to eliminate this problem all together. I have came up with something below hope that many people will find this useful. The only Draw back I can think of this is the partial search: Jo =returns "John" by using the like %% statement. Here is a php solution: <?php function safeQ(){ $search= array('delete','select');//and every keyword... $replace= array(base64_encode('delete'),base64_encode('select')); foreach($_REQUEST as $k=>$v){ str_replace($search, $replace, $v); } } foo(); function html($str){ $search= array(base64_encode('delete'),base64_encode('select')); $replace= array('delete','select');//and every keyword... str_replace($search, $replace, $str); } //example 1 ... ... $result = mysql_fetch_array($query); echo html($result[0]['field_name']); //example 2 $select = 'SELECT * FROM safeQ($_GET['query']) '; //example 3 $insert = 'INSERT INTO .... value(safeQ($_GET['query']))'; ?> I know, I know that you still could inject using 1=1 or any other type of injections... but this I think could solve half of your problem so the right mysql query is executed. So my question is if anyone can find any draw backs on this then please feel free to comment here. PLEASE GIVE AN ANSWER only if you think that this is a very useful solution and no major drawbacks are found OR you think is a bad idea all together...

    Read the article

  • Solution Factory for Visual Studio 2010

    - by Mendy
    I love the idea behind Solution Factory project. But, unfortunately this project have a few bugs. Is anyone using it successfully with visual studio 2010? Is there any other better option for the same task? (of creating a new project based on existed one).

    Read the article

  • Using Simple XML and getting NoClassDefFoundError in Android

    - by Berat Onur Ersen
    I'm trying to use Simple XML to convert my java objects to XML format in my Android application. I'm getting NoClassDefFoundError at line Serializer serializer = new Persister(); java.lang.NoClassDefFoundError: org.simpleframework.xml.core.Persister I have simple-xml-2.6.1.jar in project class path and when I got NoClassDefFoundError I also put these 3 jars in classpath stax-1.2.0.jar stax-api-1.0.1.jar xpp3-1.1.3_8.jar but made no use. Still having NoClassDefFoundError. Any kind of help will be appreciated.Thank you.

    Read the article

  • Need Simple way to access XML in VB.Net - Pain with Linq-to-Xml

    - by aiart
    Dim myXDoc As XDocument = _ I want to access this in a simple way in VB.Net - Like: Dim Integer SizeXStr = CInt(MyZDoc.Cameras(1).Camera_Desc.@SizeX) ' where (1) is an index Why isn't this implemented in VB.Net? Better yet, type the values with a Schema and eliminate the conversion. Is this so hard? How do I access, in a simple way, data in XML - this would be VERY VERY useful! I have been using Query to try to get the values - when I use MsgBox() to display results, they display, but my main Windows Form is Trashed - changed colors, etc. The system has Bugs. Instead, I have to create an elaborate structure of arrays of objects and read the XML line-by-line and do the same for saving - this is the dark ages. Art

    Read the article

  • How to Deploy Simple Java Projects into EAR?

    - by Franco
    Hi, I am using MyEclipse and I use an Enterprise Application Project (EAP) that automattically deploys my Web and EJB Projects. These projects use some other projects that are just POJOs, "simple" java projects. Like a library kind of thing. The problem is that when I change something in on of the "simple" java projects I have to redeploy my entire EAP in my JBoss in order to see the changes. What I want is a way to automatically deploy those projects (POJOs) in the EAP, so hot code replacement works with those too. Any ideas?

    Read the article

  • Is there a suggested solution structure for ASP.NET MVC Production Apps

    - by Eoin Campbell
    In general, I don't like to keep code (BaseClasses or DataAccess Code) in the App_Code directory of an ASP.NET Site. I'll usually pull this stuff out into a MySite.BusinessLogic & MySite.DataAccess DLL's respectively. I'm wondering should I be doing the same for ASP.NET MVC. Would it be better to Organise the solution something along the lines of MySite.Common - DLL - (Basic Functionality built on .NET System Dlls) MySite.DAL - DLL - (DataAccessLayer & DBML Files) MySite.Models - DLL - (MVC Models e.g. Repository Classes) MySite.Controllers - DLL (MVC Controllers which use Models) MySite - ASP.NET MVC Site. Or am I missing something... presumably, I'll lose some of the nice (Add View, Go To Controller, context menu items that have been added)

    Read the article

  • New Visual Studio 2010 Extension - Collapse Solution

    - by MikeParks
    If your team has recently upgraded to Visual Studio 2010, take a second to check out the new Extension Manager. You can use it to browse through or install tons of tools, controls, or templates from the Visual Studio Gallery. My friend, Cory Cissell, and I recently teamed up and created an extension of our own called "Collapse Solution". It adds an option called Collapse Solution to the context menu of the solution node in the solution explorer. It also adds an option called Collapse Project to the context menu of each project node in the solution explorer. When that option is clicked, it will walk through the solution explorer tree and collapse any expanded child nodes in that section (projects, folders, code behind files, designer files, etc.). I use to have an add-in that did this in Visual Studio 2008 but it wasn't compatible when we upgraded to 2010 so we decided to write our own. The old tool was also packaged with a bunch of other junk that we didn't need so we figured it would be a much cleaner tool if it was broken off into its own extension. There's no need to install extra tools if you don't really need them. So if you have upgraded to Visual Studio 2010, please feel free to try out our Collapse Solution extension and leave us a rating/review in the Visual Studio Gallery. Thanks! Here's the link: http://visualstudiogallery.msdn.microsoft.com/en-us/2d81fec6-71f3-4fa5-87b4-c2aa18e42f92

    Read the article

  • Loop through XML::Simple structure

    - by David
    So I have some xml file like this: <?xml version="1.0" encoding="ISO-8859-1"?> <root result="0" > <settings user="anonymous" > <s n="blabla1" > <v>true</v> </s> <s n="blabla2" > <v>false</v> </s> <s n="blabla3" > <v>true</v> </s> </settings> </root> I want to go through all the settings using the XML Simple. Here's what I have when I print the output with Data::Dumper: $VAR1 = { 'settings' => { 'user' => 'anonymous', 's' => [ { 'n' => 'blabla1', 'v' => 'true' }, { 'n' => 'blabla2', 'v' => 'false' }, { 'n' => 'blabla3', 'v' => 'true' } ] }, 'result' => '0' }; And here's my code $xml = new XML::Simple; $data = $xml->XMLin($file); foreach $s (keys %{ $data->{'settings'}->{'s'} }) { print "TEST: $s $data->{'settings'}->{'s'}->[$s]->{'n'} $data->{'settings'}->{'s'}->[$s]->{'v'}<br>\n"; } And it returns these 2 lines, without looping: TEST: n blabla1 true TEST: v blabla1 true I also tried to do something like this: foreach $s (keys %{ $data->{'settings'}->{'s'} }) { Without any success: Type of arg 1 to keys must be hash (not array dereference) How can I procede? What am I doing wrong? Thanks a lot!

    Read the article

  • Use different configurations with Simple Injection

    - by Ruben.Canton
    I'm using the library "Simple Injector" (http://simpleinjector.codeplex.com) and it looks cool and nice. But after building a configuration and use it, now I want to know how to change from one configuration to another. Scenario: Let's imagine I've set up a configuration in the Global Asax and I have the public and global Container there. Now I want to make some tests and I want them to use mock classes so I want to change the configuration. I can, of course, build another configuration and assign it to the global Container created by default, so that every time I run a test the alternative configuration will be set. But on doing that and though I'm in development context the Container is changed for everyone, even for normal requests. I know I'm testing in this context and that shouldn't matter, but I have the feeling that this is not the way for doing this... and I wonder how to change from one configuration to another in the correct way. Note: At Simple Injector documentation says that you can ask questions in stackoverflow so that's why I'm here. =P PD: I'm new in this IoC and DI world so try to be easy with me when explaining it :)

    Read the article

  • VB.net Simple IRC Client

    - by xzerox
    How would I go about making a simple IRC client with these things What I am using: Nickname TextBox Connect Button Message TextBox Send Message Button Refresh Button ListBox Restrictions: No commands at all just being able to send messages I am using a listbox for recieving messages

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >