Search Results

Search found 1506 results on 61 pages for 'ben mezger'.

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

  • Checking if MySQL Database data does not exist

    - by Ben Sinclair
    I have my songs set-up in my MySQL database. Each song is is either assigned multiple locations or has no locations at all. Only the songs that either have no locations assigned in the database or have the location assigned to the ones specified below should be pulled from the database. Hopefully when you understand my query below it will make sense SELECT s.* FROM roster_songs AS s LEFT JOIN roster_songs_locations AS sl ON sl.song_id = s.id WHERE EXISTS ( SELECT sl2.* FROM roster_songs_locations AS sl2 WHERE s.id != sl2.song_id ) OR ( sl.location_id = '88fb5f94-aaa6-102c-a4fa-1f05bca0eec6' OR sl.location_id = '930555b0-a251-102c-a245-1559817ce81a' ) GROUP BY s.id The query almost works except it pulls out of the database songs that are assigned to sl.location_id's that aren't specified in the above query. I think it has something to do with my EXISTS code picking them up... Any ideas how I can get this to work?

    Read the article

  • How do I extract the values from this data using bash and awk?

    - by ben Rod
    I grepped these, how do I extract the values? ... cavity_2mgl_wt_strip57001.out: Total cavity volume (A3) : ( 1.240E+01) cavity_2mgl_wt_strip58001.out: Total cavity volume (A3) : ( 2.408E+00) cavity_2mgl_wt_strip60001.out: Total cavity volume (A3) : ( 4.935E+00) cavity_2mgl_wt_strip61001.out: Total cavity volume (A3) : ( 1.319E+00) cavity_2mgl_wt_strip63001.out: Total cavity volume (A3) : ( 1.532E-01) cavity_2mgl_wt_strip64001.out: Total cavity volume (A3) : ( 1.137E+01) ... and I need the index # in the filename in bold: cavity_2mgl_wt_strip76001.out: Total cavity volume (A3) : ( 1.276E+01) and I need the number in the parenthesis cavity_2mgl_wt_strip76001.out: Total cavity volume (A3) : ( **1.276E+01**)

    Read the article

  • recognising hand written code [closed]

    - by ben-jolly
    i need to perform some operations on image files. i need to verify each pixels of that particular image file. how can i do that?? ... help me by providing a method to include image file..... iam planning to do it in c language... so provide useful commands too.

    Read the article

  • Loop Control within a DataflowTask in ETL

    - by Ben
    Hi, Being fairly new to SSIS and the ETL process, I was wondering if there is anyway to loop though a record set within a DataFlowTask and pass each row (deriving parameters from the row) into a Stored Procedure (the next step in the ETL phase). Once i have passed the row into the stored procedure, I want the results from each iteration to be written to a Table. Does anyone know how to do this? Thanks.

    Read the article

  • Will the following NHibernate interface mapping work?

    - by Ben Aston
    I'd like to program against interfaces when working with NHibernate due to type dependency issues within the solution I am working with. SO questions such as this indicate it is possible. I have an ILocation interface and a concrete Location type. Will the following work? HBM mapping: <class name="ILocation" abstract="true" table="ILocation"> <id name="Id" type="System.Guid" unsaved-value="00000000-0000-0000-0000-000000000000"> <column name="LocationId" /> <generator class="guid" /> </id> <union-subclass table="Location" name="Location"> <property name="Name" type="System.String"/> </union-subclass> </class> Detached criteria usage using the interface: var criteria = DetachedCriteria.For<ILocation>().Add(Restrictions.Eq("Name", "blah")); var locations = criteria.GetExecutableCriteria(UoW.Session).List<ILocation>(); Are there any issues with not using the hilo ID generator and/or with this approach in general?

    Read the article

  • WPF Linear Fill

    - by Ben
    Hi, I have found some example code that creates a gradient fill in a WPF rectangle control: <Rectangle Height="{Binding ElementName=txtName}" Width="{Binding ElementName=txtName}"> <Rectangle.Fill> <LinearGradientBrush> <GradientStop Color="Silver" Offset="0.0" /> <GradientStop Color="Black" Offset="0.5" /> <GradientStop Color="white" Offset="1.0" /> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> I have some written some code that displays a collection of ListBox's that contain details from MyObject: <UserControl.Resources> <DataTemplate x:Key="CustomerTemplate"> <Border BorderThickness="2" BorderBrush="Silver" CornerRadius="5" Padding="1" Height="50"> <Grid x:Name="thisGrid"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" > <Image Source="C:\MyImage.jpg" Height="50" Width="100" ></Image> </StackPanel> <Border Grid.Column="1" Margin="0" Padding="0"> <StackPanel Orientation="Vertical"> <TextBlock Name="txtName" Text="{Binding Name}" Background="Silver" Foreground="Black" FontSize="16" FontWeight="Bold" Height="25"/> </StackPanel> </Border> </Grid> </Border> </DataTemplate> </UserControl.Resources> <ListBox ItemsSource="{Binding}" ItemTemplate="{StaticResource CustomerTemplate}" Name="grdList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" > </ListBox> I would like to apply the same stlye of fill that i get with the first example, in each of my ListBox's. I can't quite figure out how to do this. Can anyone help? Thanks

    Read the article

  • How can I stop SQL Server Management Studio replacing 'SELECT *' with the column list ?

    - by Ben McIntyre
    SQL Server Mgmt Studio is driving me crazy. If I create a view and SELECT '*' from a table, it's all OK and I can save the view. Looking at the SQL for the view (eg.by scripting a CREATE) reveals that the 'SELECT *' really is saved to the view's SQL. But as soon as I reopen the view using the GUI (right click modify), SELECT * is replaced with a column list of all the columns in the table. How can I stop Management Studio from doing this ? I want my 'SELECT *' to remain just that. Perhaps it's just the difficulty of googling 'SELECT *' that prevented me from finding anything remotely relevant to this (i did put it in double quotes). Please, I am highly experienced in Transact-SQL, so please DON'T give me a lecture on why I shouldn't be using SELECT *. I know all the pros and cons and I do use it at times. It's a language feature, and like all language features can be used for good or evil (I emphatically do NOT agree that it is never appropriate to use it). Edit: I'm giving Marc the answer, since it seems it is not possible to turn this behaviour off. Problem is considered closed. I note that Enterprise Manager did no similar thing. The workaround is to either edit SQL as text, or go to a product other than Managment Studio. Or constantly edit out the column list and replace the * every time you edit a view. Sigh.

    Read the article

  • When should I stub out a type by manually creating a "stub" version, rather than using a mocking fra

    - by Ben Aston
    Are there any circumstances where it is favourable to manually create a stub type, as opposed to using a mocking framework (such as Rhino Mocks) at the point of test. We take both these approaches in our projects. My gut feel when I look at the long list of stub versions of objects is that it will add maintenance overhead, and moves the implementation of the stub away from the point of test.

    Read the article

  • How do I make a SignalR client something when it receives a message?

    - by Ben
    I want to do something when a client receives a message via a SignalR hub. I've put together a basic chat app, but want people to be able to "like" a chat comment. I'm thinking the way to do this is to find the chat message on the client's page and update it using javascript. In the meantime to "prove the concept" I just want to make an alert popup on the client machine to say another user likes the comment. Trouble is, I'm not sure where to put it. (Am struggling to find SignalR documentation to be honest.) can't get my head round what is calling what here. My ChatHub class is as follows: public class ChatHub : Hub { public void Send(string name, string message) { // Call the broadcastMessage method to update clients. Clients.All.broadcastMessage(name, message); } } And my JavaScript is: $(function () { // Declare a proxy to reference the hub. var chat = $.connection.chatHub; // Create a function that the hub can call to broadcast messages. chat.client.broadcastMessage = function (name, message) { // Html encode display name and message. var encodedName = $('<div />').text(name).html(); var encodedMsg = $('<div />').text(message).html(); // Add the message to the page. var divContent = $('#discussion').html(); $('#discussion').html('<div class="container">' + '<div class="content">' + '<p class="username">' + encodedName + '</p>' + '<p class="message">' + encodedMsg + '</p>' + '</div>' + '<div class="slideout">' + '<div class="clickme" onclick="slideMenu(this)"></div>' + '<div class="slidebutton"><img id="imgid" onclick="likeButtonClick(this)" src="Images/like.png" /></div>' + '<div class="slidebutton"><img onclick="commentButtonClick(this)" src="Images/comment.png" /></div>' + '<div class="slidebutton" style="margin-right:0px"><img onclick="redcardButtonClick(this)" src="Images/redcard.png" /></div>' + '</div>' + '</div>' + divContent); }; // Set initial focus to message input box. $('#message').focus(); // Start the connection. $.connection.hub.start().done(function () { $('#sendmessage').click(function () { // Call the Send method on the hub. chat.server.send($('#lblUser').html(), $('#message').val()); // Clear text box and reset focus for next comment. $('#message').val('').focus(); }); });

    Read the article

  • How do you implement a good profanity filter?

    - by Ben Throop
    Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs to be filtered out. Where can one find a good list of swear words in various languages and dialects? Are there APIs available to sources that contain good lists? Or maybe an API that simply says "yes this is clean" or "no this is dirty" with some parameters? What are some good methods for catching folks trying to trick the system, like a$$, azz, or a55? Bonus points if you offer solutions for PHP. :) Edit: Response to answers that say simply avoid the programmatic issue: I think there is a place for this kind of filter when, for instance, a user can use public image search to find pictures that get added to a sensitive community pool. If they can search for "penis", then they will likely get many pictures of, yep. If we don't want pictures of that, then preventing the word as a search term is a good gatekeeper, though admittedly not a foolproof method. Getting the list of words in the first place is the real question. So I'm really referring to a way to figure out of a single token is dirty or not and then simply disallow it. I'd not bother preventing a sentiment like the totally hilarious "long necked giraffe" reference. Nothing you can do there. :)

    Read the article

  • iPod touch debugging: Error on install/run only if app exists on device already?

    - by Ben
    Hi all, I am using an iPod to test an app. The device is all set up with the right provisioning profiles, etc-- that's not really the issue. But every time I start the app from Xcode on the device, I get the "A signed resource has been added, modified, or deleted." error from the Organizer window. Wait, I know, you think it's a provisioning profile problem. But here's the kicker: if I just delete the app from the iPod (using the main screen) and try again, it works fine. I only get this error when the app is already installed. The other kicker is that this behavior doesn't happen on an iPhone that I have for occasional testing-- on that device, I can start/restart/restart indefinitely. But using the iPod, my compile-run-test cycle is annoyingly slow since I have to manually delete the app each time. Any ideas? I'm using Xcode 3.2.2 (prerelease) FWIW. The iPod has stock OS 3.1.2 on it. Thanks!

    Read the article

  • How Do I Create Expand All and Collapse All Links Outside of the jQuery Treeview Plugin?

    - by Ben Griswold
    The jQuery Treeview Plugin adds Collapse All, Expand All and Toggle All links to the "treeviewcontrol" div when the control property is defined as follows: $("#black, #gray").treeview({ control: "#treecontrol", persist: "cookie", cookieId: "treeview-black" }); This works great, but I'd like the ability to expand and collapse the treeview from other page elements outside of the treeview itself. I've looked at the source, but I can't figure it out.

    Read the article

  • Crashing the OS X Pasteboard

    - by Ben Packard
    I have an application that reads in text by emulating CMD-C copy commands and reading the pasteboard - unfortunately this the only way to achieve what I need. Occasionally, something goes wrong in execution (not sure yet if it's related to the copy command or not) and the app crashes. Once in a while, this has a knock on effect on the system-wide pasteboard - any other application that is running will crash if I attempt a copy, cut, or paste. Is there a robust way to handle this - something I should be doing with the NSPasteboard before exiting? Any information on what might be happening is appreciated. For completeness, here are the only snippets of code that access the pasteboard: Reading from the pasteboard: NSString *pBoardText = [[NSPasteboard generalPasteboard]stringForType:NSStringPboardType]; Initially clearing the pasteboard (I run this only once, at launch): [[NSPasteboard generalPasteboard] declareTypes: [NSArray arrayWithObject:NSStringPboardType] owner: self]; [[NSPasteboard generalPasteboard] setString: @"" forType: NSStringPboardType];

    Read the article

  • I'm trying to handle the updates on 2 related tables in one DetailsView using Jquery and Linq, and h

    - by Ben Reisner
    Given two related tables (reports, report_fields) where there can be many report_fields entries for each reports entry, I need to allow the user to enter new report_fields, delete existing report_fields, and re-arrange the order. Currently I am using a DetailsView to handle the editing of the reports. I added some logic to handle report_fields, and currently it allows you to succesfully re-arrange the order, but i'm a little stumped as to the best way to add new items, or delete existing items. The basic logic I have is that each report_fields is represented by a . It has a description as the text, and a field for each field in the report_fields table. I use JQuery Sortable to allow the user to re-arrange the LIs. Abbreviated Create Table Statements:(foreign key constraint ignored for brevity) create table report( id integer primary key identity, reportname varchar(250) ) create table report_fields( id integer primary key identity, reportID integer, keyname integer, keyvalue integer, field_order integer ) My abbreviated markup: <asp:DetailsView ...> ... <asp:TemplateField HeaderText="Fields"> <EditItemTemplate> <ul class="MySortable"> <asp:Repeater ID="Repeater1" runat="server" DataSource='<%# Eval("report_fields") %>'> <ItemTemplate> <li> <%# Eval("keyname") %>: <%# Eval("keyvalue") %> <input type="hidden" name="keyname[]" value='<%# Eval("keyname") %>' /> <input type="hidden" name="keyvalue[]" value='<%# Eval("keyvalue") %>' /> </li> </ItemTemplate> </asp:Repeater> </ul> </EditItemTemplate> </asp:TemplateField> </asp:DetailsView> <asp:LinqDataSource ID="LinqDataSource2" onupdating="LinqDataSource2_Updating" table=reports ... /> $(function() { $(".MySortable").sortable({ placeholder: 'MySortable-highlight' }).disableSelection(); }); Code Behind Class: public partial class Administration_AddEditReport protected void LinqDataSource2_Updating(object sender, LinqDataSourceUpdateEventArgs e) { report r = (report)e.NewObject; MyDataContext dc = new MyDataContext(); var fields = from f in dc.report_fields where f.reportID == r.id select f; dc.report_fields.DeleteAllOnSubmit(fields); NameValueCollection nvc = Request.Params; string[] keyname = nvc["keyname[]"].Split(','); string[] keyvalue = nvc["keyvalue[]"].Split(','); for (int i = 0; i < keyname.Length; i++) { report_field rf = new report_field(); rf.reportID = r.id; rf.keyname = keyname[i]; rf.keyvalue = keyvalue[i]; rf.field_order = i; dc.report_fields.InsertOnSubmit(rf); } dc.SubmitChanges(); } }

    Read the article

  • How to store (and use) the current mouse position?

    - by Ben Packard
    What is the best way to store the current mouse position (system-wide) and then (later) put the mouse at that stored point? [NSEvent mouseLocation] gets me the position, and I can move the mouse with a CGEventMouseMoved, but they each use a different co-ordinates system (I believe y=0 is the top for NSEvent and the bottom for a CGEvent). I'm worried about the robustness of capturing the screen height and using it to convert between the two - or is this the best approach?

    Read the article

  • A good way in Visual Studio to have user entered time frame?

    - by Ben
    Hi, Does anyone know of a good way to have a user enter an amount of time (hours and minutes) using visual studio controls? At the moment i have two numeric up downs, one for time and one for minutes that i then parse to create a timespan. The only other idea i have is a text box that a user can enter a "00:00" time in, and validate the input. Both of these ways seem a bit bad (in UI terms) though. Any ideas? Thanks

    Read the article

  • Git pack file entry format

    - by Ben Collins
    My understanding of the Git pack file format is something like: Where the table is 32-bits wide, and the first three 32-bit words are the pack file header. The last row of 32 bits are the first 4 bytes of an entry. As I understand it, the size of the entry is specified by consecutive bytes with the MSB set, followed by compressed data. In the first byte whose MSB is not set, is the MSB part of the compressed data, or is it a gap? If it's part of the compressed data, how can you guarantee that when the data is compressed that bit won't be set?

    Read the article

  • Drawing only part of a texture OpenGL ES iPhone

    - by Ben Reeves
    ..Continued on from my previous question I have a 320*480 RGB565 framebuffer which I wish to draw using OpenGL ES 1.0 on the iPhone. - (void)setupView { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, (int[4]){0, 0, 480, 320}); glEnable(GL_TEXTURE_2D); } // Updates the OpenGL view when the timer fires - (void)drawView { // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context]; //Get the 320*480 buffer const int8_t * frameBuf = [source getNextBuffer]; //Create enough storage for a 512x512 power of 2 texture int8_t lBuf[2*512*512]; memcpy (lBuf, frameBuf, 320*480*2); //Upload the texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, lBuf); //Draw it glDrawTexiOES(0, 0, 1, 480, 320); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; } If I produce the original texture in 512*512 the output is cropped incorrectly but other than that looks fine. However using the require output size of 320*480 everything is distorted and messed up. I'm pretty sure it's the way I'm copying the framebuffer into the new 512*512 buffer. I have tried this routine int8_t lBuf[512][512][2]; const char * frameDataP = frameData; for (int ii = 0; ii < 480; ++ii) { memcpy(lBuf[ii], frameDataP, 320); frameDataP += 320; } Which is better, but the width appears to be stretched and the height is messed up. Any help appreciated.

    Read the article

  • trying to grab data from a page after post via curl

    - by Ben
    i am trying to grab data from here : http://mediaforest.biz/mobile/nowplaying.aspx in the page you select a station and post it then you get new page with data. but i cant grab it, i get the same page again. i used this code: <?php header ('Content-type: text/html; charset=utf-8'); $url = "http://mediaforest.biz/mobile/nowplaying.aspx"; $referer = ""; // headers $header[] = "Host: ".parse_url($url, PHP_URL_HOST); $header[] = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; he; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"; $header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $header[] = "Accept-Language: he,en-us;q=0.7,en;q=0.3"; $header[] = "Accept-Encoding: gzip,deflate"; $header[] = "Accept-Charset: windows-1255,utf-8;q=0.7,*;q=0.7"; $header[] = "Keep-Alive: 115"; $header[] = "Connection: keep-alive"; $cookie="cookie.txt"; $fp=fopen($cookie,"w+"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_REFERER,$referer); curl_setopt($ch, CURLOPT_TIMEOUT, 900); curl_setopt($ch, CURLOPT_FAILONERROR, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HEADER,true); curl_setopt($ch, CURLOPT_COOKIEFILE,$cookie); curl_setopt($ch, CURLOPT_COOKIEJAR,$cookie); curl_setopt($ch, CURLOPT_VERBOSE, 0); $content=curl_exec($ch); echo $content; if(stristr($content,"__EVENTTARGET")){ $array1=explode('__EVENTTARGET" value="',$content); $content1=$array1[1]; $array2=explode('"> <input type="hidden" name="__EVENTARGUMENT"',$content1); $content2=$array2[0]; $EVENTTARGET=urlencode($content2); } if(stristr($content,"__EVENTARGUMENT")){ $array1=explode('__EVENTARGUMENT" value="',$content); $content1=$array1[1]; $array2=explode('"> <script language',$content1); $content2=$array2[0]; $EVENTARGUMENT=urlencode($content2); } if(stristr($content,"formNowPlaying")){ $array1=explode('method="post" action="',$content); $content1=$array1[1]; $array2=explode('"> <input type="hidden" name="__EVENTTARGET"',$content1); $content2=$array2[0]; $nexturl=$content2; } //echo $EVENTTARGET." ".$EVENTARGUMENT." ".$nexturl; $url = "http://mediaforest.biz/mobile/".$nexturl; $fields = "EVENTTARGET=".$EVENTTARGET."&__EVENTARGUMENT=".$EVENTARGUMENT."&MyChannels=0&ViewChannel_Button=Show"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_REFERER,$referer); curl_setopt($ch, CURLOPT_TIMEOUT, 900); curl_setopt($ch, CURLOPT_FAILONERROR, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HEADER,true); curl_setopt($ch, CURLOPT_COOKIEFILE,$cookie); curl_setopt($ch, CURLOPT_COOKIEJAR,$cookie); curl_setopt($ch, CURLOPT_VERBOSE, 1); $content_stage2=curl_exec($ch); echo $content_stage2; ?>

    Read the article

  • Convert Line breaks to html break for all field getters in Symfony project

    - by Ben
    I am working on a Symfony project and I currently have this: <?php echo preg_replace('/\n/','<br />', $review->getComments()); ?> and would very much like to be able to make all getters add html line breaks so i don't have to pepper my code with preg_replace. the $object-getFieldname methods are work automatically so I am looking to extend this somewhere to globally add a new method. What is the best approach here?

    Read the article

  • How to determine cpu, ram needed for rails app?

    - by Ben
    What is the most accurate way to determine the amount of cpu speed and ram needed to run my rails app? I believe there are stress testing tools like Tsung, but how do I determine, for example, that I need X more ram, or X more CPU? I would like to find some way to roughly gauge the performance needs of my application so I can anticipate future needs. I think this data will also be useful for me to decide whether to upgrade one machine, or get another dedicated machine and put all the databases on that one. Essentially, I am concerned about scaling issues, and how to anticipate them. Thanks in advance for the help!

    Read the article

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