Daily Archives

Articles indexed Sunday January 9 2011

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

  • XSLT - group response as per month and year combination

    - by alisha
    I want into write xslt to get response for the input xml. thanks in advance. I want to group output such that month year combination is not repeated for each of the employee details. Input XML: <resultset> <row> <column> <name>Month</name> <value>2</value> </column> <column> <name>Year</name> <value>2010</value> </column> <column> <name>EmpName</name> <value>Anu</value> </column> <column> <name>Age</name> <value>24</value> </column> </row> <row> <column> <name>Month</name> <value>2</value> </column> <column> <name>Year</name> <value>2010</value> </column> <column> <name>EmpName</name> <value>Nancy</value> </column> <column> <name>Age</name> <value>26</value> </column> </row> <row> <column> <name>Month</name> <value>3</value> </column> <column> <name>Year</name> <value>2010</value> </column> <column> <name>EmpName</name> <value>Ned</value> </column> <column> <name>Age</name> <value>25</value> </column> </row> </resultset> Output expected: <Response> <PeriodInfo> <Month>2</Month> <Year>2010</Year> <EmployeeDetails> <Name>Anu</Name> <Age>24</Age> </EmployeeDetails> <EmployeeDetails> <Name>Nancy</Name> <Age>26</Age> </EmployeeDetails> </PeriodInfo> <PeriodInfo> <Month>3</Month> <Year>2010</Year> <EmployeeDetails> <Name>Ned</Name> <Age>25</Age> </EmployeeDetails> </PeriodInfo> </Response>

    Read the article

  • Checking type sizes in C with macros.

    - by Seisatsu
    I'm writing a program that needs to have unsigned types with definite sizes. I need a uint8, uint16, uint32, and uint64, and I need them defined in types.h, in a way that they will always be defined correctly regardless of platform. My question is, how can I check the sizes of different types on each platform using preprocessor macros, so that I can define my custom types correctly in the types.h header?

    Read the article

  • Code working in jsFiddle but not in browser...

    - by Jascination
    I'm trying to run the following code, written on my local machine: http://www.jsfiddle.net/WShdx/3/ Functionality-wise (ignore the broken images in the previous and next buttons, and the wrongly-sized main images) the click/hover function is working properly in jsfiddle. However, on my local machine it's not working at all. For all intents and purposes the code is identical, except the local copy has this head section to load in the javascript/css files that are contained within the jsfiddle page: <head> <title>Jquery Wizard</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="wizard.js" type="text/javascript" ></script> </head> Is there some wonderful function of jsFiddle that is making my code magically work, or am I missing something here?

    Read the article

  • kick off a map reduce job from my java/mysql webapp

    - by Brian
    Hi guys, I need a bit of archecture advice. I have a java based webapp, with a JPA based ORM backed onto a mysql relational database. Now, as part of the application I have a batch job that compares thousands of database records with each other. This job has become too time consuming and needs to be parallelized. I'm looking at using mapreduce and hadoop in order to do this. However, I'm not too sure about how to integrate this into my current architecture. I think the easiest initial solution is to find a way to push data from mysql into hadoop jobs. I have done some initial research on this and found the following relevant information and possibilities: 1) https://issues.apache.org/jira/browse/HADOOP-2536 this gives an interesting overview of some inbuilt JDBC support 2) This article http://architects.dzone.com/articles/tools-moving-sql-database describes some third party tools to move data from mysql to hadoop. To be honest I'm just starting out with learning about hbase and hadoop but I really don't know how to integrate this into my webapp. Any advice is greatly appreciated. cheers, Brian

    Read the article

  • Is the size of a struct required to be an exact multiple of the alignment of that struct?

    - by Steve314
    Once again, I'm questioning a longstanding belief. Until today, I believed that the alignment of the following struct would normally be 4 and the size would normally be 5... struct example { int m_Assume_32_Bits; char m_Assume_8_Bit_Bytes; }; Because of this assumption, I have data structure code that uses offsetof to determine the distance in bytes between two adjacent items in an array. Today, I spotted some old code that was using sizeof where it shouldn't, couldn't understand why I hadn't had bugs from it, coded up a unit test - and the test surprised me by passing. A bit of investigation showed that the sizeof the type I used for the test (similar to the struct above) was an exact multiple of the alignment - ie 8 bytes. It had padding after the final member. Here is an example of why I never expected this... struct example2 { example m_Example; char m_Why_Cant_This_Be_At_Offset_6_Bytes; }; A bit of Googling showed examples that make it clear that this padding after the final member is allowed - for example http://en.wikipedia.org/wiki/Data_structure_alignment#Data_structure_padding (the "or at the end of the structure" bit). This is a bit embarrassing, as I recently posted this comment - Use of struct padding (my first comment to that answer). What I can't seem to determine is whether this padding to an exact multiple of the alignment is guaranteed by the C++ standard, or whether it is just something that is permitted and that some (but maybe not all) compilers do. So - is the size of a struct required to be an exact multiple of the alignment of that struct according to the C++ standard? If the C standard makes different guarantees, I'm interested in that too, but the focus is on C++.

    Read the article

  • How do I generate a connection reset programatically?

    - by Brock Adams
    Hi, I'm sure you've seen the "the connection was reset" message displayed when trying to browse web pages. (The text is from Firefox, other browsers differ.) I need to generate that message/error/condition on demand, to test workarounds. So, how do I generate that condition programmatically? (How to generate a TCP RST from PHP -- or one of the other web-app languages?) Caveats and Conditions: It cannot be a general IP block. The test client must still be able to see the test server when not triggering the condition. Ideally, it would be done at the web-application level (Python, PHP, Coldfusion, Javascript, etc.). Access to routers is problematic. Access to Apache config is a pain. Ideally, it would be triggered by fetching a specific web-page. Bonus if it works on a standard, commercial web host. Update: Sending RST is not enough to cause this condition. See my partial answer, below. I've a solution that works on a local machine, Now need to get it working on a remote host.

    Read the article

  • Does all the network card use the same frequency to send signals to wire?

    - by smwikipedia
    Hi, I am comparing my cable TV wire to my network wire. In a TV cable wire, different frequencies are used by different TV channels. And since a certain channel use a fixed frequency, I think the only left way to represent different signal is with the carrier wave's amplitude. But what about the network wire? For all the network card with the same type, do they also use different frequencies to send signals just like TV cable? I vaguely remember that they use frequency adjustment to represent signals. So the frequency should not be a fixed one. So how did all the network cards that sharing the same medium differentiate their own signal from others?

    Read the article

  • Why does order matter for ImageMagick's -colorspace operation?

    - by Mark Trapp
    Starting with ImageMagick 6, the command style changed to solve a bunch of problems outlined in the Basic Usage document. That document does imply that for simple operations, one should only need to move the options from before the source file to between the source and output files to convert from the "old" style to the "new" style. However, this doesn't seem to work for the -colorspace operation. When I use the following command, I get an output file with the correct colors: convert -colorspace rgb input.pdf output.png But when I try to use the new command style, the -colorspace operation is never applied: convert input.pdf -colorspace rgb output.png Samples: Why does this occur?

    Read the article

  • Converting From CommunityServer to DotNetNuke Intro

    - by Chris Hammond
    ( originally posted on DNNDaily ) So I have been trying to figure out how best to do this blog post for a while now, though I think I will be better off doing it as a series of blog posts rather than one individual one. So this post will be the starting point for the conversion. I will update it with links to the other blog posts in the series as they get created and added. Background (all in my opinion and based on my memory, as inaccurate as that may be) : Back in the early days of ASP.NET there...(read more)

    Read the article

  • How to configure postfix to dynamically choose different relayhosts?

    - by user24315
    I use my laptop at work on wireless and wired networks, at home on a wireless network, and at various other places (such as conferences, friends houses, etc). When at work I'd like postfix to use the corportate mail server to route emails. When at home I'd like it to use my personal mail server to route emails. When elsewhere I'd like to have the laptop attempt to deliver email in the normal smtp fashion. Is this possible using just postfix? Do I need something else (such as Lamson http://lamsonproject.org/, or scripts that dynamically patch my postfix configuration) when I want to do routing that depends on my current location?

    Read the article

  • Personal email server

    - by celil
    I would like to set up a personal email server. I am currently using Gmail, but I am becoming increasingly concerned at the amount of data that I share with Google. I would like to migrate all of my email to my personal server. Is there an easy to use, secure, open source alternative to Gmail that can be ran on personal servers? I do not need a web interface to my email as I usually access it via IMAP.

    Read the article

  • get ubuntu terminal to send an escape sequence (control+shift+up)

    - by user62046
    This problem starts when I use emacs ( with -nw option). Let me first explain it. I tried to define hotkey (for emacs) as following (global-set-key [(control shift up)] 'other-window) but it doesn't work (no error, just doesn't work), neither does (global-set-key [(control shift down)] 'other-window) But (global-set-key [(control shift right)] 'other-window) and (global-set-key [(control shift left)] 'other-window) work! But because the last two key combinations are used by emacs (as default), I don't wanna change them for other functions. So how could I make control-shift-up and control-shift-down work? I have googled "(control shift up)", it seems that control-shift-up is used by other people, (but not very few results). In the Stack Overflow forum, Gille answered me as following: Ctrl+Shift+Up does send a signal to your computer, but your terminal emulator is apparently not transmitting any escape sequence for it. So your problem is in two parts. First you must get your terminal emulator to send an escape sequence, which depends on your terminal emulator, and is Super User material, or Unix.SE if you're using a unix system. Then you need to declare the escape sequence in Emacs, and my answer explains that part So I come here for this question: How do I get my terminal (I use ubuntu 10.04, and the built-in terminal) to send an escape sequence for Control+Shift+Up Control+Shift+down

    Read the article

  • Partition table damaged

    - by emaster70
    Hello, I'm currently in a terrible situation with my hdd: I was trying to install an OS side by side with my windows 7 x64 and I used the Paragon Partition Manager feature made for that. It disabled/hid/(damaged?) one of my partitions and now I can no longer access it. The partition, unfortunately, contains data I need to access urgently and I've got no backup. To complicate things even further I don't have another PC (I'm writing this msg from my iphone) and all I can rely on is a backtrac 4 disk (wkn't connect to my wifi, gets stuck obtaining IP address) and. Windows 7 x64 disk. Booting into windows fails with the pc hanging on the starting windows screen. Safe mode won't work either. Is there anything I can do? Here's the layout of the disk: Recovery partition Win partition Unallocated space (it's supposed to be my data partition) Other os partition (don't care about that, the installation of the other OS failed) Please help me, I'm desperate.

    Read the article

  • Keep icons for shortcuts in thumbnail view?

    - by buzter
    I want to keep icons for shortcuts in thumbnail view. eg: my pics folder is in thumbnail, but I want to easily see my familiar icons for shortcuts to various outside folders I drag the pics into, amongst the hundreds of pics and subfolders within my pics (which display the same as shortcuts at a glance) I had it like this on my last machine but I can't remember what I had to do. Reg tweak for filetype I think. (Using XPpro) Any clues? Thanks

    Read the article

  • Formatting a disk for Macintosh using Linux

    - by Ken Bloom
    I've been asked to move data from an old external hard drive to a new one, and to make the new one compatible with the Macintosh. (The old drive's USB connection has died, and I'm connecting to old the drive using a PC card that provieds an eSATA to the drive. The recipient's Macintosh doesn't have a PC card slot, so she can't access the old drive anymore. Hence, the new drive.) Naturally, I'm doing this data transfer using Linux. I've discovered that I can format the drive as HFS+ using mkfs.hfsplus from the hfsprogs package. But I need to know: do I need to do anything special with the partition table? Is there a special Macintosh partition table format that I need to format this disk to? If so, what tools can I use to get the right format for the partition table?

    Read the article

  • Cheese with vaapi

    - by MetaDark
    Hi, I am using a Dell Inspiron Mini 10 with GMA500 video drivers. GMA500 fixes resolution issues and enables video acceleration. The only problem with the GMA500 drivers I am having is that I can not find a fix for the webcam program called cheese, and I can't find a way to enable the vaapi (Video Acceleration API) backend. Videos don't work with the GMA500 (without vaapi) and I cannot properly use cheese. If anyone can help me out with this I will be grateful because Google isn't helping me much with this problem.

    Read the article

  • Hacked by our own hosting company!

    - by dazhall
    OK, so our hosting company decided to clone our site and database onto a new serve. Without our knowledge or permission they then edited our code to point to the new database. The old server was left running, still pointing at the original database. The DNS was changed to reflect the new IP address of the server. Obviously during the propagation customers were hitting both the new and old servers, resulting in orders coming in to both databases, sometimes being split between the two. We're now attempting to reconcile the two databases. The question I have is is it still hacking if it was done by your own hosting company?! I'm fairly sure they shouldn't have edited our code! If they had left it as it was the site would have stayed pointed at the original database and we wouldn't be in this mess! I'm thinking that legal advice is need but just wanted to know if anyone had ever come across this situation before?!

    Read the article

  • [Devise] confirmation_url points to localhost

    - by Ved
    I am using Devise and omniauth for authentication in my rails app. I have followed readme and put the following line in my production.rb : config.action_mailer.default_url_options = { :host => 'http://morning-autumn-487.heroku.com' } My mailer has the following code: <%= link_to 'Confirm my account',confirmation_url(@user, :confirmation_token => @user.confirmation_token) %> When I upload the app to heroku, the confirmation mail has the following link for registration in the email : http://127.0.0.1:3000/users/confirmation?confirmation_token=8TyGWQo6y... Is there a setting that governs this host name ?

    Read the article

  • Relatively simple task: How do I pass back the selected item from one activity to another?

    - by Brian D
    I have two activities: one displays an image and a button, the other displays a photo gallery. I want to be able to select any of the images in the gallery and then display them on the first activity in place of the default image. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); Gallery g = (Gallery) findViewById(R.id.gallery); g.setAdapter(new ImageAdapter(this)); g.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { Toast.makeText(PhotoGallery.this, "Position: " + id, Toast.LENGTH_SHORT).show(); Intent intent=new Intent(); intent.putExtra("PictureID", position); setResult(RESULT_OK, intent); finish(); } }); } Am I even close here? I'm not quite sure what to do with any string or int I would attach to the Intent -- can I attach the object itself? I'd much rather pass back at minimum the string name of the resource (image), but the only thing I can seem to figure out right now is how to pass back the position of the picture ... not a great solution. I can clarify more if necessary -- thanks.

    Read the article

  • Can you reuse a mysql result set in PHP?

    - by MarathonStudios
    I have a result set I pull from a large database: $result = mysql_query($sql); I loop through this recordset once to pull specific bits of data and get averages using while($row = mysql_fetch_array($result)). Later in the page, I want to loop through this same recordset again and output everything - but because I used the recordset earlier, my second loop returns nothing. I finally hacked around this by looping through a second identical recordset ($result2 = mysql_query($sql);), but I hate to make the same SQL call twice. Any way I can loop through the same dataset multiple times?

    Read the article

  • Remove all html tags and content except for a div class

    - by Crazy
    I want to remove all html content from a string except for a div class : <div class="toto">blablabla</div> Should I use a Regex or DOM Parser? To answer drachenstern : It's a comment content with bbcode. And the html in this div is generated with Geshi (code highlighter) so i don't want to delete this. For example a visitor can enter <script></script> in a [code][/code] bbcode tag. All HTML outside the [code][/code] bbcode tag must be delete no?

    Read the article

  • how to get wanted nodes from Stanford Parser nlp

    - by vitaly
    Hello all! My mean problem is that I dont know how to extract nodes from GrammaticalStructure. I am using englishPCFG.ser in java netbeans. My target is o know the quality of the screen like: the screen of iphone 4 is great. I want to extract screen and great. how can i extract the NN (screen) and VP (great) the code that I wrote is: LexicalizedParser lp = new LexicalizedParser("C:\\englishPCFG.ser"); lp.setOptionFlags(new String[]{"-maxLength", "80", "-retainTmpSubcategories"}); String sent ="the screen is very good."; Tree parse = (Tree) lp.apply(Arrays.asList(sent)); parse.pennPrint(); System.out.println(); TreebankLanguagePack tlp = new PennTreebankLanguagePack(); GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory(); GrammaticalStructure gs = gsf.newGrammaticalStructure(parse); Collection tdl = gs.typedDependenciesCollapsed();

    Read the article

  • #define vs enum in an embedded environment (How do they compile?)

    - by Alexander Kondratskiy
    This question has been done to death, and I would agree that enums are the way to go. However, I am curious as to how enums compile in the final code- #defines are just string replacements, but do enums add anything to the compiled binary? Or are they both equivalent at that stage. When writing firmware and memory is very limited, is there any advantage, no matter how small, to using #defines? Thanks! EDIT: As requested by the comment below, by embedded, I mean a digital camera. Thanks for the answers! I am all for enums!

    Read the article

  • Ubuntu Github ssh keys issue

    - by Alex Baranosky
    I followed every step given in this guide: http://help.github.com/linux-key-setup/ When I get to the end I am able to ssh to [email protected], getting the response: PTY allocation request failed on channel 0 Hi AlexBaranosky! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed But when I go to clone my repo it fails saying: Permission denied (publickey). fatal: The remote end hung up unexpectedly I've used Github a lot, but this is my first use of it from an Ubuntu computer, is there something I am missing here? Any help is greatly appreciated. Alex

    Read the article

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