Daily Archives

Articles indexed Saturday June 5 2010

Page 10/79 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • SQL Server Cast

    - by Derek Dieter
    The SQL Server cast function is the easiest data type conversion function to be used compared to the CONVERT function. It takes only one parameter followed by the AS clause to convert a specified value. A quick example is the following:SELECT UserID_String = CAST(UserID AS varchar(50)) FROM dbo.UserThis example will convert the integer to a character value. [...]

    Read the article

  • using sp_addrolemember

    - by Derek Dieter
    To add a user or group to a role, you need to use sp_addrolemember. This procedure is easy to use as it only accepts two parameters, the role name, and the username (or group). Roles are utilized in order to provide a layer of abstraction from permissions from being applied directly to users. While [...]

    Read the article

  • how i group do this mysql query

    - by moustafa
    i want to make charts system and i think it must be like that 1 jan 2009 = 10 post 2 jan 2009 = 2 post 4 jan 2009 = 10 post 6 jan 2009 = 60 post and i have posts table that has id,user_id,date how i can select from posts to show it like that

    Read the article

  • Best way to draw a bar chart in LaTeX?

    - by Tae
    I was looking for it here in Stack Overflow as in Google, and I found a lot of packages to draw, but it seems a complex task, so I would like to know which is the most appropriate package to draw bars, and associate data to it. Also I was looking for a code example, but I did not have luck.

    Read the article

  • Can't fill a column of NULLs with actual values by making an association to the proper values in the

    - by UkraineTrain
    I have a table with separate columns for months, days and a varchar column for 6 hour increments for each day ('12AM', '6AM', '12PM', '6PM'). There's also a column that's supposed to have calculated numeric values for each of those 6 hour increments. These calculated values come from some reference table. This reference table contains values for each day for several months broken down by hour where each hour has its own column. So, basically, I have to add the values for each 6 hour increment. I have no idea how to associate the correct values in the reference table to those 6 hour increments. I will really appreciate any help on this.

    Read the article

  • Javascript tricks

    - by ayush
    What does the following code mean - <a href="javacsript:;" onClick="addItem(160)">some link</a> My basic doubt is which script is run when we click on the link

    Read the article

  • Can't create a MySQL query that generates 4 rows for each row in the table it references.

    - by UkraineTrain
    I need to create a MySQL query that generates 4 rows for each row in the table it references. I need some of the information in those rows to repeat and some to be different. In the table each row stands for one day. I need to break the day up in 6 hour increments, hence the four rows for each entry. I need to create one column which for each day will have '12AM', '6AM', '12PM', and '6PM' values and another column will have the corresponding numeric values calculated for those entries. Thanks a lot in advance and I will really appreciate any help on this.

    Read the article

  • When to use .NET Settings vs config <appsettings>?

    - by jdk
    Are there any recommendations on when to use Application settings (not per user settings) vs. .config file <appsettings>? Update Looking to understand some of the finer and important differences because they're both effectively key/value stores. For example, I know modifying appsettings in web.config will recycle the web application. Settings have been in .NET for a while now and I haven't bothered to look at them - maybe one is somewhat redundant, or using both at the same time doesn't make sense... that's the kind of detail I'm looking to understand and the reasons.

    Read the article

  • Migrating from Maven to SBT

    - by Vasil Remeniuk
    Hi people, As you know, SBT is compatible with Maven in some way -- SBT recognizes simple Maven POMs and can use dependencies and repositories specified in them. However, SBT wiki says that, if inline dependency is specified in SBT project definition, POM will be ignored (so using both in this case is impossible): Maven and Ivy configurations (pom.xml and ivy.xml) are ignored when inline dependency declarations are present. Does anyone know, if any kind of converter from Maven POM to SBT project definition exists (translating POM's XML into project definition Scala code)? I'm considering writing such script (that will help to migrate my old Scala/Maven projects to SBT), but want to know first, if this functionality already exists. Thanks in advance.

    Read the article

  • SlidingDrawer overlap the listview

    - by vycon
    protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); cursor = fetchAllDiary(); this.setListAdapter(new DiaryListAdapter(this, cursor, true)); View drawer_view = mInflater.inflate(R.layout.drawer, null); LayoutParams params = new LayoutParams(200,150); getWindow().addContentView(drawer_view, params); } <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/frameLayout"> <SlidingDrawer android:id="@+id/diary_list_row_drawer" android:layout_height="wrap_content" android:handle="@+id/handle" android:content="@+id/content" android:orientation="vertical" android:layout_width="fill_parent" android:topOffset="50px"> <ImageView android:id="@id/handle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/bottom_switcher_collapsed" /> <LinearLayout android:id="@id/content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/backround_color_lightblue1"> <Button android:text="Button01" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:text="Button02" android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> </SlidingDrawer> </LinearLayout>

    Read the article

  • Query in sql involving joins of two table

    - by Satish
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | prasoon | coding | 4 | 2009-01-06 | | prasoon | coding | 4 | 2009-01-10 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ Is there any way by which I can output the following? +-------------+-----------+---------+-------------------+ | date | activity | hours | holiday_name | +-------------+-----------+---------+-------------------+ | 2009-01-01 | testing | 3 | | | 2009-01-02 | | | Diwali | | 2009-01-03 | coding | 4 | | | 2009-01-04 | Absent | Absent | | | 2009-01-05 | | | Holi | | 2009-01-06 | coding | 4 | | | 2009-01-07 | Absent | Absent | | | 2009-01-08 | Absent | Absent | | | 2009-01-09 | Absent | Absent | | | 2009-01-10 | coding | 4 | | +-------------+-----------+---------+-------------------+ In other words I want to fill the activity and hours columns with "Absent" on the dates which are neither in table reports nor in table holidays. How can I write a specific query for it. The query should give the output between two specific dates.

    Read the article

  • Serializing Exceptions WCF + Silverlight

    - by Bram
    I have a WCF service I use to submit bugs for my project. Snippet of the data class: Private _exception As Exception <DataMember()> _ Public Property Exception As Exception Get Return _exception End Get Set(ByVal value As Exception) _exception = value End Set End Property I have a Silverlight app that uses the WCF service to send any bugs home if and when they occur. This is the error I'm testing with: Dim i As Integer = 5 i = i / 0 The problem is SL is banging on with this message: System.ServiceModel.CommunicationException was unhandled by user code Message=There was an error while trying to serialize parameter :bug. The InnerException message was 'Type 'System.OverflowException' with data contract name 'OverflowException:http://schemas.datacontract.org/2004/07/System' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. Is there some trick to get a generic .NET Exception (any InnerException) to serialize properly? I'm not doing anything funky with the exception - it's just a plain 'ol exception Thanks for any help.

    Read the article

  • Find Loding performance of the Website

    - by pandora
    How to find the site performance, there is a tools like YSLOW, Speed traker in google that shows the speed of the website. I have done a php project on LMS with Zend Framework, Everything is in live. When user post contents for a subject that may be size 200K and submitted to the server takes too slow. Sometime server may get DOWN. I login to server(PUTTY) and checked i found that there is more resource occupied in my server. It uses full memory on the server. When i cleared the resource the site loads well. Site is in Dedicated server with 3 more domains with 4GB Ram. Because of this LMS website all the website gets down. I need to check what is wrong in my website. How do i Start?

    Read the article

  • CGContextDrawPDFPage taking up large amounts of memory

    - by Ed Marty
    I have a PDF file that I want to draw in outline form. I want to draw the first several pages on the document each in their own UIImage to use on a button so that when clicked, the main display will navigate to the clicked page. However, CGContextDrawPDFPage seems to be using copious amounts of memory when attempting to draw the page. Even though the image is only supposed to be around 100px tall, the application crashes while drawing one page in particular, which according to Instruments, allocates about 13 MB of memory just for the one page. Here's the code for drawing: //Note: This is always called in a background thread, but the autorelease pool is setup elsewhere + (void) drawPage:(CGPDFPageRef)m_page inRect:(CGRect)rect inContext:(CGContextRef) g { CGPDFBox box = kCGPDFMediaBox; CGAffineTransform t = CGPDFPageGetDrawingTransform(m_page, box, rect, 0,YES); CGRect pageRect = CGPDFPageGetBoxRect(m_page, box); //Start the drawing CGContextSaveGState(g); //Clip to our bounding box CGContextClipToRect(g, pageRect); //Now we have to flip the origin to top-left instead of bottom left //First: flip y-axix CGContextScaleCTM(g, 1, -1); //Second: move origin CGContextTranslateCTM(g, 0, -rect.size.height); //Now apply the transform to draw the page within the rect CGContextConcatCTM(g, t); //Finally, draw the page //The important bit. Commenting out the following line "fixes" the crashing issue. CGContextDrawPDFPage(g, m_page); CGContextRestoreGState(g); } Is there a better way to draw this image that doesn't take up huge amounts of memory?

    Read the article

  • java - POST vs JDBC

    - by Dan
    OK so here's the code: import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; public class Main { public static void main(String[] args) { try { URL my_url = new URL("http://www.viralpatel.net/blogs/"); BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream())); String strTemp = ""; while(null != (strTemp = br.readLine())){ System.out.println(strTemp); } } catch (Exception ex) { ex.printStackTrace(); } } } Using this method I can use POST and GET methods using PHP scripts. I can then use the PHP scripts to the MySQL database which in turn outputs back to the java applet. Is this possible? (and safer?) Thanks.

    Read the article

  • Java Swing Visual Editor HELP please

    - by bat
    How would i call this function in my main? private JFrame getMainpageframe1() { if (mainpageframe1 == null) { mainpageframe1 = new JFrame(); mainpageframe1.setSize(new Dimension(315, 306)); mainpageframe1.setContentPane(getMainpage()); mainpageframe1.setTitle("Shopping For Less: Main Page"); mainpageframe1.setVisible(true); mainpageframe1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } return mainpageframe1; } public static void main(String[] args) { //call that function to output the JFrame? } thanks

    Read the article

  • Does unboxing just return a pointer to the value within the boxed object on the heap?

    - by Charles
    I this MSDN Magazine article, the author states (emphasis mine): Note that boxing always creates a new object and copies the unboxed value's bits to the object. On the other hand, unboxing simply returns a pointer to the data within a boxed object: no memory copy occurs. However, it is commonly the case that your code will cause the data pointed to by the unboxed reference to be copied anyway. I'm confused by the sentence I've bolded and the sentence that follows it. From everything else I've read, including this MSDN page, I've never before heard that unboxing just returns a pointer to the value on the heap. I was under the impression that unboxing would result in you having a variable containing a copy of the value on the stack, just as you began with. After all, if my variable contains "a pointer to the value on the heap", then I haven't got a value type, I've got a pointer. Can someone explain what this means? Was the author on crack? (There is at least one other glaring error in the article). And if this is true, what are the cases where "your code will cause the data pointed to by the unboxed reference to be copied anyway"? I just noticed that the article is nearly 10 years old, so maybe this is something that changed very early on in the life of .Net.

    Read the article

  • emacs lisp mapcar doesn't apply function to all elements?

    - by Stephen
    Hi, I have a function that takes a list and replaces some elements. I have constructed it as a closure so that the free variable cannot be modified outside of the function. (defun transform (elems) (lexical-let ( (elems elems) ) (lambda (seq) (let (e) (while (setq e (car elems)) (setf (nth e seq) e) (setq elems (cdr elems))) seq)))) I call this on a list of lists. (defun tester (seq-list) (let ( (elems '(1 3 5)) ) (mapcar (transform elems) seq-list))) => ((10 1 8 3 6 5 4 3 2 1) ("a" "b" "c" "d" "e" "f")) It does not seem to apply the function to the second element of the list provided to tester(). However, if I explicitly apply this function to the individual elements, it works... (defun tester (seq-list) (let ( (elems '(1 3 5)) ) (list (funcall (transform elems) (car seq-list)) (funcall (transform elems) (cadr seq-list))))) => ((10 1 8 3 6 5 4 3 2 1) ("a" 1 "c" 3 "e" 5)) If I write a simple function using the same concepts as above, mapcar seems to work... What could I be doing wrong? (defun transform (x) (lexical-let ( (x x) ) (lambda (y) (+ x y)))) (defun tester (seq) (let ( (x 1) ) (mapcar (transform x) seq))) (tester (list 1 3)) => (2 4) Thanks

    Read the article

  • Visual Studio IntelliSense for URL Rewrite

    - by OWScott
    Visual Studio doesn’t have IntelliSense support for URL Rewrite by default.  This isn’t a show stopper since it doesn’t result in stop errors. However, it’s nice to have full IntelliSense support and to get rid of the warnings for URL Rewrite rules. RuslanY has released a Visual Studio schema update for URL Rewrite 2.0 which is available as a free quick download.  The installation instructions (they are quick and easy) can be found here, which also include the schema for URL Rewrite 1.1.   The install takes effect immediately without restarting Visual Studio. A side question commonly comes up.  Can you get URL Rewrite support for Visual Studio Web Server (aka Cassini).  The answer is no.  To get URL Rewrite support in your development environment, use IIS7.  You can set your Visual Studio projects to use IIS7 though, so you can have full debug, F5 or Ctrl-F5 support for IIS.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >