Search Results

Search found 1557 results on 63 pages for 'daniel gollas'.

Page 36/63 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • Why does the ASP.Net Web Forms model "suck"?

    - by Daniel Magliola
    I've heard Jeff Atwood, Joel Spolsky, and many other legendary people talk about how the ASP.Net Web Forms model sucks. (So this question is kind of directed to them, hopefully Jeff is reading) Now, I highly respect their opinion, given their background and expertise, but truth be told, I absolutely LOVE ASP.Net. I think the model is brilliant, and it sucks if you have no idea what you're doing, but once you understand how to control ViewState, when to use handlers instead of pages, etc, it is generations ahead of all the other models. So every time I hear someone complain about how it sucks, I can't help ask the same question... Why? What is it that's so bad about it? I appreciate all opinions. I'm assuming there's probably a post at Jeff's blog talking about this too...

    Read the article

  • Does NHibernate LINQ support ToLower() in Where() clauses?

    - by Daniel T.
    I have an entity and its mapping: public class Test { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string Description { get; set; } } public class TestMap : EntityMap<Test> { public TestMap() { Id(x => x.Id); Map(x => x.Name); Map(x => x.Description); } } I'm trying to run a query on it (to grab it out of the database): var keyword = "test" // this is coming in from the user keyword = keyword.ToLower(); // convert it to all lower-case var results = session.Linq<Test> .Where(x => x.Name.ToLower().Contains(keyword)); results.Count(); // execute the query However, whenever I run this query, I get the following exception: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Am I right when I say that, currently, Linq to NHibernate does not support ToLower()? And if so, is there an alternative that allows me to search for a string in the middle of another string that Linq to NHibernate is compatible with? For example, if the user searches for kap, I need it to match Kapiolani, Makapuu, and Lapkap.

    Read the article

  • Using implicit conversion as a substitute for multiple inheritance in .NET

    - by Daniel Plaisted
    I have a situation where I would like to have objects of a certain type be able to be used as two different types. If one of the "base" types was an interface this wouldn't be an issue, but in my case it is preferable that they both be concrete types. I am considering adding copies of the methods and properties of one of the base types to the derived type, and adding an implicit conversion from the derived type to that base type. Then users will be able treat the derived type as the base type by using the duplicated methods directly, by assigning it to a variable of the base type, or by passing it to a method that takes the base type. It seems like this solution will fit my needs well, but am I missing anything? Is there a situation where this won't work, or where it is likely to add confusion instead of simplicity when using the API?

    Read the article

  • Marshalling to a native library in C#

    - by Daniel Baulig
    I'm having trouble calling functions of a native library from within managed C# code. I am developing for the 3.5 compact framework (Windows Mobile 6.x) just in case this would make any difference. I am working with the waveIn* functions from coredll.dll (these are in winmm.dll in regular Windows I believe). This is what I came up with: // namespace winmm; class winmm [StructLayout(LayoutKind.Sequential)] public struct WAVEFORMAT { public ushort wFormatTag; public ushort nChannels; public uint nSamplesPerSec; public uint nAvgBytesPerSec; public ushort nBlockAlign; public ushort wBitsPerSample; public ushort cbSize; } [StructLayout(LayoutKind.Sequential)] public struct WAVEHDR { public IntPtr lpData; public uint dwBufferLength; public uint dwBytesRecorded; public IntPtr dwUser; public uint dwFlags; public uint dwLoops; public IntPtr lpNext; public IntPtr reserved; } public delegate void AudioRecordingDelegate(IntPtr deviceHandle, uint message, IntPtr instance, ref WAVEHDR wavehdr, IntPtr reserved2); [DllImport("coredll.dll")] public static extern int waveInAddBuffer(IntPtr hWaveIn, ref WAVEHDR lpWaveHdr, uint cWaveHdrSize); [DllImport("coredll.dll")] public static extern int waveInPrepareHeader(IntPtr hWaveIn, ref WAVEHDR lpWaveHdr, uint Size); [DllImport("coredll.dll")] public static extern int waveInStart(IntPtr hWaveIn); // some other class private WinMM.WinMM.AudioRecordingDelegate waveIn; private IntPtr handle; private uint bufferLength; private void setupBuffer() { byte[] buffer = new byte[bufferLength]; GCHandle bufferPin = GCHandle.Alloc(buffer, GCHandleType.Pinned); WinMM.WinMM.WAVEHDR hdr = new WinMM.WinMM.WAVEHDR(); hdr.lpData = bufferPin.AddrOfPinnedObject(); hdr.dwBufferLength = this.bufferLength; hdr.dwFlags = 0; int i = WinMM.WinMM.waveInPrepareHeader(this.handle, ref hdr, Convert.ToUInt32(Marshal.SizeOf(hdr))); if (i != WinMM.WinMM.MMSYSERR_NOERROR) { this.Text = "Error: waveInPrepare"; return; } i = WinMM.WinMM.waveInAddBuffer(this.handle, ref hdr, Convert.ToUInt32(Marshal.SizeOf(hdr))); if (i != WinMM.WinMM.MMSYSERR_NOERROR) { this.Text = "Error: waveInAddrBuffer"; return; } } private void setupWaveIn() { WinMM.WinMM.WAVEFORMAT format = new WinMM.WinMM.WAVEFORMAT(); format.wFormatTag = WinMM.WinMM.WAVE_FORMAT_PCM; format.nChannels = 1; format.nSamplesPerSec = 8000; format.wBitsPerSample = 8; format.nBlockAlign = Convert.ToUInt16(format.nChannels * format.wBitsPerSample); format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; this.bufferLength = format.nAvgBytesPerSec; format.cbSize = 0; int i = WinMM.WinMM.waveInOpen(out this.handle, WinMM.WinMM.WAVE_MAPPER, ref format, Marshal.GetFunctionPointerForDelegate(waveIn), 0, WinMM.WinMM.CALLBACK_FUNCTION); if (i != WinMM.WinMM.MMSYSERR_NOERROR) { this.Text = "Error: waveInOpen"; return; } setupBuffer(); WinMM.WinMM.waveInStart(this.handle); } I read alot about marshalling the last few days, nevertheless I do not get this code working. When my callback function is called (waveIn) when the buffer is full, the hdr structure passed back in wavehdr is obviously corrupted. Here is an examlpe of how the structure looks like at that point: - wavehdr {WinMM.WinMM.WAVEHDR} WinMM.WinMM.WAVEHDR dwBufferLength 0x19904c00 uint dwBytesRecorded 0x0000fa00 uint dwFlags 0x00000003 uint dwLoops 0x1990f6a4 uint + dwUser 0x00000000 System.IntPtr + lpData 0x00000000 System.IntPtr + lpNext 0x00000000 System.IntPtr + reserved 0x7c07c9a0 System.IntPtr This obiously is not what I expected to get passed. I am clearly concerned about the order of the fields in the view. I do not know if Visual Studio .NET cares about actual memory order when displaying the record in the "local"-view, but they are obviously not displayed in the order I speciefied in the struct. Then theres no data pointer and the bufferLength field is far to high. Interestingly the bytesRecorded field is exactly 64000 - bufferLength and bytesRecorded I'd expect both to be 64000 though. I do not know what exactly is going wrong, maybe someone can help me out on this. I'm an absolute noob to managed code programming and marshalling so please don't be too harsh to me for all the stupid things I've propably done. Oh here's the C code definition for WAVEHDR which I found here, I believe I might have done something wrong in the C# struct definition: /* wave data block header */ typedef struct wavehdr_tag { LPSTR lpData; /* pointer to locked data buffer */ DWORD dwBufferLength; /* length of data buffer */ DWORD dwBytesRecorded; /* used for input only */ DWORD_PTR dwUser; /* for client's use */ DWORD dwFlags; /* assorted flags (see defines) */ DWORD dwLoops; /* loop control counter */ struct wavehdr_tag FAR *lpNext; /* reserved for driver */ DWORD_PTR reserved; /* reserved for driver */ } WAVEHDR, *PWAVEHDR, NEAR *NPWAVEHDR, FAR *LPWAVEHDR; If you are used to work with all those low level tools like pointer-arithmetic, casts, etc starting writing managed code is a pain in the ass. It's like trying to learn how to swim with your hands tied on your back. Some things I tried (to no effect): .NET compact framework does not seem to support the Pack = 2^x directive in [StructLayout]. I tried [StructLayout(LayoutKind.Explicit)] and used 4 bytes and 8 bytes alignment. 4 bytes alignmentgave me the same result as the above code and 8 bytes alignment only made things worse - but that's what I expected. Interestingly if I move the code from setupBuffer into the setupWaveIn and do not declare the GCHandle in the context of the class but in a local context of setupWaveIn the struct returned by the callback function does not seem to be corrupted. I am not sure however why this is the case and how I can use this knowledge to fix my code. I'd really appreciate any good links on marshalling, calling unmanaged code from C#, etc. Then I'd be very happy if someone could point out my mistakes. What am I doing wrong? Why do I not get what I'd expect.

    Read the article

  • Solr Multicore Admin Problem

    - by Daniel M
    Im trying to add a url based security constraint to solr deployed in websphere 6.1. If I specify the core name in the url of the constraint then the admin url for that core gives a 404. Has anyone had any success with this or any suggestions? Cheers

    Read the article

  • jQuery hover function

    - by Daniel Hertz
    So I have a hover function that is supposed to move an arrow under the corrent the link that someone hovers over. The problem is, the arrow never returns to the current link when the person stops hovering over the link. However, if I set the left properly with a constant value it works. Anyone have any ideas? var currentId = '#' + $('body').attr('id') + '_link'; var xCordCurrent = $(currentId).offset().left - ($('#arrow').width() / 2); var xCordHover = $(event.target).offset().left + ($(event.target).width() / 2) - ($('#arrow').width() / 2); $('#arrow').animate( { left: xCordHover }, { duration: 'slow', easing: 'easeOutBack' }) }, function(event) { $('#arrow').animate( { left: xCordCurrent }, { duration: 'slow', easing: 'easeOutBack' }) });

    Read the article

  • Simulating O_NOFOLLOW (2): Is this other approach safe?

    - by Daniel Trebbien
    As a follow-up question to this one, I thought of another approach which builds off of @caf's answer for the case where I want to append to file name and create it if it does not exist. Here is what I came up with: Create a temporary directory with mode 0700 in a system temporary directory on the same filesystem as file name. Create an empty, temporary, regular file (temp_name) in the temporary directory (only serves as placeholder). Open file name for reading only, just to create it if it does not exist. The OS may follow name if it is a symbolic link; I don't care at this point. Make a hard link to name at temp_name (overwriting the placeholder file). If the link call fails, then exit. (Maybe someone has come along and removed the file at name, who knows?) Use lstat on temp_name (now a hard link). If S_ISLNK(lst.st_mode), then exit. open temp_name for writing, append (O_WRONLY | O_APPEND). Write everything out. Close the file descriptor. unlink the hard link. Remove the temporary directory. (All of this, by the way, is for an open source project that I am working on. You can view the source of my implementation of this approach here.) Is this procedure safe against symbolic link attacks? For example, is it possible for a malicious process to ensure that the inode for name represents a regular file for the duration of the lstat check, then make the inode a symbolic link with the temp_name hard link now pointing to the new, symbolic link? I am assuming that a malicious process cannot affect temp_name.

    Read the article

  • Chart Control Inside SSRS ReportViewer is Viewable From Localhost But Not Internet

    - by Daniel Coffman
    A project I own was just moved from an older server to a new one, and in the process of moving the web folder, re-deploying the SSRS reports, restoring the database, configuring IIS, etc... I have lost the ability to view the Microsoft Chart Controls that are embedded in the SSRS reports, that are then displayed by a Microsoft.ReportViewer. I could view them both locally and remotely (via the internet) on the old server. I can view them if I preview the SSRS report in Visual Studio. The report displays fine, only missing all the embedded charts. I can still view them locally through the web browser, just not from the internet. What am I missing? I tried giving permissions to the ChartImageHandler temp storage folder, but it didn't work. I'm getting the Javascript error: Error: ClientReport380ec8ca0c294a809e9986c1bef9db1c is undefined

    Read the article

  • ALTER TABLE without locking the table?

    - by Daniel
    When doing an ALTER TABLE statement in MySQL, the whole table is read-locked for the duration of the statement. If it's a big table, that means insert or update statements could be locked for a looooong time. Is there a way to do a "hot alter", like adding a column in such a way that the table is still updatable throughout the process? Mostly I'm interested in a solution for MySQL but I'd be interested in other RDBMS if MySQL can't do it. To clarify, my purpose is simply to avoid downtime when a new feature that requires an extra table column is pushed to production. Any database schema will change over time, that's just a fact of life. I don't see why we should accept that these changes must inevitably result in downtime; that's just weak.

    Read the article

  • Possiblity of loading/executing ELF files on OSX

    - by Daniel Brotherston
    I'm just curious as to the possibility of loading and executing elf files on OSX. I know the standard executable format is MACHO, but NASM is unable to generate debug information for MACHO objects (and I am required to use NASM). I imagine its a long shot, but I don't suppose I can use ELF files. I can build them with NASM, but I can't seem to even link them with LD.

    Read the article

  • PHP won't let page update automatically every day/6 hours

    - by Daniel
    A friend build a ranking system on his site and I am trying to host in on mine via wordpress and godaddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error. His page is at: http://www.jeremynoeljohnson.com/yakezieclub My page is currently at http://sweatingthebigstuff.com/yakezieclub but when you ?reload=1 it will give the error. Any idea why this might be happening? Any settings that I might need to change?

    Read the article

  • iTunes App Store API?

    - by Daniel
    Sites like http://www.apptism.com/ readout the app store automatically and display information like title, description, price and images. Where do I find the documentation for this (iTunes API?). I tried to google it but no good result.

    Read the article

  • How can I "best fit" an arbitrary cairo (pycairo) path?

    - by Daniel Straight
    It seems like given the information in stroke_extents() and the translate(x, y) and scale(x, y) functions, I should be able to take any arbitrary cairo (I'm using pycairo) path and "best fit" it. In other words, center it and expand it to fill the available space. Before drawing the path, I have scaled the canvas such that the origin is the lower left corner, up is y+, right is x+, and the height and width are both 1. Given these conditions, this code seems to correctly scale the path: # cr is the canvas extents = cr.stroke_extents() x_size = abs(extents[0]) + abs(extents[2]) y_size = abs(extents[1]) + abs(extents[3]) cr.scale(1.0 / x_size, 1.0 / y_size) I cannot for the life of me figure out the translating though. Is there a simpler approach? How can I "best fit" a cairo path on its canvas? Please ask for clarification if anything is unclear in this question.

    Read the article

  • man kaio: No manual entry for kaio.

    - by Daniel
    I trussed a process, and they are lines as below. And I want to know the definition of kaio, but there is no manual entry for kaio, so whether can I get the definition? /1: kaio(AIOWRITE, 259, 0x3805B2A00, 8704, 0x099C9E000755D3C0) = 0 /1: kaio(AIOWRITE, 259, 0x380CF9200, 14336, 0x099CC0000755D5B8) = 0 /1: kaio(AIOWRITE, 259, 0x381573600, 8704, 0x099CF8000755D7B0) = 0 /1: kaio(AIOWRITE, 259, 0x381ACA600, 8192, 0x099D1A000755D9A8) = 0 /1: kaio(AIOWAIT, 0xFFFFFFFF7FFFD620) = 4418032576 /1: timeout: 600.000000 sec /1: kaio(AIOWAIT, 0xFFFFFFFF7FFFD620) = 4418033080 /1: timeout: 600.000000 sec /1: kaio(AIOWAIT, 0xFFFFFFFF7FFFD620) = 4418033584 /1: timeout: 600.000000 sec

    Read the article

  • How to get distinct results in hibernate with joins and row-based limiting?

    - by Daniel Alexiuc
    I'm trying to implement paging using row-based limiting (for example: setFirstResult(5) and setMaxResults(10)) on a Hibernate Criteria query that has joins to other tables. Understandably, data is getting cut off randomly; and the reason for that is explained here. As a solution, the page suggests using a "second sql select" instead of a join. How can I convert my existing criteria query (which has joins using createAlias()) to use a nested select instead?

    Read the article

  • UIView animation not working

    - by Daniel
    I have the following code to do a UIView animation: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationDelegate:self]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mapView.view cache:NO]; [self addSubview:detailView]; [mapView removeFromSuperview]; [UIView commitAnimations]; It works when I dont add the detailView. What actually happens is the equivalent of this: [self addSubview:detailView]; [mapView removeFromSuperview]; Please help.

    Read the article

  • Why does my NSWindow only receive mouseOver events the first time?

    - by DanieL
    I have an application where a borderless window is shown and hidden, using orderOut and orderFront. When it is visible, I want the it to become the key window when the mouse moves over it. So far I've done this: In awakeFromNib I have set its first responder to itself. In the window's constructor I set accepts mouse events to YES. In the mouseMoved method, I use makeKeyAndOrderToFront. My problem is, that this only works the first time I move the mouse over the window. After that, it doesn't receive any mouseOver events. I've tried checking the firstResponder but as far as I can tell it never changes from the window. Any ideas what I can do to get this working?

    Read the article

  • CSS Hover on parent list Item only

    - by Daniel O'Connor
    Hey Everyone, So I have some nested lists (only one level deep) and I'm running into trouble with the CSS :hover feature. I only want the hover to apply to the parent class, but I can't figure that one out. Here's my CSS <style type="text/css" media="screen"> .listblock li img { visibility: hidden; } .listblock li:hover img { visibility: visible; } </style> And here is a sample of one of the lists. <ul> <li>One <a href="#"><img src="img/basket.png" height="16" width="16" alt="Buy" class="buy" onClick="pageTracker._trackEvent('Outbound Links', 'Amazon');"/></a></li> <li>Two <a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a> <ul> <li>Uno<a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a></li> <li>Dos <a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a></li> </ul> </li> <li>Three <a href="#"><img src="img/basket.png" height="16" width="16" alt="Buy" class="buy" onClick="pageTracker._trackEvent('Outbound Links', 'Amazon');"/></a></li> </ul> The problem is that the image in the Uno and Dos list items also hovers. :( Help please! Thanks a lot

    Read the article

  • Invalid argument in sendfile() with two regular files

    - by Daniel Hershcovich
    I'm trying to test the sendfile() system call under Linux 2.6.32 to zero-copy data between two regular files. As far as I understand, it should work: ever since 2.6.22, sendfile() has been implemented using splice(), and both the input file and the output file can be either regular files or sockets. The following is the content of sendfile_test.c: #include <sys/sendfile.h> #include <fcntl.h> #include <stdio.h> int main(int argc, char **argv) { int result; int in_file; int out_file; in_file = open(argv[1], O_RDONLY); out_file = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644); result = sendfile(out_file, in_file, NULL, 1); if (result == -1) perror("sendfile"); close(in_file); close(out_file); return 0; } And when I'm running the following commands: $ gcc sendfile_test.c $ ./a.out infile The output is sendfile: Bad file descriptor Which means that the system call resulted in errno = -EINVAL, I think. What am I doing wrong?

    Read the article

  • Two unordered list from this XML data

    - by Daniel
    Hi I have this XML: <Tekstside id="1081" level="3" nodeName="Test" urlName="test"> <umbracoRedirect /> <overskrift>Test</overskrift> <tekst></tekst> <sidensTitel /> <sidensBeskrivelse /> <sidensNgleord /> - <Faktaboks id="1113" level="4" nodeName="Det her virker" urlName="det-her-virker"> <umbracoNaviHide>1</umbracoNaviHide> - <fordele> - <values> <value>Ingen emission</value> <value>Det virker bare</value> <value>Det er top nice</value> <value>Det er bare fedt</value> <value>Udstødnings</value> <value /> </values> </fordele> - <ulemper> - <values> <value>Giver sygdom</value> <value>Er farligt</value> <value /> </values> </ulemper> </Faktaboks> </Tekstside> I want the "fordele" values and the "ulemper" values made into the unorderes lists with XSLT in Umbraco: <div class="fanda"> <ul class="for"> <li>Købsprisen</li> </ul> <ul class="against"> <li>Kortere servicerings interval pga. additivet fylder med i filteret.</li> <li>Der kan forekomme meget varieret modtryk, isærpå biler med lav - udstødningstemperatur.</li> <li>Udgifter til Additiv - typisk fra 400 - 600 kr. pr. liter.</li> <li>Kan ikke klare alle kørselsmønstre</li> </ul> </div>

    Read the article

  • Asp.Net: Open a second browser window with new session id

    - by Daniel Brink
    Right google isn't helping me on this one. I need to open a second browser window or tab, but it must have a different session id. Opening the new browser window from my asp.net page is easy, but then it shares the same cookie and thus session ID with the original. So how can I do this? I need the original browser window to keep its cookies and session and the new browser window to have a new session.

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >