Daily Archives

Articles indexed Tuesday April 3 2012

Page 13/18 | < Previous Page | 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • jQuery image fade not working for unknown reason...?

    - by Henrik Petterson
    Just when I thought I was done for the night, another issue is keeping me awake. It appears that somehow I have broken the fade I was using on my thumbnails. If you go here: http://ftframes.com/milad2/ When you hover your mouse of the thumbnails, it should fade up. To give you an idea, this is a working version of the script: http://nothingcantouchme.com/stackoverflow.php#download_page As you can see, the hover works fine with the fade. And please mind the mess on this one, I just added it to demonstrate. Is there anyone that can kindly assist me in solving this issue? I would lie if I told you that I wasn't completely lost.

    Read the article

  • jquery offset incorrect on floating elements

    - by LordZardeck
    I have a bunch of images each with the float: left property applied to them. They are constrained withing a 400px width area, forcing them into a grid of 4 X 4. If i try to get the position of them, they are always incorrect. What is causing this? You can see what I'm trying to do here: http://dev.redemptionconnect.com/cards/browse. Click one of the images to see what I mean. the dialog that pops up should be over the image you clicked.

    Read the article

  • Are there any good reasons why I should not use Python?

    - by coppro
    I've heard from reliable sources that Python is a great language that every programmer can learn, but I've heard so much good about it that I'm clearly not getting the whole picture. I'm considering spending more time to learn it, and I've heard more than I need about its virtues (to the point where I've started recommending it having never really used it), so I want to know its drawbacks, flaws, issues, and every single minor point of irritation you've ever had (preferably with explanations readable to one who doesn't program Python, such as with an example in another language). Convince me not to try it out.

    Read the article

  • Play! - Expecting a stack map frame in method controllers

    - by Benny
    I am using the Security module for my Play! application and had it working at one point, but for some reason I did something to make it stop working. I am getting the following errors: Execution exception VerifyError occured : Expecting a stack map frame in method controllers.Secure$Security.authentify(Ljava/lang/String;Ljava/lang/String;)Z at offset 33 In {module:secure}/app/controllers/Secure.java (around line 61) I saw the post below, but, even though I am using Java 7, it looks like Play! works ok with 7 now. I am using Play 1.2.4. VerifyError; Expecting a stack map frame in method controllers.Secure$Security.authentify Here is my Security controller: package controllers; import models.*; public class Security extends Secure.Security { public static boolean authenticate(String username, String password) { User user = User.find("byEmail", username).first(); return user != null && user.password.equals(password); } }

    Read the article

  • Simple Array in java

    - by user1311590
    I need to create the following in my main method. Create an array of size 100 doubles. write a loop to sotr the number 150.0 - 249.0 in the 100 location. public class Lab6_2 { public static void main(String[] args) { double[] values; values = new double [100]; double i = 0; for(double i = 150.0; i<249.0;i++){ System.out.println(values[99]); } } }

    Read the article

  • Save/Load jFreechart TimeSeriesCollection chart from XML

    - by IMAnis_tn
    I'm working with this exemple wich put rondom dynamic data into a TimeSeriesCollection chart. My problem is that i can't find how to : 1- Make a track of the old data (of the last hour) when they pass the left boundary (because the data point move from the right to the left ) of the view area just by implementing a horizontal scroll bar. 2- Is XML a good choice to save my data into when i want to have all the history of the data? public class DynamicDataDemo extends ApplicationFrame { /** The time series data. */ private TimeSeries series; /** The most recent value added. */ private double lastValue = 100.0; public DynamicDataDemo(final String title) { super(title); this.series = new TimeSeries("Random Data", Millisecond.class); final TimeSeriesCollection dataset = new TimeSeriesCollection(this.series); final JFreeChart chart = createChart(dataset); final ChartPanel chartPanel = new ChartPanel(chart); final JPanel content = new JPanel(new BorderLayout()); content.add(chartPanel); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(content); } private JFreeChart createChart(final XYDataset dataset) { final JFreeChart result = ChartFactory.createTimeSeriesChart( "Dynamic Data Demo", "Time", "Value", dataset, true, true, false ); final XYPlot plot = result.getXYPlot(); ValueAxis axis = plot.getDomainAxis(); axis.setAutoRange(true); axis.setFixedAutoRange(60000.0); // 60 seconds axis = plot.getRangeAxis(); axis.setRange(0.0, 200.0); return result; } public void go() { final double factor = 0.90 + 0.2 * Math.random(); this.lastValue = this.lastValue * factor; final Millisecond now = new Millisecond(); System.out.println("Now = " + now.toString()); this.series.add(new Millisecond(), this.lastValue); } public static void main(final String[] args) throws InterruptedException { final DynamicDataDemo demo = new DynamicDataDemo("Dynamic Data Demo"); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); while(true){ demo.go(); Thread.currentThread().sleep(1000); } } }

    Read the article

  • Android ListView: how to select an item?

    - by mmo
    I am having trouble with a ListView I created: I want an item to get selected when I click on it. My code for this looks like: protected void onResume() { ... ListView lv = getListView(); lv.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView<?> adapterView, View view, int pos, long id) { Log.v(TAG, "onItemSelected(..., " + pos + ",...) => selected: " + getSelectedItemPosition()); } public void onNothingSelected(AdapterView<?> adapterView) { Log.v(TAG, "onNothingSelected(...) => selected: " + getSelectedItemPosition()); } }); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> adapterView, View view, int pos, long id) { lv.setSelection(pos); Log.v(TAG, "onItemClick(..., " + pos + ",...) => selected: " + getSelectedItemPosition()); } }); ... } When I run this and click e.g. on the second item (i.e. pos=1) I get: 04-03 23:08:36.994: V/DisplayLists(663): onItemClick(..., 1,...) => selected: -1 i.e. even though the OnItemClickListener is called with the proper argument and calls a setSelection(1), there is no item selected (and hence also OnItemSelectedListener.onItemSelected(...) is never called) and getSelectedItemPosition() still yields -1 after the setSelection(1)-call. What am I missing? Michael PS.: My list does have =2 elements...

    Read the article

  • Backbone collection's URL depends on initialize function

    - by egidra
    I have a Backbone collection whose URL depends on the initialize function. When I create an instance of this Backbone collection, I pass in an ID to filter which instances of the model appear. Here is what the collection's code looks like: var GoalUpdateList = Backbone.Collection.extend({ // Reference the Goal Update model model: GoalUpdate, // Do HTTP requests on this endpoint url: "http://localhost:8000/api/v1/goal_update/?goal__id=" + this.goal_id + "&format=json", // Set the goal ID that the goal update list corresponds to initialize: function(goal_id) { this.goal_id = goal_id; console.log(this.goal_id); console.log(this.url); }, }); Of course, this doesn't work. this.goal_id is seen as being undefined. I guess because the URL is set before the initialization function is run.

    Read the article

  • Is it possible to specify Jquery File Upload to post back only once (for multiple files)?

    - by JaJ
    When I upload multiple files (per bluimp jquery file upload) the [httppost] action is entered once per file. Is it possible to specify one and only one postback with an enumerated file container to iterate? View: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="@Url.Content("~/Scripts/jquery.ui.widget.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.iframe-transport.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.fileupload.js")" type="text/javascript"></script> <input id="fileupload" type="file" name="files" multiple="multiple"/> Controller: public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(IEnumerable<HttpPostedFileBase> files) { // This is posted back for every file that gets uploaded...I would prefer it only post back once // with a actual collection of files to iterate. foreach (var file in files) // There is only ever one file in files { var filename = Path.Combine(Server.MapPath("~/App_Data"), file.FileName); file.SaveAs(filename); } return View(); }

    Read the article

  • tuProlog unknow behavior

    - by Josh Guzman
    I'm using tuProlog to integrate Prolog with Java, to do so I'v been defined a .pl file wich contains this code: go:-write('hello world!'),nl. In my Java File at NetBeans i Have a Main Class that invokes this: Prolog engine = new Prolog(); Theory theory = new Theory(new FileInputStream("facultad.pl")); try { engine.setTheory(theory); } catch (InvalidTheoryException ex) { } SolveInfo solution = engine.solve("go."); if (solution.isSuccess()) { System.out.println(solution.getSolution()); } This Code must returns 'hello world', but instead of that it answer 'go', any ideas about this erratic behavior ??

    Read the article

  • The right approach to loading dynamic content into a UITableView in iOS

    - by OS.
    ok, I've read tons of bits and pieces on the subject of loading dynamic content (from the web) into a UITableView and the problem with calculating cell height upfront. I've tried different simple implementations but the problem persists... Assuming I need to read a JSON file from the web, parse it into 'item' objects, each with variable size image and various text labels, here is what I believe would be the right approach to avoid long hang time of the app while everything is loading: on app load read JSON file and parse into items array provide only small part of the items array to the tableview (about 10 items) - since I need to load the images associated with each item to calculate cell height - I don't want the view to go through the whole items list and load all images - this hangs the app until every image is loaded display the tableview with the available cells (assuming I load a few 'spare' ones, user can even scroll to more items) in the background using Grand Central Dispatch download images for all/some of the remaining items and then reload the tableview with the new data (repeat step 4 if item list is very long) Step 2 above is necessary since I have no way to calculate the cell height without loading the images first, and since tableview first calculates height of all cells it may take a very long time to download all images for all items. Would you say this is the right approach? am I missing something?

    Read the article

  • Search and replace with sed

    - by Binoy Babu
    Last week I accidently externalized all my strings of my eclipse project. I need to revert this and my only hope is sed. I tried to create scripts but failed pathetically because I'm new with sed and this would be a very complicated operation. What I need to do is this: Strings in class.java file is currently in the following format(method) Messages.getString(<key>). Example : if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.89") + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.90") + i; //$NON-NLS-1$ break; } } } The key and matching Strings are in messages.properties file in the following format. VSDataSource.92=No of rows in db = VSDataSource.93=Verifying db entry : VSDataSource.94=DB is open VSDataSource.95=DB is closed VSDataSource.96=Invalid db entry for VSDataSource.97=\ removed. So I need the java file back in this format: if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + "String 2" + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + "String 1" + i; //$NON-NLS-1$ break; } } } How can I accomplish this with sed? Or is there an easier way?

    Read the article

  • Action Item shown only in Landscape?

    - by roboguy12
    I was just wondering if it were at all possible for an Action Bar icon to only be shown when the device is in landscape mode? In portrait I have an onscreen button for a certain task, but in order to take advantage of all of the screen-space in landscape, that button won't fit. So I was wondering if I could put it in the Action Bar, but it would only be necessary when the device is in landscape. Thanks!

    Read the article

  • Ternary operator in VB.NET

    - by Jalpesh P. Vadgama
    We all know about Ternary operator in C#.NET. I am a big fan of ternary operator and I like to use it instead of using IF..Else. Those who don’t know about ternary operator please go through below link. http://msdn.microsoft.com/en-us/library/ty67wk28(v=vs.80).aspx Here you can see ternary operator returns one of the two values based on the condition. See following example. bool value = false;string output=string.Empty;//using If conditionif (value==true) output ="True";else output="False";//using tenary operatoroutput = value == true ? "True" : "False"; In the above example you can see how we produce same output with the ternary operator without using If..Else statement. Recently in one of the project I was working with VB.NET language and I was eager to know if there is a ternary operator equivalent there or not. After searching on internet I have found two ways to do it. IF operator which works for VB.NET 2008 and higher version and IIF operator which is there since VB 6.0. So let’s check same above example with both of this operators. So let’s create a console application which has following code. Module Module1 Sub Main() Dim value As Boolean = False Dim output As String = String.Empty ''Output using if else statement If value = True Then output = "True" Else output = "False" Console.WriteLine("Output Using If Loop") Console.WriteLine(output) output = If(value = True, "True", "False") Console.WriteLine("Output using If operator") Console.WriteLine(output) output = IIf(value = True, "True", "False") Console.WriteLine("Output using IIF Operator") Console.WriteLine(output) Console.ReadKey() End If End SubEnd Module As you can see in the above code I have written all three-way to condition check using If.Else statement and If operator and IIf operator. You can see that both IIF and If operator has three parameter first parameter is the condition which you need to check and then another parameter is true part of you need to put thing which you need as output when condition is ‘true’. Same way third parameter is for the false part where you need to put things which you need as output when condition as ‘false’. Now let’s run that application and following is the output as expected. That’s it. You can see all three ways are producing same output. Hope you like it. Stay tuned for more..Till then Happy Programming.

    Read the article

  • How to pad number with leading zero with C#

    - by Jalpesh P. Vadgama
    Recently I was working with a project where I was in need to format a number in such a way which can apply leading zero for particular format.  So after doing such R and D I have found a great way to apply this leading zero format. I was having need that I need to pad number in 5 digit format. So following is a table in which format I need my leading zero format. 1-> 00001 20->00020 300->00300 4000->04000 50000->5000 So in the above example you can see that 1 will become 00001 and 20 will become 00200 format so on. So to display an integer value in decimal format I have applied interger.Tostring(String) method where I have passed “Dn” as the value of the format parameter, where n represents the minimum length of the string. So if we pass 5 it will have padding up to 5 digits. So let’s create a simple console application and see how its works. Following is a code for that. using System; namespace LeadingZero { class Program { static void Main(string[] args) { int a = 1; int b = 20; int c = 300; int d = 4000; int e = 50000; Console.WriteLine(string.Format("{0}------>{1}",a,a.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", b, b.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", c, c.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", d, d.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", e, e.ToString("D5"))); Console.ReadKey(); } } } As you can see in the above code I have use string.Format function to display value of integer and after using integer value’s  ToString method. Now Let’s run the console application and following is the output as expected. Here you can see the integer number are converted into the exact output that we requires. That’s it you can see it’s very easy. We have written code in nice clean way and without writing any extra code or loop. Hope you liked it. Stay tuned for more.. Till than happy programming.

    Read the article

  • Not Happy With the Monochrome Visual Studio 11 Beta UI

    - by Ken Cox [MVP]
    I can’t wait for a third-party to come out with tools to return some colour to the flat, monochrome look of Visual Studio 11 (beta). What bugs me most are the icons. I feel like a newbie when I have to squint and analyze the shape of icons on the debugging toolbar just to get the one I want. (Fortunately, the meddlers didn’t mess with the keyboard commands so I’m not totally lost.) Not sure what usability studies told MS that bland is better. Maybe it is for most people, but not for me.  Gray, shades of gray and black. Ugh. And don’t get me started on the stupidity of using all-caps for window titles. Who approved that? I see that there’s a UserVoice poll on the topic (http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2623017-add-some-color-to-visual-studio-11-beta) but I doubt that anything will change Microsoft’s opinion in time for the release. Once a product gets to a stable beta, most non-crashing stuff gets pushed to the next version. I hope I’m proved wrong. Fortunately, Visual Studio is quite customizable. Unless ‘Bland’ is hard-coded, some registry tweaks and a collection of replacement icons should allow dissenters like me back to productivity. BTW, other than hating the UI, VS 11 beta is working quite well for me on a .NET 4 project.Note: Although my username for the ASP.NET domain includes the letters "[MVP]", I'm no longer an MVP. Apparently it's nearly impossible to change a username in the system. My apologies for the misleading identifier but I tried to have it changed without success.

    Read the article

  • Using Node.js as an accelerator for WCF REST services

    - by Elton Stoneman
    Node.js is a server-side JavaScript platform "for easily building fast, scalable network applications". It's built on Google's V8 JavaScript engine and uses an (almost) entirely async event-driven processing model, running in a single thread. If you're new to Node and your reaction is "why would I want to run JavaScript on the server side?", this is the headline answer: in 150 lines of JavaScript you can build a Node.js app which works as an accelerator for WCF REST services*. It can double your messages-per-second throughput, halve your CPU workload and use one-fifth of the memory footprint, compared to the WCF services direct.   Well, it can if: 1) your WCF services are first-class HTTP citizens, honouring client cache ETag headers in request and response; 2) your services do a reasonable amount of work to build a response; 3) your data is read more often than it's written. In one of my projects I have a set of REST services in WCF which deal with data that only gets updated weekly, but which can be read hundreds of times an hour. The services issue ETags and will return a 304 if the client sends a request with the current ETag, which means in the most common scenario the client uses its local cached copy. But when the weekly update happens, then all the client caches are invalidated and they all need the same new data. Then the service will get hundreds of requests with old ETags, and they go through the full service stack to build the same response for each, taking up threads and processing time. Part of that processing means going off to a database on a separate cloud, which introduces more latency and downtime potential.   We can use ASP.NET output caching with WCF to solve the repeated processing problem, but the server will still be thread-bound on incoming requests, and to get the current ETags reliably needs a database call per request. The accelerator solves that by running as a proxy - all client calls come into the proxy, and the proxy routes calls to the underlying REST service. We could use Node as a straight passthrough proxy and expect some benefit, as the server would be less thread-bound, but we would still have one WCF and one database call per proxy call. But add some smart caching logic to the proxy, and share ETags between Node and WCF (so the proxy doesn't even need to call the servcie to get the current ETag), and the underlying service will only be invoked when data has changed, and then only once - all subsequent client requests will be served from the proxy cache.   I've built this as a sample up on GitHub: NodeWcfAccelerator on sixeyed.codegallery. Here's how the architecture looks:     The code is very simple. The Node proxy runs on port 8010 and all client requests target the proxy. If the client request has an ETag header then the proxy looks up the ETag in the tag cache to see if it is current - the sample uses memcached to share ETags between .NET and Node. If the ETag from the client matches the current server tag, the proxy sends a 304 response with an empty body to the client, telling it to use its own cached version of the data. If the ETag from the client is stale, the proxy looks for a local cached version of the response, checking for a file named after the current ETag. If that file exists, its contents are returned to the client as the body in a 200 response, which includes the current ETag in the header. If the proxy does not have a local cached file for the service response, it calls the service, and writes the WCF response to the local cache file, and to the body of a 200 response for the client. So the WCF service is only troubled if both client and proxy have stale (or no) caches.   The only (vaguely) clever bit in the sample is using the ETag cache, so the proxy can serve cached requests without any communication with the underlying service, which it does completely generically, so the proxy has no notion of what it is serving or what the services it proxies are doing. The relative path from the URL is used as the lookup key, so there's no shared key-generation logic between .NET and Node, and when WCF stores a tag it also stores the "read" URL against the ETag so it can be used for a reverse lookup, e.g:   Key Value /WcfSampleService/PersonService.svc/rest/fetch/3 "28cd4796-76b8-451b-adfd-75cb50a50fa6" "28cd4796-76b8-451b-adfd-75cb50a50fa6" /WcfSampleService/PersonService.svc/rest/fetch/3    In Node we read the cache using the incoming URL path as the key and we know that "28cd4796-76b8-451b-adfd-75cb50a50fa6" is the current ETag; we look for a local cached response in /caches/28cd4796-76b8-451b-adfd-75cb50a50fa6.body (and the corresponding .header file which contains the original service response headers, so the proxy response is exactly the same as the underlying service). When the data is updated, we need to invalidate the ETag cache – which is why we need the reverse lookup in the cache. In the WCF update service, we don't need to know the URL of the related read service - we fetch the entity from the database, do a reverse lookup on the tag cache using the old ETag to get the read URL, update the new ETag against the URL, store the new reverse lookup and delete the old one.   Running Apache Bench against the two endpoints gives the headline performance comparison. Making 1000 requests with concurrency of 100, and not sending any ETag headers in the requests, with the Node proxy I get 102 requests handled per second, average response time of 975 milliseconds with 90% of responses served within 850 milliseconds; going direct to WCF with the same parameters, I get 53 requests handled per second, mean response time of 1853 milliseconds, with 90% of response served within 3260 milliseconds. Informally monitoring server usage during the tests, Node maxed at 20% CPU and 20Mb memory; IIS maxed at 60% CPU and 100Mb memory.   Note that the sample WCF service does a database read and sleeps for 250 milliseconds to simulate a moderate processing load, so this is *not* a baseline Node-vs-WCF comparison, but for similar scenarios where the  service call is expensive but applicable to numerous clients for a long timespan, the performance boost from the accelerator is considerable.     * - actually, the accelerator will work nicely for any HTTP request, where the URL (path + querystring) uniquely identifies a resource. In the sample, there is an assumption that the ETag is a GUID wrapped in double-quotes (e.g. "28cd4796-76b8-451b-adfd-75cb50a50fa6") – which is the default for WCF services. I use that assumption to name the cache files uniquely, but it is a trivial change to adapt to other ETag formats.

    Read the article

  • Orlando .NET Code Camp 2012 - total success..

    - by mrad
    Their site is www.orlandocodecamp.comThis year's camp was held at Seminole State College.It was well worth it.. Took a chance at going.. by getting up at 5am and driving from Jax to Sanford for 2+hr..Run into some old friends and bunch of new ones. Coders are not really good at networking.. but they sure did show up.. attendance was solid 500+ geeks and some sessions were standing room only. MVP John Papa had the room packed out on his every session. Really enjoyed great and inspiring WP7 presentations by MVP Atley Hunter from Canada.. And of course the MVP legend Joe Healy was everywhere encouraging and promoting cool stuff, hopefully we'll get him back to present at JaxDUG and/or bring back Microsoft workshops to Jax area.

    Read the article

  • Working with packed dates in SSIS

    - by Jim Giercyk
    One of the challenges recently thrown my way was to read an EBCDIC flat file, decode packed dates, and insert the dates into a SQL table.  For those unfamiliar with packed data, it is a way to store data at the nibble level (half a byte), and was often used by mainframe programmers to conserve storage space.  In the case of my input file, the dates were 2 bytes long and  represented the number of days that have past since 01/01/1950.  My first thought was, in the words of Scooby, Hmmmmph?  But, I love a good challenge, so I dove in. Reading in the flat file was rather simple.  The only difference between reading an EBCDIC and an ASCII file is the Code Page option in the connection manager.  In my case, I needed to use Code Page 1140 for EBCDIC (I could have also used Code Page 37).       Once the code page is set correctly, SSIS can understand what it is reading and it will convert the output to the default code page, 1252.  However, packed data is either unreadable or produces non-alphabetic characters, as we can see in the preview window.   Column 1 is actually the packed date, columns 0 and 2 are the values in the rest of the file.  We are only interested in Column 1, which is a 2 byte field representing a packed date.  We know that 2 bytes of packed data can be stored in 1 byte of character data, so we are working with 4 packed digits in 2 character bytes.  If you are confused, stay tuned….this will make sense in a minute.   Right-click on your Flat File Source shape and select “Show Advanced Editor”. Here is where the magic begins. By changing the properties of the output columns, we can access the packed digits from each byte. By default, the Output Column data type is DT_STR. Since we want to look at the bytes individually and not the entire string, change the data type to DT_BYTES. Next, and most important, set UseBinaryFormat to TRUE. This will write the HEX VALUES of the output string instead of writing the character values.  Now we are getting somewhere! Next, you will need to use a Data Conversion shape in your Data Flow to transform the 2 position byte stream to a 4 position Unicode string containing the packed data.  You need the string to be 4 bytes long because it will contain the 4 packed digits.  Here is what that should look like in the Data Conversion shape: Direct the output of your data flow to a test table or file to see the results.  In my case, I created a test table.  The results looked like this:     Hold on a second!  That doesn't look like a date at all.  No, of course not.  It is a hex number which represents the days which have passed between 01/01/1950 and the date.  We have to convert the Hex value to a decimal value, and use the DATEADD function to get a date value.  Luckily, I have created a function to convert Hex to Decimal:   -- ============================================= -- Author:        Jim Giercyk -- Create date: March, 2012 -- Description:    Converts a Hex string to a decimal value -- ============================================= CREATE FUNCTION [dbo].[ftn_HexToDec] (     @hexValue NVARCHAR(6) ) RETURNS DECIMAL AS BEGIN     -- Declare the return variable here DECLARE @decValue DECIMAL IF @hexValue LIKE '0x%' SET @hexValue = SUBSTRING(@hexValue,3,4) DECLARE @decTab TABLE ( decPos1 VARCHAR(2), decPos2 VARCHAR(2), decPos3 VARCHAR(2), decPos4 VARCHAR(2) ) DECLARE @pos1 VARCHAR(1) = SUBSTRING(@hexValue,1,1) DECLARE @pos2 VARCHAR(1) = SUBSTRING(@hexValue,2,1) DECLARE @pos3 VARCHAR(1) = SUBSTRING(@hexValue,3,1) DECLARE @pos4 VARCHAR(1) = SUBSTRING(@hexValue,4,1) INSERT @decTab VALUES (CASE               WHEN @pos1 = 'A' THEN '10'                 WHEN @pos1 = 'B' THEN '11'               WHEN @pos1 = 'C' THEN '12'               WHEN @pos1 = 'D' THEN '13'               WHEN @pos1 = 'E' THEN '14'               WHEN @pos1 = 'F' THEN '15'               ELSE @pos1              END, CASE               WHEN @pos2 = 'A' THEN '10'                 WHEN @pos2 = 'B' THEN '11'               WHEN @pos2 = 'C' THEN '12'               WHEN @pos2 = 'D' THEN '13'               WHEN @pos2 = 'E' THEN '14'               WHEN @pos2 = 'F' THEN '15'               ELSE @pos2              END, CASE               WHEN @pos3 = 'A' THEN '10'                 WHEN @pos3 = 'B' THEN '11'               WHEN @pos3 = 'C' THEN '12'               WHEN @pos3 = 'D' THEN '13'               WHEN @pos3 = 'E' THEN '14'               WHEN @pos3 = 'F' THEN '15'               ELSE @pos3              END, CASE               WHEN @pos4 = 'A' THEN '10'                 WHEN @pos4 = 'B' THEN '11'               WHEN @pos4 = 'C' THEN '12'               WHEN @pos4 = 'D' THEN '13'               WHEN @pos4 = 'E' THEN '14'               WHEN @pos4 = 'F' THEN '15'               ELSE @pos4              END) SET @decValue = (CONVERT(INT,(SELECT decPos4 FROM @decTab)))         +                 (CONVERT(INT,(SELECT decPos3 FROM @decTab))*16)      +                 (CONVERT(INT,(SELECT decPos2 FROM @decTab))*(16*16)) +                 (CONVERT(INT,(SELECT decPos1 FROM @decTab))*(16*16*16))     RETURN @decValue END GO     Making use of the function, I found the decimal conversion, added that number of days to 01/01/1950 and FINALLY arrived at my “unpacked relative date”.  Here is the query I used to retrieve the formatted date, and the result set which was returned: SELECT [packedDate] AS 'Hex Value',        dbo.ftn_HexToDec([packedDate]) AS 'Decimal Value',        CONVERT(DATE,DATEADD(day,dbo.ftn_HexToDec([packedDate]),'01/01/1950'),101) AS 'Relative String Date'   FROM [dbo].[Output Table]         This technique can be used any time you need to retrieve the hex value of a character string in SSIS.  The date example may be a bit difficult to understand at first, but with SSIS becoming the preferred tool for enterprise level integration for many companies, there is no doubt that developers will encounter these types of requirements with regularity in the future. Please feel free to contact me if you have any questions.

    Read the article

  • Equivalent of LogRotate for Windows?

    - by mfinni
    We have a huge logfile being written by a vendor's application. Let's assume the vendor won't do anything that we ask. Is there any way of rotating that logfile somehow? We're looking at about 300 MB an hour being written - I'd much rather chunk that into 10 MB pieces, and let anything older than a day or over 1000 files fall off a cliff. (I know I know, possible duplicate of How do you rotate apache logs on windows without interrupting service? ) Aha - the Chomp log was dead, but searching for "chomp logrotate brought me to it's new site. I'll give it a try tomorrow and reply if I like it. I'd still like to hear about software anyone else is using that works for this.

    Read the article

  • Demoted domain controller and now IIS has permissions issues

    - by tladuke
    I have a machine that was a domain controller and everything else, includin an IIS site. I built new 2 new domain controllers and transferred the FSMO roles and waited a day and then demoted the original domain controller. Now the IIS site says : HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers. I have a call in with the web app vendor, but maybe someone can guess what I need to fix now. I haven't looked at IIS since this was installed and am pretty lost. I thought about restoring the machine from a backup, but I think that would be an Active Directory disaster, right? The server is Windows 2008 (not R2). The new DCs are 2008 R2

    Read the article

  • Social Media event Bandwidth requirements

    - by Bob G
    I have an one day event in July 2012, hosting 250 attendees for a social media event. We will be uploading live video to a website, allowing the press to access the web, and some vendors will be showing off their web sites for clients and visitors. The staff will need access for uploading files and information as needed. We had the event last year and tried a cable modem brought in with 2x2 megs just for the streaming video which worked well. I had 4 wireless hot spots, rented from a company 1.5 mbps x 780 kbps, which was were a complete failure. I was assured the 4 hot spots would be enough, but they did not work. What would be the proper way to get the bandwidth required to make the one day event successful? The setting is a Private Country Club where running cables everywhere is very tough.

    Read the article

  • SQL server agent job to execute SSIS package fails, package succeds if run manually

    - by growse
    I've got a SSIS package installed on a SQL server (SQL Server 2012). It's fairly simple and just fetches data from a remote data source and adds it into a local table. The remote connection string is using SQL server authentication, while the local connection is using Windows auth. The remote connection password is protected, and the package was imported setting the protection level to Rely on server storage and roles for access control. If I run the SSIS package manually, it works. If I run it from the command line using dtexec, it works. If I use runas to switch to the domain account that the SQL server agent is running under, and then run the package using dtexec, it works. If I create a SQL Agent job with a single step to run the package, it fails, providing very little detail as to what's going on. I'm guessing it's not able to get the password to log into the remote SQL server, because it fails very quickly. Also, if I tick 'log to table' and view the resulting file, I get the following: Description: ADO NET Source has failed to acquire the connection {0D8F2CD4-A763-4AEB-8B52-B8FAE0621ED3} with the following error message: "Login failed for user 'username'.". If I try to add the password in the connection string manually under data sources in the job step dialog, it refuses to save it, always seeming to remove the 'password' bit of the connection string. I thought that SQL server agent jobs always ran under the context of the account which the SQL server agent is running under. This account is a sysadmin on the local SQL server, and the package works using dtexec under that account, so why would it fail when trying to run as an agent job?

    Read the article

  • Which is the fastest way to move 1Petabyte from one storage to a new one?

    - by marc.riera
    First of all, thanks for reading, and sorry for asking something related to my job. I understand that this is something that I should solve by myself but as you will see its something a bit difficult. A small description: Now Storage = 1PB using DDN S2A9900 storage for the OSTs, 4 OSS , 10 GigE network. (lustre 1.6) 100 compute nodes with 2x Infiniband 1 infiniband switch with 36 ports After Storage = Previous storage + another 1PB using DDN S2A 990 or LSI E5400 (still to decide) (lustre 2.0) 8 OSS , 10GigE network 100 compute nodes with 2x Infiniband Previous experience: transfered 120 TB in less than 3 days using following command: tar -C /old --record-size 2048 -b 2048 -cf - dir | tar -C /new --record-size 2048 -b 2048 -xvf - 2>&1 | tee /tmp/dir.log So , big problem here, using big mathematical equations I conclude that we are going to need 1 month to transfer the data from one side to the new one. During this time the researchers will need to step back, and I'm personally not happy with this. I'm telling you that we have infiniband connections because I think that may be there is a chance to use it to transfer the data using 18 compute nodes (18 * 2 IB = 36 ports) to transfer the data from one storage to the other. I'm trying to figure out if the IB switch will handle all the traffic but in case it just burn up will go faster than using 10GigE. Also, having lustre 1.6 and 2.0 agents on same server works quite well, with this there is no need to go by 1.8 to upgrade the metadata servers with two steps. Any ideas? Many thanks Note 1: Zoredache, we can divide it in two blocks (A)600Tb and (B)400Tb. The idea is to move (A) to new storage which is lustre2.0 formated, then format where (A) was with lustre2.0 and move (B) to this lustre2.0 block and extend with the space where (B) was. This way we will end with (A) and (B) on separate filesystems, with 1PB each.

    Read the article

  • How do I secure Sql Server 2008 R2

    - by Mark Tait
    I have both a dedicated and a VPS (from Fasthosts) virtual server - the web sites/applications I run on these, access Sql Server stored on the same web server. Until now, I have logged onto Sql Server on both the deidicated and VPS server, from Sql Server Management Studio - until I noticed in my server application logs, multiple attempts to logon to Sql Server using the 'sa' username, but failed password. So someone/bot is trying hard (repeatedly every couple of hours, for approx 20 attempts during each instance) to log on... so obviously I have to lock down access to Sql Sever remotely. What I have done is gone into Configuration Manager, and in Sql Server Network Configuration - Protocols for Sql2008 and also in Sql Native Client 10.0 Configuration - Client Protocols - I have diabled Named Pipes, TCP/IP (and VIA by default). I have left Shared Memory enabled. I also disabled in Sql Server Services, the Sql Server Browser. Now the only way I can manage the databases on these servers, is by logging on to them via Remote Desktop. Can anyone confirm if this is the correct way of stopping anyone maliciously logging on to Sql Server? (I'm not a DBA or security expert - and there are hundreds of articles advising all different ways - but I was hoping for the experts here to confirm, or otherwise, if what I've done is correct) Thank you, Mark

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18  | Next Page >