Search Results

Search found 2579 results on 104 pages for 'mike peshka'.

Page 73/104 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Using condionals in Linq Programatically

    - by Mike B
    I was just reading a recent question on using conditionals in Linq and it reminded me of an issue I have not been able to resolve. When building Linq to SQL queries programatically how can this be done when the number of conditionals is not known until runtime? For instance in the code below the first clause creates an IQueryable that, if executed, would select all the tasks (called issues) in the database, the 2nd clause will refine that to just issues assigned to one department if one has been selected in a combobox (Which has it's selected item bound to the departmentToShow property). How could I do this using the selectedItems collection instead? IQueryable<Issue> issuesQuery; // Will select all tasks issuesQuery = from i in db.Issues orderby i.IssDueDate, i.IssUrgency select i; // Filters out all other Departments if one is selected if (departmentToShow != "All") { issuesQuery = from i in issuesQuery where i.IssDepartment == departmentToShow select i; }

    Read the article

  • What's causing “Session state has created a session id, but cannot save it because the response was

    - by mike nelson
    I'm getting this fault intermittently. I found this link which summarises fairly well what I was able to find on the Google: http://www.wacdesigns.com/2009/02/03/session-state-has-created-a-session-id-but-cannot-save-it-because-the-response-was-already-flushed-by-the-application/ Basically it says you can try setting the web config setting DisplayWhenNewSession, or try kicking the session state thing into life by getting the Session.SessionID in the Session_OnStart. But does anyone: a) have an explanation for this or even better, b) have a tried and tested fix I realise that I can't flush the response after doing anything that would affect the http response header. If I did this it would cause an error every time but this is intermittent. The SessionID should surely be created by ASP.NET at the beginning of the page response automatically, before anything in the ASPX page or the Page_Load (which is where all my flushes are called).

    Read the article

  • Is there a Netbeans equivalent to Eclipse's Workspace

    - by Mike Cornell
    I enjoy using Netbeans, especially for development with Maven, however, I've found recently that I've been working with three different branches of the same code base in different parts of the development cycle. One of the things that Eclipse can do, is separate the projects into different workspaces, so i can simply start Eclipse with the workspace containing my Maven projects in the production patch branch or the trunk depending upon what I need to be working on. I'd love to accomplish this in Netbeans, but haven't found a way to do so. Any ideas?

    Read the article

  • How do I define nmake macro from command line output?

    - by Mike Atlas
    I'd like to capture the output from a tool from the command line into an nmake macro. If this were a normal command line script, it would look like this: > MyTool.exe > output.txt > set /P MyVariable=<output.txt > echo %MyVariable% However, I can't seem to find anything relevant in the nmake doc on macros that is relevant. This is basically what I'd like to do, though: target: @call MyTool.exe > output.txt # This doesn't work in .mak, unfortunately. Help! @MyVariable=<output.txt

    Read the article

  • Determine caller within stored proc or trigger

    - by Mike Clark
    I am working with an insert trigger within a Sybase database. I know I can access the @@nestlevel to determine whether I am being called directly or as a result of another trigger or procedure. Is there any way to determine, when the nesting level is deeper than 1, who performed the action causing the trigger to fire? For example, was the table inserted to directly, was it inserted into by another trigger and if so, which one.

    Read the article

  • WCF data services - Limiting related objects returned based on critera

    - by Mike Morley
    I have an object graph consisting of a base employee object, and a set of related message objects. I am able to return the employee objects based on search criteria on the employee properties (eg team) etc. However, if I expand on the messages, I get the full collection of messages back. I would like to be able to either take the top n messages (i.e. restrict to 10 most recent) or ideally use a date range on the message objects to limit how many are brought back. So far I have not been able to figure out a way of doing this: I get an error if I attempt to filter on properties on the message (&$filter=employee/message/StartDate gives an error "No property 'StartDate' exists in type 'System.Data.Objects.DataClasses.EntityCollection`1). Attempting to use Top on the message related object doesn't work either. I have also tried using a WebGet extension that takes a string list of employee IDs. That works until the list gets too long, and then fails due to the URL getting too long (it might be possible to setup a paging mechanism on this approach)... Unfortunately the UI control I am using requires the data to be in a fairly specific hierarchical shape, so I can't easily come at this from starting on the message side and working backwards. Outside of making multiple calls does anyone know of a method to accomplish this with wcf data services? Thanks! M.

    Read the article

  • Extend MySQL implementation of PiP Algorithm?

    - by Mike
    I need to make a point in polygon MySQL query. I already found these two great solutions: http://forums.mysql.com/read.php?23,286574,286574 MySQL implementation of ray-casting Algorithm? But these functions can only check if one point is inside a poly. I have a query where the PiP part should only be one part of the query and check for x points inside a polygon. Something like this: $points = list/array/whatever of points in language of favour SELECT d.name FROM data AS d WHERE d.name LIKE %red% // just bla bla // how to do this ? AND $points INSIDE d.polygon AND myWithin( $points, d.polygo ) // or UPDATE I tried it with MBR functions like this: SET @g1 = GeomFromText('Polygon((13.43971 52.55757,13.41293 52.49825,13.53378 52.49574, 13.43971 52.55757))'); SET @g2 = GeomFromText('Point(13.497834 52.540489)'); SELECT MBRContains(@g1,@g2); G2 should NOT be inside G1 but MBR says it is.

    Read the article

  • Fault exception trashes a register causing a crash in [NSInvocation invoke]

    - by Mike Weller
    I have an NSOperation which fetches some objects from a core data persistent store and sums up a few totals. Sometimes an object is deleted while the operation in in progress, so a core data fault exception occurs. I try/catch the exception while summing to ignore it because I just want to skip objects that cannot be faulted in. However, when one of these fault exceptions occurs (and I swallow it) there is a crash after the invocation returns in [NSInvocation invoke]. It's a bad memory access when dereferencing the value in r10 which according to GDB on a successful run points to one of these: (gdb) x 0x38388348 0x38388348 <OBJC_IVAR_$_NSInvocation._retdata>: 0x00000008 If a fault exception occured a value of 0x02 is in the register which causes the crash. A quick google search tells me that r10 should be saved by the callee, meaning it is not being restored by whatever code is changing it when this exception occurs. Can anybody explain this? I'm not an expert when it comes to these kinds of low-level details

    Read the article

  • How can I kill off a Python web app on GAE early following a redirect?

    - by Mike Hayes
    Hi Disclaimer: completely new to Python from a PHP background Ok I'm using Python on Google App Engine with Google's webapp framework. I have a function which I import as it contains things which need to be processed on each page. def some_function(self): if data['user'].new_user and not self.request.path == '/main/new': self.redirect('/main/new') This works fine when I call it, but how can I make sure the app is killed off after the redirection. I don't want anything else processing. For example I will do this: class Dashboard(webapp.RequestHandler): def get(self): some_function(self) #Continue with normal code here self.response.out.write('Some output here') I want to make sure that once the redirection is made in some_function() (which works fine), that no processing is done in the get() function following the redirection, nor is the "Some output here" outputted. What should I be looking at to make this all work properly? I can't just exit the script because the webapp framework needs to run. I realise that more than likely I'm just doing things in completely the wrong way any way for a Python app, so any guidance would be a great help. Hopefully I have explained myself properly and someone will be able to point me in the right direction. Thanks

    Read the article

  • javascript and css loadings

    - by Mike
    I was wondering, If I have, let's say 6 javascripts includes on a page and 4-5 css includes as well on the same page, does it actually makes it optimal for the page to load if I do create one file or perhaps two and append them all together instead of having bunch of them?

    Read the article

  • In C# is there a function that correlates sequential values on a IEnumerable

    - by Mike Q
    Hi all, I have a IEnumerable. I have a custom Interval class which just has two DateTimes inside it. I want to convert the IEnumerable to IEnumerable where n DateTimes would enumerate to n-1 Intervals. So if I had 1st Jan, 1st Feb and 1st Mar as the DateTime then I want two intervals out, 1st Jan/1st Feb and 1st Feb/1st March. Is there an existing C# Linq function that does this. Something like the below Correlate... IEnumerable<Interval> intervals = dttms.Correlate<DateTime, Interval>((dttm1, dttm2) => new Interval(dttm1, dttm2)); If not I'll just roll my own.

    Read the article

  • asp.net app slow and not rendering but .txt file works fine?

    - by mike
    i have a load balanced set of 2 servers running a .net application that is loading slow and not at all to the point the load balancer is redirecting me and my users to our dr server. i added a hard coded file to both servers to tell what server is working and not. both pull the txt file and display its contents in no time. however the asp.net pages dont render. the DB is not sweating and even a plain .aspx page doesnt come up. any thoughts on trouble shooting this?

    Read the article

  • Perl daemon script for message queue hanging for 20 seconds after each process. Why?

    - by Mike Diena
    I have daemon script written in Perl that checks a database tables for rows, pulls them in one by one, sends the contents via HTTP post to another service, then logs the result and repeats (only a single child). When there are rows present, the first one is posted and logged immediately, but every subsequent one is delayed for around 20 seconds. There are no sleep()'s running, and I can't find any other obvious delays. Any ideas?

    Read the article

  • Why is the main method not covered?

    - by Mike.Huang
    main method: public static void main(String[] args) throws Exception { if (args.length != EXPECTED_NUMBER_OF_ARGUMENTS) { System.err.println("Usage - java XFRCompiler ConfigXML PackageXML XFR"); } String configXML = args[0]; String packageXML = args[1]; String xfr = args[2]; AutoConfigCompiler compiler = new AutoConfigCompiler(); compiler.setConfigDocument(loadDocument(configXML)); compiler.setPackageInfoDoc(loadDocument(packageXML)); // compiler.setVisiblityDoc(loadDocument("VisibilityFilter.xml")); compiler.compileModel(xfr); } private static Document loadDocument(String fileName) throws Exception { TXDOMParser parser = (TXDOMParser) ParserFactory.makeParser(TXDOMParser.class.getName()); InputSource source = new InputSource(new FileInputStream(fileName)); parser.parse(source); return parser.getDocument(); } testcase: @Test public void testCompileModel() throws Exception { // construct parameters URL configFile = Thread.currentThread().getContextClassLoader().getResource("Ford_2008_Mustang_Config.xml"); URL packageFile = Thread.currentThread().getContextClassLoader().getResource("Ford_2008_Mustang_Package.xml"); File tmpFile = new File("Ford_2008_Mustang_tmp.xfr"); if(!tmpFile.exists()) { tmpFile.createNewFile(); } String[] args = new String[]{configFile.getPath(),packageFile.getPath(),tmpFile.getPath()}; try { // test main method XFRCompiler.main(args); } catch (Exception e) { assertTrue(true); } try { // test args length is less than 3 XFRCompiler.main(new String[]{"",""}); } catch (Exception e) { assertTrue(true); } tmpFile.delete(); } Coverage outputs displayed as the lines from String configXML = args[0]; in main method are not covered.

    Read the article

  • Multihomed Windows server and DNS resolution

    - by Mike K.
    I have a Windows 2008 server with two IP addresses assigned to a single NIC. The DNS settings are setup to register the connections's addresses on the DNS server. nslookup shows both IP addresses for the server name. How is name resolution done in this case, i.e. which IP address does the DNS server return for a host lookup? Or does it return both, and the client selects one of the addresses?

    Read the article

  • Perl, convert hash to array

    - by Mike
    If I have a hash in Perl that contains complete and sequential integer mappings (ie, all keys from from 0 to n are mapped to something), is there a means of converting this to an Array? I know I could iterate over the key/value pairs and place them into a new array, but something tells me there should be a built-in means of doing this.

    Read the article

  • Drupal 6 devel module dd() function not writing to drupal_debug.txt file

    - by Mike Munroe
    I am running a local development Drupal site on a Windows machine. I am trying to use the dd($data, $label = NULL) function from the devel module to help debug. Using this function, should write debug info to a drupal_debug.txt file in the /tmp folder on the machine where the Drupal site is hosted. On my Windows machine, although I am using this function, the drupal_debug.txt file is not getting created anywhere, leading me to believe I am using the function incorrectly. Here is a snippet of how I am using it, <?php $test = "this is my test"; dd($test, $label = NULL); I am looking for an example of the correct syntax for the dd($data, $label = NULL) function. I have the Devel module enabled.

    Read the article

  • Using client time to calculate timezone

    - by Mike TK
    Hi Folks, Instead of asking a client timezone in registration form (to correctly format datetime, all server dates in UTC) I thought about fetching a time from client computer and calculating time offset between client and server. Anyone tried this? How often clients have something insane on their system clocks? Cheers!

    Read the article

  • How to print lines from a file that have repeated more than six times

    - by Mike
    I have a file containing the data shown below. The first comma-delimited field may be repeated any number of times, and I want to print only the lines after the sixth repetition of any value of this field For example, there are eight fields with 1111111 as the first field, and I want to print only the seventh and eighth of these records Input file: 1111111,aaaaaaaa,14 1111111,bbbbbbbb,14 1111111,cccccccc,14 1111111,dddddddd,14 1111111,eeeeeeee,14 1111111,ffffffff,14 1111111,gggggggg,14 1111111,hhhhhhhh,14 2222222,aaaaaaaa,14 2222222,bbbbbbbb,14 2222222,cccccccc,14 2222222,dddddddd,14 2222222,eeeeeeee,14 2222222,ffffffff,14 2222222,gggggggg,14 3333333,aaaaaaaa,14 3333333,bbbbbbbb,14 3333333,cccccccc,14 3333333,dddddddd,14 3333333,eeeeeeee,14 3333333,ffffffff,14 3333333,gggggggg,14 3333333,hhhhhhhh,14 Output: 1111111,gggggggg,14 1111111,hhhhhhhh,14 2222222,gggggggg,14 3333333,gggggggg,14 3333333,hhhhhhhh,14 What I have tried is to transponse the 2nd and 3rd fields with respect to 1st, so that I can use nawk on the field of $7 or $8 #!/usr/bin/ksh awk -F"," '{ a[$1]; b[$1]=b[$1]","$2 c[$1]=c[$1]","$3} END{ for(i in a){ print i","b[i]","c[i]} } ' file > output.txt

    Read the article

  • Function calculating the probability of a letter in an sentence

    - by Mike
    I have a function that is supposed to calculate the number of times a letter occurs in a sentence, and based on that, calculate the probability of it occurring in the sentence. To accomplish this, I have a sentence: The Washington Metropolitan Area is the most educated and affluent metropolitan area in the United States. An array of structures, containing the letter, the number of times it occurs, and the probability of it occurring, with one structure for each letter character and an additional structure for punctuation and spaces: struct letters { char letter; int occur; double prob; }box[53]; This is the function itself: void probability(letters box[53], int sum { cout<<sum<<endl<<endl; for(int c8=0;c8<26;c8++) { box[c8].prob = (box[c8].occur/sum); cout<<box[c8].letter<<endl; cout<<box[c8].occur<<endl; cout<<box[c8].prob<<endl<<endl; } } It correctly identifies that there are 90 letters in the sentence in the first line, prints out the uppercase letter as per the structure in the second line of the for loop, and prints out the number of times it occurs. It continually prints 0 for the probability. What am I doing wrong?

    Read the article

  • Does ASP.NET Make Request Scheduling Decisions Based Upon SessionID?

    - by Mike Murphy
    I know that a properly implemented SessionStateStoreProvider maintains an exclusive lock on session data for the duration of a request. However, considering that multiple requests could arrive simultaneously (e.g. via IFRAMEs) all but one would be able to make forward progress. All the other requests would block for a bit and reduce the number of worker threads available during that time. It seems if ASP.NET "peeked" at the session IDs on the requests early on, it could avoid running requests simultaneously that were on the same session. This would improve throughput under load for pages that didn't want to give up using IFRAMEs. This seems plausible enough that it might be true.

    Read the article

  • Setting time to 23:59:59

    - by Mike Wills
    I need to compare a date range and am missing rows who's date is the upper comparison date but the time is higher than midnight. Is there a way to set the upper comparison's time to 23:59:59?

    Read the article

  • SimpleXMLElement empty object

    - by Mike
    Hi, I am trying to parse an xml file using XmlReader but although I am getting a return from the xml file for the (commission) node for some reason I am getting an empty SimpleXMLElement Object returned as well. I don't know if its something to do with while loop,switch or something I missed in the parse setup. This is the xml file I am trying to read from, as you can see there is only 1 result returned: <?xml version="1.0" encoding="UTF-8"?> <cj-api> <commissions total-matched="1"> <commission> <action-status> new </action-status> <action-type> lead </action-type> <aid> 10730981 </aid> <commission-id> 1021015513 </commission-id> <country> </country> <event-date> 2010-05-08T08:08:55-0700 </event-date> <locking-date> 2010-06-10 </locking-date> <order-id> 345007 </order-id> <original> true </original> <original-action-id> 787692438 </original-action-id> <posting-date> 2010-05-08T10:01:22-0700 </posting-date> <website-id> 3201921 </website-id> <cid> 2815954 </cid> <advertiser-name> SPS EurosportBET </advertiser-name> <commission-amount> 0 </commission-amount> <order-discount> 0 </order-discount> <sid> 0 </sid> <sale-amount> 0 </sale-amount> </commission> </commissions> </cj-api> This is my parser: <?php // read $response (xml feed) $file = "datafeed.xml"; $xml = new XMLReader; $xml->open($file); // loop to read in data while ($xml->read()) { switch ($xml->name) { // find the parent node for each commission payment case 'commission': // initalise xml parser $dom = new DomDocument(); $dom_node = $xml ->expand(); $element = $dom->appendChild($dom_node); $dom_string = $dom->saveXML($element); $commission = new SimpleXMLElement($dom_string); // read in data $action_status = $commission->{'action-status'}; $action_type = $commission->{'action-type'}; $aid = $commission->{'aid'}; $commission_id = $commission->{'commission-id'}; $country = $commission->{'country'}; $event_date = $commission->{'event-date'}; $locking_date = $commission->{'locking-date'}; $order_id = $commission->{'order-id'}; $original = $commission->{'original'}; $original_action_id = $commission->{'original_action-id'}; $posting_date = $commission->{'posting-date'}; $website_id = $commission->{'website-id'}; $cid = $commission->{'cid'}; $advertiser_name = $commission->{'advertiser-name'}; $commission_amount = $commission->{'commission-amount'}; $order_discount = $commission->{'order-discount'}; $sid = $commission->{'sid'}; $sale_amount = $commission->{'sale-amount'}; print_r($aid); break; } } ?> The result is : SimpleXMLElement Object ( [0] => 10730981 ) SimpleXMLElement Object ( ) Why is it returning the second object: SimpleXMLElement Object ( ) and what do I need to do correct it? Thanks.

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >