Search Results

Search found 387 results on 16 pages for 'joshua lim'.

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

  • Ellipsis notation in C#?

    - by Joshua
    Where can I get info about implementing my own methods that have the ellipsis notation, e.g. static void my_printf(char* format, ...) { } Also is that called ellipsis notation or is there a fancier name?

    Read the article

  • How to reserve a set of primary key identifiers for preloading bootstrap data

    - by Joshua
    We would like to reserve a set of primary key identifiers for all tables (e.g. 1-1000) so that we can bootstrap the system with pre-loaded system data. All our JPA entity classes have the following definition for the primary key. @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false, insertable = false, updatable = false) private Integer id; is there a way to tell the database that increments should start happening from 1000 (i.e. customer specific data will start from 1000 onwards). We support (h2, mysql, postgres) in our environment and I would prefer a solution which can be driven via JPA and reverse engineering DDL tools from Hibernate. Let me know if this is the correct approach

    Read the article

  • SQL Server, how to join a table in a "rotated" format (returning columns instead of rows)?

    - by Joshua Carmody
    Sorry for the lame title, my descriptive skills are poor today. In a nutshell, I have a query similar to the following: SELECT P.LAST_NAME, P.FIRST_NAME, D.DEMO_GROUP FROM PERSON P JOIN PERSON_DEMOGRAPHIC PD ON PD.PERSON_ID = P.PERSON_ID JOIN DEMOGRAPHIC D ON D.DEMOGRAPHIC_ID = PD.DEMOGRAPHIC_ID This returns output like this: LAST_NAME FIRST_NAME DEMO_GROUP --------------------------------------------- Johnson Bob Male Smith Jane Female Smith Jane Teacher Beeblebrox Zaphod Male Beeblebrox Zaphod Alien Beeblebrox Zaphid Politician I would prefer the output be similar to the following: LAST_NAME FIRST_NAME Male Female Teacher Alien Politician --------------------------------------------------------------------------------------------------------- Johnson Bob 1 0 0 0 0 Smith Jane 0 1 1 0 0 Beeblebrox Zaphod 1 0 0 1 1 The number of rows in the DEMOGRAPHIC table varies, so I can't say with certainty how many columns I need. The query needs to be flexible. Yes, it would be trivial to do this in code. But this query is one piece of a complicated set of stored procedures, views, and reporting services, many of which are outside my sphere of influence. I need to produce this output inside the database to avoid breaking the system. Any ideas? This is MS SQL Server 2005, by the way. Thanks.

    Read the article

  • Unable to verify body hash for DKIM

    - by Joshua
    I'm writing a C# DKIM validator and have come across a problem that I cannot solve. Right now I am working on calculating the body hash, as described in Section 3.7 Computing the Message Hashes. I am working with emails that I have dumped using a modified version of EdgeTransportAsyncLogging sample in the Exchange 2010 Transport Agent SDK. Instead of converting the emails when saving, it just opens a file based on the MessageID and dumps the raw data to disk. I am able to successfully compute the body hash of the sample email provided in Section A.2 using the following code: SHA256Managed hasher = new SHA256Managed(); ASCIIEncoding asciiEncoding = new ASCIIEncoding(); string rawFullMessage = File.ReadAllText(@"C:\Repositories\Sample-A.2.txt"); string headerDelimiter = "\r\n\r\n"; int headerEnd = rawFullMessage.IndexOf(headerDelimiter); string header = rawFullMessage.Substring(0, headerEnd); string body = rawFullMessage.Substring(headerEnd + headerDelimiter.Length); byte[] bodyBytes = asciiEncoding.GetBytes(body); byte[] bodyHash = hasher.ComputeHash(bodyBytes); string bodyBase64 = Convert.ToBase64String(bodyHash); string expectedBase64 = "2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8="; Console.WriteLine("Expected hash: {1}{0}Computed hash: {2}{0}Are equal: {3}", Environment.NewLine, expectedBase64, bodyBase64, expectedBase64 == bodyBase64); The output from the above code is: Expected hash: 2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8= Computed hash: 2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8= Are equal: True Now, most emails come across with the c=relaxed/relaxed setting, which requires you to do some work on the body and header before hashing and verifying. And while I was working on it (failing to get it to work) I finally came across a message with c=simple/simple which means that you process the whole body as is minus any empty CRLF at the end of the body. (Really, the rules for Body Canonicalization are quite ... simple.) Here is the real DKIM email with a signature using the simple algorithm (with only unneeded headers cleaned up). Now, using the above code and updating the expectedBase64 hash I get the following results: Expected hash: VnGg12/s7xH3BraeN5LiiN+I2Ul/db5/jZYYgt4wEIw= Computed hash: ISNNtgnFZxmW6iuey/3Qql5u6nflKPTke4sMXWMxNUw= Are equal: False The expected hash is the value from the bh= field of the DKIM-Signature header. Now, the file used in the second test is a direct raw output from the Exchange 2010 Transport Agent. If so inclined, you can view the modified EdgeTransportLogging.txt. At this point, no matter how I modify the second email, changing the start position or number of CRLF at the end of the file I cannot get the files to match. What worries me is that I have been unable to validate any body hash so far (simple or relaxed) and that it may not be feasible to process DKIM through Exchange 2010.

    Read the article

  • map xml element to xsd complexType based on attribute

    - by Joshua Johnson
    Assume there exists an XML instance document that looks like this: <root> <object type="foo"> <!-- ... --> </object> <object type="bar"> <!-- ... --> </object> </root> My goal is to have a small (static) schema that verifies proper <element type="xxx" /> syntax for objects, and another schema (more prone to change) that verifies the contents of each object element against a complexType that matches the type attribute: <complexType name="foo"><!--should match object with type="foo"--></complexType> <complexType name="bar"><!--should match object with type="bar"--></complexType> What is the best way to accomplish this (or something similar)?

    Read the article

  • CSS semantics; selecting elements directly or via order

    - by Joshua Cody
    Perhaps this question has been asked elsewhere, but I'm unable to find it. With HTML5 and CSS3 modules inching closer, I'm getting interested in a discussion about the way we write CSS. Something like this where selection is done via element order and type is particularly fascinating. The big advantage to this method seems to be complete modularization of HTML and CSS to make tweaks and redesigns simpler. At the same time, semantic IDs and classes seem advantageous for sundry reasons. Particularly, direct linking, JS targeting, and shorter CSS selectors. Also, it seems selector length might be an issue. For instance, I just wrote the following, which would be admittedly easier using some semantic HTML5 elements: body>div:nth-child(2)>div:nth-child(2)>ul:nth-child(2)>li:last-child So what say you, Stack Overflow? Is the future of CSS writing focused on element order and type? Or are IDs and classes and the current ways here to stay? (I'm well aware the IDs and classes have their place, although I am interested to hear more ways you think they'll continue to be necessary. The discussion I'm interested in is bigger-picture and the ways writing CSS is changing.)

    Read the article

  • Using Scala structural types with abstract types

    - by Joshua Hartman
    I'm trying to define a structural type defining anything that has an "add" method (for instance, a java collection or a java map). Using this, I want to define a few higher order functions that operate on a certain collection object GenericTypes { type GenericCollection[T] = { def add(value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection[X]] { def map[V](fn: (T) => V): CollectionType[V] .... } class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] This does not compile with the following error error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement I tried removing the parameter on GenericCollection and putting it on the method: object GenericTypes { type GenericCollection = { def add[T](value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection] class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] but I get another error: error: type arguments [T,java.util.List] do not conform to trait HigherOrderFunctions's type parameter bounds [T,CollectionType[X] <: org.scala_tools.javautils.j2s.GenericTypes.GenericCollection] Can anyone give me some advice on how to use structural typing with abstract typed parameters in Scala? Or how to achieve what I'm looking to accomplish? Thanks so much!

    Read the article

  • Secondary Domain Adds Extra Folder in URL during Postbacks

    - by Joshua
    My ASP.NET Website (C#, 3.5 framework, IIS7) is hosted at GoDaddy. There are multiple sites on the account. Currently when I perform postbacks or Response.Redirects on a secondary web site, the following URL appears in the address bar: www.mywebsite.com/webfolder/default.aspx Where the "webfolder" is the sub-directory on the server where the web site is hosted (i.e. SeverRoot/webfolder). The site seems to work with or without the folder in the URL. Is there a way to remove the folder from the URLs during postback? I think I have to use URL Rewriting (which GoDaddy supports using Microsoft's Rewrite Module) but I'm not sure how.

    Read the article

  • Robust fault tolerant MySQL replication

    - by Joshua
    Is there any way to get a fault tolerant MySQL replication? I am in an environment that has many networking issues. It appears that replication gets an error and just stops. I need it to continue to work and recover from these faults. There is some wrapper software that checks the state of replication and restarts it in the case of losing its log position. Is there an alternative? Note: Replication is done from an embedded computer with MySQL 4.1 to a external computer that has MySQL 5.0.45

    Read the article

  • Having trouble using 'AND' in CONTAINSTABLE SQL SERVER FULL TEXT SEARCH

    - by Joshua
    I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes. If I have an field with something like "An Overview of Pain Medicine 5/12/2006" and a user types "An Overview 5/12/2006" So we create a search like: '"An" AND "Overview" AND "5/12/2006"' - 0 results (bad) '"Overview" AND "5/12/2006"' - 1 result (good) The CONTAINSTABLE portion of my query: FROM ce_Activity A INNER JOIN CONTAINSTABLE(View_Activities,(Searchable), @Search) AS KeyTbl ON A.ActivityID = KeyTbl.[KEY] "Searchable" is a field contains the activity title, and start date(converted to string) in one field so it's all search friendly. Why would this happen?

    Read the article

  • Making one table equal to another without a delete *

    - by Joshua Atkins
    Hey, I know this is bit of a strange one but if anyone had any help that would be greatly appreciated. The scenario is that we have a production database at a remote site and a developer database in our local office. Developers make changes directly to the developer db and as part of the deployment process a C# application runs and produces a series of .sql scripts that we can execute on the remote side (essentially delete *, insert) but we are looking for something a bit more elaborate as the downtime from the delete * is unacceptable. This is all reference data that controls menu items, functionality etc of a major website. I have a sproc that essentially returns a diff of two tables. My thinking is that I can insert all the expected data in to a tmp table, execute the diff, and drop anything from the destination table that is not in the source and then upsert everything else. The question is that is there an easy way to do this without using a cursor? To illustrate the sproc returns a recordset structured like this: TableName Col1 Col2 Col3 Dest Src Anything in the recordset with TableName = Dest should be deleted (as it does not exist in src) and anything in Src should be upserted in to dest. I cannot think of a way to do this purely set based but my DB-fu is weak. Any help would be appreciated. Apologies if the explanation is sketchy; let me know if you need anymore details.

    Read the article

  • Replacing unversioned files in WiX major upgrade.

    - by Joshua
    I am still having this problem. This is the closest I have come to a solution that works, and yet it doesn't quite work. Here is (most of) the code: <Product Id='$(var.ProductCode)' UpgradeCode='$(var.UpgradeCode)' Name="Pathways" Version='$(var.ProductVersion)' Manufacturer='$(var.Manufacturer)' Language='1033'> Maximum="$(var.ProductVersion)" IncludeMaximum="no" Language="1033" Property="OLDAPPFOUND" / -- -- -- There is a later version of this program installed. The problem I am having is that I need the two files in the Database component to replace the previous copies. Since these files are unversioned, I have attempted to use the CompanionFile tag set to the PathwaysExe since that is the main executable of the application, and it IS being updated, even if the log says it isn't! The strangest thing about this is that the PathwaysLdf file IS BEING UPDATED CORRECTLY, and the PathwaysMdf file IS NOT. The log seems to indicate that the "Existing file is of an equal version (Checked using version of companion)". This is very strange because that file is being replaced just fine. The only idea I have left is that this problem has to do with the install sequence, and I'm not sure how to proceed! I have the InstallExecuteSequence set like I do because of the SettingsXml file, and my need to NOT overwrite that file, which is actually working now, so whatever solution works for the database files can't break the working settings file! ;) The full log is located at: http://pastebin.com/HFiGKuKN PLEASE AND THANK YOU!

    Read the article

  • Constructing human readable sentences based on a survey

    - by Joshua
    The following is a survey given to course attendees to assess an instructor at the end of the course. Communication Skills 1. The instructor communicated course material clearly and accurately. Yes No 2. The instructor explained course objectives and learning outcomes. Yes No 3. In the event of not understanding course materials the instructor was available outside of class. Yes No 4. Was instructor feedback and grading process clear and helpful? Yes No 5. Do you feel that your oral and written skills have improved while in this course? Yes No We would like to summarize each attendees selection based on the choices chosen by him. If the provided answers were [No, No, Yes, Yes, Yes]. Then we would summarize this as "The instructor was not able to summarize course objectives and learning outcomes clearly, but was available for usually helpful outside of class. The instructor feedback and grading process was clear and helpful and I feel that my oral and written skills have improved because of this course. Based on the selections chosen by the attendee the summary would be quite different. This leads to many answers based on the choices selected and the number of such questions in the survey. The questions are usually provided by the training organization. How do you come up with a generic solution so that this can be effectively translated into a human readable form. I am looking for tools or libraries (java based), suggestions which will help me create such human readable output. I would like to hide the complexity from the end users as much as possible.

    Read the article

  • Cache front end for the JetS3t API

    - by Joshua
    Storage via JetS3t REST API seems to be very slow. Is there a caching front end for the JetS3t API for avoiding a network hit on the fetch calls [link text][1] [1]: http://jets3t.s3.amazonaws.com/api/org/jets3t/service/S3Service.html#getObject(org.jets3t.service.model.S3Bucket, java.lang.String, java.util.Calendar, java.util.Calendar, java.lang.String[], java.lang.String[], java.lang.Long, java.lang.Long)

    Read the article

  • Filtering A MySQL Result Set Based On The Return Value Of A Function

    - by Joshua
    I'm a SQL noob, and I need a little bit of help understanding the big picture of if it is possible, and if so how to go about filtering a result set based on the return value of a function which is passed one of the fields of the record. Let's say I have a table called "Numbers" with just one field: "Value". How could I correctly specify the following "pseudo-sql"?: SELECT Value FROM numbers WHERE IsPrime(Value)=true Can I accomplish such a thing, and if so, where/how do I put/store "IsPrime"? I'm using MySQL.

    Read the article

  • How To Access Namespace Elements In MXML Using Actionscript

    - by Joshua
    In Actionscript... If I Have an XML variable that equals this: var X:XML=XML("<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" creationComplete="Init();" xmlns:ns3="Components.*" initialize="I()"/>"); And I try to list the attributes via: var AList:XMList=X.attributes(); The three namespaces, "xmlns:mx","xmlns:ns1", and "xmlns:ns3" aren't listed among the attributes! How can I access this information programmatically?

    Read the article

  • unable to inject seam cache provider

    - by Joshua
    Env: Seam 2.2, ehcache-core 2.1.0 I tried injecting the CacheProvider using the following call in my bean scoped for session @In CacheProvider cacheProvider; WEB-INF\components.xml contains the following line to enable the cache provider <cache:eh-cache-provider/> The above configuration seems to return a null value for the cache provider Using the cache provider like this CacheProvider cacheProvider = CacheProvider.instance(); throws the following warning 15:29:27,586 WARN [CacheManager] Creating a new instance of CacheManager using the diskStorePath "C:\DOCUME~1\user5\LOCALS~1\Temp\" which is already used by an existing CacheManager. The source of the configuration was net.sf.ehcache.config.generator.Configuratio nSource$DefaultConfigurationSource@15ed0f9. The diskStore path for this CacheManager will be set to C:\DOCUME~1\user5\LOCALS ~1\Temp\\ehcache_auto_created_1276682367586. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache .xml) for each CacheManager instance. What am I missing here?

    Read the article

  • PHP detmine numbers in between two numbers then query

    - by Joshua Anderson
    This should be simple but I can't figure it out <?php $testid = 240; $curid = 251; $cal = $curid - $testid; echo $cal; ?> I want to determine the numbers in between two other numbers so for this example it detects there are 11 numbers in between the $testid and $curid, but i dont need it to do that. I need it to literally figure the numbers in between $curid - $testid which in this example would be 241, 242, 243... all the way to 251 then i need to create a loop with those numbers and do a query below with each one $cal = $curid - $testid; mysql_query("SELECT * FROM wall WHERE id='".$cal."'") // and for each number mysql should out put each data field with those numbers. Thanks again, love you guys.

    Read the article

  • Subclassing UIButton.

    - by Joshua
    I would like to subclass UIButton so I can give it a fill image, left side image and right side image which I can't do in IB. All I can do in IB is give it a full background image which would mean the background would get stretched if the text was larger than the image. How would I do this? as unlike NSButton, there is no UIButtonCell class.

    Read the article

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