Search Results

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

Page 84/104 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • Processing large (over 1 Gig) files in PHP using stream_filter_*

    - by mike
    $fp_src=fopen('file','r'); $filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8'); while(fread($fp_src,4096)){ ++$count; if($count%1000==0) print ftell($fp_src)."\n"; } When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file. Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB. What gives?

    Read the article

  • cocoa - I've discovered what I think is a bug with double numbers...

    - by Mike
    Here is a simple code that shows what I think is a bug when dealing with double numbers... double wtf = 36.76662445068359375000; id xxx = [NSDecimalNumber numberWithDouble: wtf]; NSString *myBug = [xxx stringValue]; NSLog(@"%.20f", wtf); NSLog(@"%@", myBug); NSLog(@"-------\n"); the terminal will show two different numbers 36.76662445068359375000 and 36.76662445068359168 Is this a bug or am I missing something? if the second number is being rounded, it is a very strange rounding btw...

    Read the article

  • can't edit my h:datatable

    - by Mike
    hi! i have this code: <h:form> <rich:dataTable value="#{my.lreqs}" var="req" id="reqs" width="630px" > <rich:column label="Value" styleClass="schColL" width="90px" style="text-align:center"> <f:facet name="header"> <h:outputText value="#{my.colValue}" /> </f:facet> <h:inputText value="#{req.value}" > </h:inputText> </rich:column> </rich:dataTable> <h:commandButton value="Save" action="#{my.saveChanges}" ></h:commandButton> </h:form> and this is my bean: private List<Detail> lreqs; public List<Detail> getLreqs() { return lreqs; } public void setLreqs(List<Detail> lreqs) { this.lreqs = lreqs; } public void saveChanges() { firstNewValue = lreqs.get(0).getValue(); } but when i click save - a new value in req.value field is not being saved! why is it?

    Read the article

  • jQuery slide vertical images

    - by Mike
    Hello, I hope someone can help me with the following problem. I have a vertical scrollbar on my website which shows 5 images and will scroll 5 images further or back, depeding on where you clicked. The jQuery code looks like this. $(".productSlide .scrollable").scrollable(); $(".productSlide .scrollable").scrollable({ vertical: true, mousewheel: true }); I am new to jQuery and what I can achieve ist the following <div class="scrollBlock"> <?php for($i=0; $i<5; $i++) include 'example1.php'; ?> </div> <div class="scrollBlock"> <?php for($i=0; $i<5; $i++) include ' example1.php'; ?> </div> <div class="scrollBlock"> <?php for($i=0; $i<5; $i++) include ' example1.php'; ?> </div> In example1.php there is an image which will be showed 5 times. And everytime you click you’ll see the same div again with the same 5 pics. I can’t figure this one out without the "scrollBlock" div. How can I use more pictures in just one block – and it’s still scrolling 5 images? Thanks so much!

    Read the article

  • Can you please explain onCreate and Bundles?

    - by Mike
    I have been looking it up and I just cant seem to wrap myself around the onCreate and Bundles. I understand that the onCreate is called when the program starts but its how the Bundles get passed around and how they are pertinent. Can anyone try to put this into plain english because I cant seem to find it well described. Thanks

    Read the article

  • PHP/MySQL - an array filter for bots

    - by Mike
    Hello, I'm making a hit counter. I have a database and I store the IP and $_SERVER['HTTP_USER_AGENT']; of the visitors. Now I need to add a filter, so I can put away the hits, that are made by bots. I found out, that many bots usually keep some common words in the $_SERVER['HTTP_USER_AGENT']; , so I's like to make and array of words, that would keep the bot from displaying in the results. Here is what I have now: while($row = mysql_fetch_array($yesterday, MYSQL_ASSOC)) { <-- Here I need a code, that would run through an array and check, if it containts the keywords and if it doesn't ... just count++; -- } Also if you know any other way of detecting and removing the bots from the results, I'd be verry thankful. Cheers

    Read the article

  • How do I get the key of an item when doing a FOR loop through a dictionary or list in Python?

    - by Mike Hayes
    Hi I am new to Python. Say I have a list: list = ['A','B','C','D'] The key for each item respectively here is 0,1,2,3 - right? Now I am going to loop through it with a for loop... for item in list: print item That's great, I can print out my list. How do I get the key here? For example being able to do: print key print item on each loop? If this isn't possible with a list, where keys are not declared myself, is it possible with a Dictionary? Thanks

    Read the article

  • Using Mod_Rewrite in HTTPD.CONF file

    - by Mike Lovely
    I want to rewrite URLs so when a user goes to; http://www.example.com/applications/newWeb/www/index.php?page=48&thiscontent=2660&date=2013-10-11&pubType=0&PublishTime=09:30:00&from=home&tabOption=1 and if the URL contains thiscontent=2660 (which in this example above, it does) I want to redirect them to; http://www.example.come/index.php/publications/finance-and-economics/departmental-resources I have about 30 different thiscontent=XXXX types and imagine I’ll have to copy and edit this rule 30 different times for any links to my old website still knocking around out there. I have access to my httpd.conf file but have never done a mod_rewrite before. I also don't really need these showing up in the error logs as 301s. Will that happen? Because at the moment there are hundreds!

    Read the article

  • Looping in filemaker using a local variable

    - by Mike Davis
    Been programming in C# for a little bit - trying to use file maker and I cant believe it but I cant even get a simple for loop to work. What I want to do is simple: loop through for the amount of entries in my "amountOfRooms" field and create an entry in a table for each room. Sounds so simple, but I cant get it to work. Right now I have this: Set Variable[$cnt[Customers::AmountOfRooms]; value:1] Go to Layout["rooms"(Rooms)] Loop Exit Loop If[$cnt = Customers::AmountOfRooms] New Record / Request Set Variable[$cnt; Value: $cnt + 1] End Loop Exit Script No new records are created. I know the script is running because it does go to my layout, but doesnt create any new records. There is a "Repetition" field for my local variable - not sure how to use that or what it means? Any thoughts on how to do this simple loop? Thanks.

    Read the article

  • Inter-project dependencies

    - by Mike Hordecki
    Hello! I'm doing some Delphi (2010) work this summer, and I've stumbled upon this problem: My project consists of reusable backend library and a bunch of GUIs that tap into its interface. In this circumstances I've decided to make the backend and GUIs separate projects within single project group (I hope my train of thought is correct). The problem is, how can I include units from the backend in a GUI project? I've tried to modify Project Options > Directories and Conditionals but compiler still complains about being unable to find proper .dcu's. Any ideas? Your help will be appreciated.

    Read the article

  • Problem monitoring directory for file activity in VB.net 2010...

    - by Mike Cialowicz
    I'm trying to write a simple program to monitor a folder for new files in VB.NET 2010, and am having some trouble. Here's a simplified version of what my program looks like: Imports System.IO Public Class Main Public fileWatcher As FileSystemWatcher Sub btnGo_Click(sender As System.Object, e As System.EventArgs) Handles btnGo.Click '//# initialize my FileSystemWatcher to monitor a particular directory for new files fileWatcher = New FileSystemWatcher() fileWatcher.Path = thisIsAValidPath.ToString() fileWatcher.NotifyFilter = NotifyFilters.FileName AddHandler fileWatcher.Created, AddressOf fileCreated fileWatcher.EnableRaisingEvents = True End Sub Private Sub fileCreated(sender As Object, e As FileSystemEventArgs) '//# program does not exit when I comment the line below out txtLatestAddedFilePath.Text = e.FullPath '//# e.FullPath is valid when I set a breakpoint here, but when I step into the next line, the program abruptly halts with no error code that I can see End Sub End Class As you can see, I have a button which will initialize a FileSystemWatcher when clicked. The initialization works, and when I place a new file in the monitored directory, the program reaches the fileCreated sub. I can even see that e.FullPath is set correctly. However, it exits abruptly right after that with no error code (none that I can see, anyways). If I comment everything in the fileCreated sub out, the program continues running as expected. Any ideas as to why it's dying on me? Any help would be greatly appreciated. I'm fairly new to VS/VB.NET, so maybe I'm just making a silly mistake. Thanks!

    Read the article

  • How can I assign a DBNull in a better way?

    - by Mike
    Hi, I need to parse value from a datarow and assign it to another datarow.If the input is valid, then I need to parse it to double or else add a dbnull value to the output.I'm doing the following, is there a better way to do it? public double? GetVolume(object data) { string colValue = data == null ? string.Empty : data.ToString(); double volume; if (!Double.TryParse(colValue.ToString(), out volume)) { return null; } return volume; } public void Assign(DataRow theRowInput,DataRow theRowOutput) { double? volume = GetVolume(theRowInput[0]); if(volumne.HasValue) theRowOutput[0] = volume.value; else theRowOutput[0] = DbNull.Value; return theRowOutput; } Thanks, -M

    Read the article

  • C# background worker and timer loop

    - by Mike
    This is my first attempt of a Timer, if someone could help me out where I am going wrong it would be awesome. I'm trying to use a while loop where if the timer hits 30 seconds try to loop it again. private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { System.Windows.Forms.Timer my_timer = new System.Windows.Forms.Timer(); my_timer = null; //int restartticker = 30000; while (true) { my_timer.Start(); if (my_timer.Equals(30000)) { watcherprocess1(); } my_timer = null; } } Object reference not set to an instance of an object. my_timer.Start();

    Read the article

  • Basic CSS question regarding background images for divs

    - by Mike
    I'm a programmer trying to learn some css and I've already run into a stumbling block. I have the following HTML: <div class="container"> <div class="span-24 last"> Header </div> <div class="span-4"> Left sidebar </div> <div class="span-16"> <div class="span-8"> Box1 </div> <div class="span-4"> Box2 </div> <div class="span-4 last"> Box3 </div> <div class="span-16 last"> Main content </div> </div> <div class="span-4 last"> Right sidebar </div> <div class="span-24 last"> Footer </div> </div> In my css I have the following: body { background-color:#FFFFFF; } div.container { background:url(/images/bck.jpg); } I just want to display an image for the background area for the container div but nothing shows up. If I remove the background section from the css and add background-color:#000000; then I see a black background for the container div. What am I overlooking?

    Read the article

  • strstr and occurrences to match

    - by Mike
    I have several possible occurrences to test with strstr. if ((a = strstr(string, "FOO")) != NULL || (a = strstr(string, "BAR")) != NULL || (a = strstr(string, "FOO2")) != NULL ||(a = strstr(string, "BAR2")) != NULL || (a = strstr(string, "FOO3")) != NULL ||(a = strstr(string, "BAR3")) != NULL) // do something and then based on the occurrence found I need to do var = strlen("THE_ONE_MATCHED_ABOVE"); What would be a good way to do this without using lots of if statements?

    Read the article

  • How do I identify where the POST data sent to a PHP script came from?

    - by Mike Turley
    I have a ton of data collection forms on my website, and I wrote a PHP script to handle all the data. All the forms have that one script as their action, and POST as the method. The handler emails a copy of the data to me, and I'd like for the emails I get to contain the URL of the form where they originated. Is there any way in PHP to get the url of the form which was submitted to the script? Or do I have to add an extra hidden field in every form with its URL?

    Read the article

  • Creating a assertClass() method in JUnit

    - by Mike
    Hi, I'm creating a test platform for a protocol project based on Apache MINA. In MINA when you receive packets the messageReceived() method gets an Object. Ideally I'd like to use a JUnit method assertClass(), however it doesn't exist. I'm playing around trying to work out what is the closest I can get. I'm trying to find something similar to instanceof. Currently I have: public void assertClass(String msg, Class expected, Object given) { if(!expected.isInstance(given)) Assert.fail(msg); } To call this: assertClass("Packet type is correct", SomePacket.class, receivedPacket); This works without issue, however in experimenting and playing with this my interest was peaked by the instanceof operator. if (receivedPacket instanceof SomePacket) { .. } How is instanceof able to use SomePacket to reference the object at hand? It's not an instance of an object, its not a class, what is it?! Once establishing what type SomePacket is at that point is it possible to extend my assertClass() to not have to include the SomePacket.class argument, instead favouring SomePacket?

    Read the article

  • Perl, redirect stdout to file

    - by Mike
    I'm looking for an example of redirecting stdout to a file using Perl. I'm doing a fairly straightforward fork/exec tool, and I want to redirect the child's output to a file instead of the parents stdout. Is there an equivilant of dup2() I should use? I can't seem to find it

    Read the article

  • Pass off execution to different/specific thread in Java

    - by Mike
    I have about 4 threads. One thread keeps checking some data that the other thread is updating. The others are doing some processing in the background. All have been started at this point. My question is when the checking thread sees that the data has not been updated yet I currently sleep for a little bit but is there any way for me to tell the system to back to executing the thread that does the updating? That or is there any way I can put something like a listener on the data(a String) and once its updated an event will fire that will do what it needs to do? I tried using yield() and it seemed to just keep returning to the thread I called yield() from. Thanks

    Read the article

  • Java API Method Run Times

    - by Mike
    Is there a good resource to get run times for standard API functions? It's somewhat confusing when trying to optimize your program. I know Java isn't made to be particularly speedy but I can't seem to find much info on this at all. Example Problem: If I am looking for a certain token in a file is it faster to scan each line using string.contains(...) or to bring in say 100 or so lines putting them to a local string them performing contains on that chunk.

    Read the article

  • Need help with map (c++, STL)

    - by Mike Dooley
    Hi folks! Actually I'm new to C++. I tried something out (actually the map container) but it doesn't work the way I assumed it will... Before posting my code, I will explain it shortly. I created 3 classes: ClassA ClassDerivedA ClassAnotherDerivedA The two last ones are derived from "ClassA". Further I created a map: map<string,ClassA> test_map; I put some objects (from Type ClassDerivedA and ClassAnotherDerivedA) into the map. Keep in mind: the mapped value is from type "ClassA". This will only work because of Polymorphism. Finally I created an iterator which runs over my map and compares the user input with my keys in the map. If they match, it will call a specific method called "printOutput". And there is the Problem: Although i declared "printOutput" as "virtual" the only method called is the one from my base class, but why? and here is the code: #include <iostream> #include <map> using namespace std; class ClassA { public: virtual void printOutput() { cout << "ClassA" << endl; } }; class ClassDerivedA : public ClassA { public: void printOutput() { cout << "ClassDerivedA" << endl; } }; class ClassAnotherDerivedA: public ClassA { public: void printOutput() { cout << "ClassAnotherDerivedA" << endl; } }; int main() { ClassDerivedA class_derived_a; ClassAnotherDerivedA class_another_a; map<string,ClassA> test_map; test_map.insert(pair<string,ClassA>("deriveda", class_derived_a)); test_map.insert(pair<string,ClassA>("anothera", class_another_a)); string s; while( cin >> s ) { if( s != "quit" ) { map<string,ClassA>::iterator it = test_map.find(s); if(it != test_map.end()) it->second.printOutput(); } else break; } } Blockquote

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >