Daily Archives

Articles indexed Thursday April 15 2010

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

  • Do Url shorteners such as bit.ly serve any purpose in web development?

    - by gath
    I might be missing something here but am unable to understand the true purpose of link shortener services like bit.ly or is it just a lot of hype! Truly if you type nyti.ms on your URL bar on the browser it takes you to www.nytimes.com, but still what is so hard in typing "nytimes.com! which is far much comprehensible to read and understand leave alone to remember! Does shortening URL serve any purpose in web development? Why should someone want use obscure shortened URL?

    Read the article

  • Any workarounds for non-static member array initialization?

    - by TomiJ
    In C++, it's not possible to initialize array members in the initialization list, thus member objects should have default constructors and they should be properly initialized in the constructor. Is there any (reasonable) workaround for this apart from not using arrays? [Anything that can be initialized using only the initialization list is in our application far preferable to using the constructor, as that data can be allocated and initialized by the compiler and linker, and every CPU clock cycle counts, even before main. However, it is not always possible to have a default constructor for every class, and besides, reinitializing the data again in the constructor rather defeats the purpose anyway.] E.g. I'd like to have something like this (but this one doesn't work): class OtherClass { private: int data; public: OtherClass(int i) : data(i) {}; // No default constructor! }; class Foo { private: OtherClass inst[3]; // Array size fixed and known ahead of time. public: Foo(...) : inst[0](0), inst[1](1), inst[2](2) {}; }; The only workaround I'm aware of is the non-array one: class Foo { private: OtherClass inst0; OtherClass inst1; OtherClass inst2; OtherClass *inst[3]; public: Foo(...) : inst0(0), inst1(1), inst2(2) { inst[0]=&inst0; inst[1]=&inst1; inst[2]=&inst2; }; }; Edit: It should be stressed that OtherClass has no default constructor, and that it is very desirable to have the linker be able to allocate any memory needed (one or more static instances of Foo will be created), using the heap is essentially verboten. I've updated the examples above to highlight the first point.

    Read the article

  • Problems with ASP.NET, machine-level web.config, and the location element

    - by Daniel Schaffer
    I've got a server running Windows Web Server 2008 R2. The machine-level web.config has the following entries: <location path="Preview"> <appSettings> <add key="Environment" value="Preview" /> </appSettings> </location> <location path="Staging"> <appSettings> <add key="Environment" value="Staging" /> </appSettings> </location> <location path="Production"> <appSettings> <add key="Environment" value="Production" /> </appSettings> </location> I have a website that I'd set up in the direction D:\Sites\Preview\, so the full path would be D:\Sites\Preview\WebSite1. If I put a simple aspx file that just outputs the value of ConfigurationManager.AppSettings["Environment"], it displays the value Preview. I'm not clear on exactly how that works, but it does. I'd set this up several weeks ago, and just now tried to duplicate this - I put a second site in the D:\Sites\Preview\ directory, expecting that it would automatically pick up the appropriate appSettings entries, but for some reason it hasn't - the same aspx page doesn't show anything. Additionally, when I go into the IIS manager and open the Configuration Editor, there are no settings in there, whereas there are settings listed for the first site. Any ideas as to what I could be missing? Is the location element intended to work like this, or did I just find some magical fluke with my first site?

    Read the article

  • HTML and PHP simple contact form.

    - by user317128
    I tried to make a simple contact form via HTML and PHP but the form doesnt seem to submit. it stays on the HTML page and doesnt post to the php form. would love someone to look over the code, thanks in advanced. simple_form.html cdoe <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple Feedback Form</title> </head> <body> <form action="send_simpleform.php" method="post"> <p>Your name<br /> <input name="sender_name" type="text" size="30" /></p> <p>Email<br /> <input name="sender_email" type="text" size="30" /></p> <p>Message<br /> <textarea name="message" cols="30" rows="5"></textarea></p> <input name="submit" type="button" value="Send This Form" /> </form> </body> </html> send_simpleform.php code <? if (($_POST[sender_name] == "") || ($_POST[sender_email] == "") || ($_POST[message] == "") { header("Location: simple_form.php"); exit; } $msg = "Email sent from wwwsite\n"; $msg .= "Sender's Name:\t $_POST[senders_name]\n"; $msg .= "Sender's E-mail:\t $_POST[senders_email]\n"; $msg .= "Sender's Message:\t $_POST[message]\n"; $to = "[email protected]"; $subject = "Website feedback message"; $mailheaders = "From: My web site <www.testwebsite.com>\n"; $mailherders .= "Reply to: $_POST[sender_email]\n"; $mail($to, $subject, $msg, $mailheaders); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Simple Feedback Form Sent</title> </head> <body> <h1>The following email has been sent</h1> <p>Your Name:<br /> <? echo "$_POST[sender_name]"; ?> <p>Your Email Adress:<br /> <? echo "$_POST[sender_email]"; ?> <p>Message:<br /> <? echo "$_POST[message]"; ?> </p> </body> </html>

    Read the article

  • Call a non member function on an instance before is constructed.

    - by Tom
    Hi everyone. I'm writing a class, and this doubt came up. Is this undef. behaviour? On the other hand, I'm not sure its recommended, or if its a good practice. Is it one if I ensure no exceptions to be thrown in the init function? //c.h class C{ float vx,vy; friend void init(C& c); public: C(); }; //c.cpp C::C() { init(*this); } void init(C& c) //throws() to ensure no exceptions ? { c.vx = 0; c.vy = 0; } Thanks in advance

    Read the article

  • Read xml file and import only one table from multiple tables from xml file in the dataset at a time.

    - by Harikrishna
    I want to store the data in the xml file and retrieve the data from that. I have defined more than table in that xml file.Now to read the tables I am using dataset ds = new dataset(); ds.ReadXml(xmlfilepath); Now this dataset contains all the tables those are in xml file when we read the xml file into dataset. But I want only one specified table at a time in a dataset by condition. Like there are PersonalInfo,OtherInfo,PropertiesInfo tables in the xml file. But I want only OtherInfo table in dataset what I should do ?

    Read the article

  • New or not so well-known paradigms, syntax features and behaviours of programming languages?

    - by George B
    I've designed some educational programming languages and interpreters for them, but my problem always was that they ended up "normal" and "boring", mostly similar to some kind of existing language (ASM and BASIC). I find it really hard to come up with new ideas for syntax features, "neat things" and new or very modified programming paradigms for it. I always thought that it was hard to come up with good new things not fun/useless new things for this case. I wondered if you could help me out with your creativity: What features in terms of language syntax and built-in functions as well as maybe even new paradigms can I work into my language to keep it useless but more fun, enjoyable, interesting and/or different to program in?

    Read the article

  • BackgroundWorker Thread in IIS7 - FAIL!

    - by Darren Oster
    Just wondering if anyone has had any trouble using a BackgroundWorker Thread in a site running under IIS 7 in Integrated Pipeline mode? I am trying to use such a beast to update the database schema (admin function, obviously), and it works perfectly in Cassini, but when I deploy to IIS 7, the thread gets about one line of code in and silently ends. Is there a way to tell why a thread ended? Thanks in advance.

    Read the article

  • how do i get ajax to call after previous success is complete

    - by Alessandro
    I am currently using this ajax queuing plugin http://www.onemoretake.com/2009/10/11/ajaxqueue-and-jquery-1-3/ and it works fine, except weh ajax call 1 finishes, ajax call 2 starts that is dependent on a value that the success functions generates when ajax 1 is complete. Is there a way to start of all ajax calls when the previous call is complete and success function has been run? thanks

    Read the article

  • prevent IE8 tabs from opening as a new "process in the taskbar"

    - by Nano8Blazex
    This may have been asked before too... But, anyways. I'm using Windows 7 Ultimate, and IE 8, and have the taskbar in icon view. I'm not sure how to explain this, but I'm amazed at how each tab in IE8 seems to act like a new "process" in the taskbar (as if each tab was a window). Like... each tab acts like a different window in the taskbar although they are actually running in the same window. Now when I use IE 8 it looks (in the taskbar) like there's 15 windows open when in fact the taskbar is simply showing the 15 tabs. More simply put, it's displaying a "stack" for all of the tabs when I'd rather have the icon act like, for example, firefox so that a stack is only shown for the multiple windows. I know that they are meant to be running as separate processes to prevent crashing and the such... but is there a way to disable this strange "taskbar" effect? I'd rather have the taskbar show the main window and not the tabs individually.

    Read the article

  • binary number in c++

    - by baash05
    In c++ 0x10 is the way to represent a hex value. if I leave off the 0x then it's dec. Is there a way to define a binary? Not that I can't derive 0x0003 is 11, but it would be cool if I could use 0b0011. It would just make the code a little more obvious.

    Read the article

  • Is there a better way than #if DebugMode for logging

    - by Daniel
    I'm making a c++ library thats going to be P/Invoked from c#, so i am unable to breakpoint/debug the c++ side of things. So i decided to add logging so i can see if anything goes wrong and where it happens. I add a #define DebugMode 1 in order to determine if i am to log or not. First of all i'm not very good at c++ but i know enough to get around. So my questions are: Is there a better way than wrapping #if DebugMode #endifs around every Log call? I could simply do that inside the method and just return if logging isn't disabled but won't that mean then all those logging strings will be in the assembly? How can i emulate what printf does with its "..." operator enabling me to pass something like Log("Variable x is {0}", x); Thanks!

    Read the article

  • Examples of good JPA Java Desktop Application

    - by Yatendra Goel
    I have learnt JPA recently. Now I want to use it in one of my commercial product. But before proceeding, I want to see some example JPA Java Desktop applications so as to have a better understanding of using JPA in desktop applications. I have searched google for this but all I found was tutorials on JPA with examples of entities. I need some good real java desktop applications which have used JPA.

    Read the article

  • How can I get a rails server to use the same databse that cucumber uses during a test?

    - by James
    The cucumber test first makes an entry in the database and posts a form to a second server. This second server does some processing in background and then hits the first app (where the test is being run) with some data that the cucumber test needs to know about. I've tried running the main server via script/server and script/server -e test while the cucumber test is running, but I can't seem to force the server to use the same database that cucumber is using when it runs its step definitions. That is, when the second server pushes some data to a controller in the main server, the main server doesn't know about any entries that cucumber has made in the database. How can I get cucumber and the main server to use the same database?

    Read the article

  • How to speed up my websites (backoffices)

    - by jmpena
    Hello im developing some backends in ASP.NET 2.0 and i have put all the images in Cache, GZIPED my CSS, JS files and everything to speedup the load of each options. the performance its good and i have no problems with the clients but i want "MORE" fast loads and im looking for some recomendations. Is important to mention that those websites are using only in intranets so im thinking to implement my next projects using IFRAME for content that way (i think) the options will be loading faster because they not have to load the entire site. any help / recomendations? thanks in advance.

    Read the article

  • SCD2 + Merge Statement + MSSQL

    - by Nev_Rahd
    I am trying work out with MERGE statment to Insert / Update Dimension Table of Type SCD2 My source is a Table var to Merge with Dimension table. My Merget statement is throwing an error as: The target table 'DM.DATA_ERROR.ERROR_DIMENSION' of the INSERT statement cannot be on either side of a (primary key, foreign key) relationship when the FROM clause contains a nested INSERT, UPDATE, DELETE, or MERGE statement. Found reference constraint 'FK_ERROR_DIMENSION_to_AUDIT_CreatedBy'. My Merge Statement: DECLARE @DATAERROROBJECT AS [ERROR_DIMENSION] INSERT INTO DM.DATA_ERROR.ERROR_DIMENSION SELECT ERROR_CODE, DATA_STREAM_ID, [ERROR_SEVERITY], DATA_QUALITY_RATING, ERROR_LONG_DESCRIPTION, ERROR_DESCRIPTION, VALIDATION_RULE, ERROR_TYPE, ERROR_CLASS, VALID_FROM, VALID_TO, CURR_FLAG, CREATED_BY_AUDIT_SK, UPDATED_BY_AUDIT_SK FROM (MERGE DM.DATA_ERROR.ERROR_DIMENSION ED USING @DATAERROROBJECT OBJ ON(ED.ERROR_CODE = OBJ.ERROR_CODE AND ED.DATA_STREAM_ID = OBJ.DATA_STREAM_ID) WHEN NOT MATCHED THEN INSERT VALUES( OBJ.ERROR_CODE ,OBJ.DATA_STREAM_ID ,OBJ.[ERROR_SEVERITY] ,OBJ.DATA_QUALITY_RATING ,OBJ.ERROR_LONG_DESCRIPTION ,OBJ.ERROR_DESCRIPTION ,OBJ.VALIDATION_RULE ,OBJ.ERROR_TYPE ,OBJ.ERROR_CLASS ,GETDATE() ,'9999-12-13' ,'Y' ,1 ,1 ) WHEN MATCHED AND ED.CURR_FLAG = 'Y' AND ( ED.[ERROR_SEVERITY] <> OBJ.[ERROR_SEVERITY] OR ED.[DATA_QUALITY_RATING] <> OBJ.[DATA_QUALITY_RATING] OR ED.[ERROR_LONG_DESCRIPTION] <> OBJ.[ERROR_LONG_DESCRIPTION] OR ED.[ERROR_DESCRIPTION] <> OBJ.[ERROR_DESCRIPTION] OR ED.[VALIDATION_RULE] <> OBJ.[VALIDATION_RULE] OR ED.[ERROR_TYPE] <> OBJ.[ERROR_TYPE] OR ED.[ERROR_CLASS] <> OBJ.[ERROR_CLASS] ) THEN UPDATE SET ED.CURR_FLAG = 'N', ED.VALID_TO = GETDATE() OUTPUT $ACTION ACTION_OUT, OBJ.ERROR_CODE ERROR_CODE, OBJ.DATA_STREAM_ID DATA_STREAM_ID, OBJ.[ERROR_SEVERITY] [ERROR_SEVERITY], OBJ.DATA_QUALITY_RATING DATA_QUALITY_RATING, OBJ.ERROR_LONG_DESCRIPTION ERROR_LONG_DESCRIPTION, OBJ.ERROR_DESCRIPTION ERROR_DESCRIPTION, OBJ.VALIDATION_RULE VALIDATION_RULE, OBJ.ERROR_TYPE ERROR_TYPE, OBJ.ERROR_CLASS ERROR_CLASS, GETDATE() VALID_FROM, '9999-12-31' VALID_TO, 'Y' CURR_FLAG, 555 CREATED_BY_AUDIT_SK, 555 UPDATED_BY_AUDIT_SK ) AS MERGE_OUT WHERE MERGE_OUT.ACTION_OUT = 'UPDATE'; What am i doing wrong ?

    Read the article

  • Android Layouts Scrolling in Landscaped Mode

    - by y ramesh rao
    I have a strange issue in which on rotating the Screen to Landscaped mode the Views present inside Remain at the same place But I cannot scroll them inside the screen. How can I make them Scroll so that every thing that move out should be displayed properly to the user. Should there be any more attribute to be set for allowing such kind of behavior.

    Read the article

  • will_paginate undefined method error - Ruby on Rails

    - by bgadoci
    I just installed the gem for will_paginate and it says that it was installed successfully. I followed all the instructions listed with the plugin and I am getting an 'undefined method `paginate' for' error. Can't find much in the way of Google search and haven't been able to fix it myself (obviously). Here is the code: PostsController def index @tag_counts = Tag.count(:group => :tag_name, :order => 'updated_at DESC', :limit => 10) @posts = Post.paginate :page => params[:page], :per_page => 50 respond_to do |format| format.html # index.html.erb format.xml { render :xml => @posts } format.json { render :json => @posts } format.atom end end /model/post.rb class Post < ActiveRecord::Base validates_presence_of :body, :title has_many :comments, :dependent => :destroy has_many :tags, :dependent => :destroy cattr_reader :per_page @@per_page = 10 end /posts/views/index.html.erb <%= will_paginate @posts %>

    Read the article

  • What environment variables available while starting the script using init.d boot process

    - by raj_arni
    My problem is like this (OS is Sun Solaris): 1) At the boot time I want to start a process using a specific script. I am doing this by putting this script in /etc/init.d (and following other K and S rules) 2) The program which will be called by the script is located at $HOME/xxx/yyy location. 4) I am using 'su - {myuser} -c "{full path of the program}"' in order to execute the script as {myuser} 3) I dont want to hardcode the value of $HOME in the script but want to use the $HOME env variable only. How can I get this $HOME env variable in the shell script? Also what other variables will be available to me?

    Read the article

  • This page calls for XML namespace declared with prefix br but no taglibrary exists

    - by Christopher W. Allen-Poole
    I just finished the Netbeans introduction to Hibernate tutorial ( http://netbeans.org/kb/docs/web/hibernate-webapp.html#01 ) and I am getting the following error: "This page calls for XML namespace declared with prefix br but no taglibrary exists" Now, I have seen a similar question somewhere else: http://forums.sun.com/thread.jspa?threadID=5430327 but the answer is not listed there. Or, if it is, then I am clearly missing it -- line one of my index.xhtml file reads "http://www.w3.org/1999/xhtml". It also does not explain why, when I reload localhost:8080, the message disappears. Here is my index.xhtml file: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"> <ui:composition template="./template.xhtml"> <ui:define name="body"> <h:form> <h:commandLink action="#{filmController.previous}" value="Previous #{filmController.pageSize}" rendered="#{filmController.hasPreviousPage}"/> <h:commandLink action="#{filmController.next}" value="Next #{filmController.pageSize}" rendered="#{filmController.hasNextPage}"/> <h:dataTable value="#{filmController.filmTitles}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"> <h:column> <f:facet name="header"> <h:outputText value="Title"/> </f:facet> <h:outputText value="#{item.title}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Description"/> </f:facet> <h:outputText value="#{item.description}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value=" "/> </f:facet> <h:commandLink action="#{filmController.prepareView}" value="View"/> </h:column> </h:dataTable> <br/> </h:form> </ui:define> </ui:composition> </html>

    Read the article

  • Awk: error in printf but not in print

    - by HH
    Works: awk '{print $$1"\t&\t"$$2"\t\\\\"}' .file > file.tex Does not work, why? awk '{printf %.2f"\t&\t"\.2f"\t\\\\",$$1,$$2}' .file > file.tex Error: awk: {printf %.2f"\t&\t"\.2f"\t\\\\",$1,$2} awk: ^ backslash not last character on line

    Read the article

  • rspec "it" string

    - by geosteve
    Is it possible for an rspec method to get the value of the parameter passed to it() in the local method? For example, if I want: describe Me do it "should figure this out" puts "I " + SPEC_NAME end end to print this: I should figure this out ... what would I put for SPEC_NAME in the code sample? Even better, how would a relatively new rubologist like me figure this out on his own?

    Read the article

  • How can I use the Spark library in my ActionScript project?

    - by bluenote
    I'm using Flare to develop a visualization. Being familiar to Java, Javascript and Eclipse it wasn't a big deal to familiarize myself to developing with Actionscript and Adobe FlashBuilder. I actually found that the learning curve is very flat. However, being new to Actionscript, I can't figure out how to use the Spark libraries that are part of Flex. I tried to add the libraries to the build path, with no success. I guess I'm confused about how Flash, Flex, Actionscript, Spark and Flare work together, even after reading the helpful answers on this question Does anybody know which part of the puzzle I'm missing? Thanks.

    Read the article

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