Hi,
have can i speed up the loading of images - specialy when i open the website for the first time it takes some time for images to load...
Is there anything i can do to improve this (html, css)?
link
I decided to check out Resource Monitor (on the 'Performance' tab in Task Manager, Windows 7) and I noticed in the "Network" section that the 'System' image name kept making a bunch (~5 at a time) of connections to random IP addresses, it would show anywhere from 1-500 bytes/sec 'sent'. They would stay connected for 1-2 minutes.
-All web browsers are closed
So, first thing I did was run a trace from network-tools.com on some of these IP addresses. 8/10 were outside of US and did not resolve to any host name. Of the 10 IP addresses I traced, 2 were in US, 4 showed origins in China, and one each to Algeria, Russia, Pakistan, Korea. (!)
So, the next thing I did was turn off my wireless card, watch the connections disappear, then turn the card back on, and within 30 seconds more random connections were created by System, with different IP addresses from the first time.
The next thing I did was go open Task Manager, Show Processes From All Users, then I killed just about everything that wasn't (what appeared to be) a windows process.
Turned on wi-fi, and again within 30 seconds, random IP addresses connect for ~ 1 min at a time, new ones coming and going.
I occasionally use bit torrent on this machine, but there was definitely no process that seemed related to bt running after I went through task manager, and bt wasn't open to begin with.
So, any ideas on what these connections might be for?
I have been using Ad-Aware Free and AVG Free on this computer for a while now, always up to date..
I have a DB schema composed of MYISAM tables, i am interested to delete old records from time to time from some of the tables.
I know that delete does not reclaim the memory space, but as i found in a description of DELETE command, inserts may reuse the space deleted
In MyISAM tables, deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions.
I am interested if LOAD DATA command also reuses the deleted space?
UPDATE
I am also interested how the index space reclaimed?
Every so often, I log on and get the Following Message:
User profile was not loaded correctly. You have been logged on with a temporary profile.
Changes you make to this profile will be lost when you log off. Please see
the event log for details or contact your administrator
This almost always happens when somebody else has been on the computer for a while, and then I log on. This never used to happen, but now it happens pretty often.
My profile is not permanently corrupted, all I have to do is restart my computer, but this annoys me, and I would like to fix it.
I was curios about the reason of this cause, so I looked into the Event Log, and found the root of the problem was the ntuser.dat file in the profile that I was logging on to was locked at logon time. This resulted in the current users registry not being loaded, resulting in failure to load the profile.
I just found a microsoft article that mentions this exact issue: http://support.microsoft.com/kb/960464/
The problem is that I do not want to delete this profile; and this issue does not come up every time that I log on, only when somebody else has been on a long time before me.
What could be locking this file? Is there any way to get a process list without logging on so that I can identify which process has the file locked? Any other suggestions?
Is there any plugings or text editor to auto-complete SQL statement? I am using SQL Server Management Studio (ssms) 90% of time, but most of time I have to type SELECT FROM WITH(NOLOCK) WHERE blahblah. Trying to find a more efficient way. Thanks.
What would be the best database design for employee clocking and out? Right now I have two tables.
Employee Base Table: Employee Id, relevant information like name and address, clocked in column
Employee Clocked in Table: Employee id, clock in date, Clock in Time, Clocked Out Time.
Is this a good way to track clocked in and clocked out? I appreciate any help
Hey all,
Apologies if this post feels like its been covered elsewhere, but I don't think it has.
I've been down a winding web hosting road. To date, I've tried: Joyent, Media Temple, Bluehost, Hostgator, and finally Linode. The reason for switching are likely obvious to everyone: speed. With the exception of the lightening fast Linode, all of the shared hosts are absolutely sloooow.
What do do when you're not really a "developer"
While I'v grown addicted to the speed of Linode, I really don't feel like its where I should be. I have this nagging feeling in the back of my mind that one of these days (likely soon), I'm going to run into something that i won't be able to figure out and i'll have days worth of downtime. Just the other day, for example, I realized that one of my domains wasn't sending emails. After 4(!) hours looking into the problem, I still can't get sendmail or postfix to work. Four hours!!
I want to be a Drupal expert, not a Ubuntu expert
That's really the heart of my problem: I spend way too much time learning Ubuntu's ins-and-outs, and not nearly enough time working on Drupal.
So here goes: Is there a web host out there anywhere that offers the speed of Linode, but will let me focus on Drupal instead of sys-admin-ing?
Thanks!
[ I know, I know. There are going to be lots of people who read this saying - "just learn Ubuntu like a real developer". And I get that. I do. But when I work full-time and try and develop some of these sites in my evenings and weekends, I'm really feeling like the sys-admin stuff gets in the way.
Contents of check.py:
from multiprocessing import Process
import time
import sys
def slp():
time.sleep(30)
f=open("yeah.txt","w")
f.close()
if __name__=="__main__" :
x=Process(target=slp)
x.start()
sys.exit()
In windows 7, from cmd, if I call python check.py, it doesn't immediately exit, but instead waits for 30 seconds. And if I kill cmd, the child dies too- no "yeah.txt" is created.
How do I make ensure the child continues to run even if parent is killed and also that the parent doesn't wait for child process to end?
"This website is temporarily unavailable. Please check back later.
Unfortunately there were no suitable nodes available to serve this request."
When I request a stored procedure from my program (SP is taking 2 minutes to execute) the above error is getting.
I believe this is because of Load balancer Time out. How we can increment the load balancer time out.
This seems like a lot of work; to check for null each time an object is used.
I have been advised that it is a good idea to check for null pointers so you don't have to spend time looking for where segmentation faults occur.
Just wondering what the community here thinks?
I have recorded a sequence of steps to be executed for testing my web application, in a JMeter .jmx script. (The recording tool used was BadBoy).
It is possible that one of the steps might return an error response in the HTTP response content. In this case, I need the script to stop execution of that thread.
However, since the error page is customized, JMeter does not recognize this as an error and proceeds to the next steps.
Is there any way to check for certain keywords, for example, and decide if the response is an error?
I have set up my POCOs and I have marked their public properties as virtual and I am successfully getting Proxies most of the time (95%) but randomly I am getting EF return some proxies and some non-proxies.
Recycling the app pool when this happens will then fix this instance of the error and it will go away for an amount of time. Then it will re-occur in some other random (it seems) place.
What can cause this sort of behaviour?
Thanks, Kohan
so I'm having some trouble creating a program to measure cache size in C. I understand the basic concept of going about this but I'm still having trouble figuring out exactly what I am doing wrong.
Basically, I create an array of varying length (going by power of 2s) and access each element in the array and put it in a dummy variable. I go through the array and do this around 1000 times to negate the "noise" that would otherwise occur if I only did it once to get an accurate measurement for time. Then, I look for the size that causes a big jump in access time. Unfortunately, this is where I am having my problem, I don't see this jump using my code and clearly I am doing something wrong.
Another thing is that I used /proc/cpuinfo to check the cache and it said the size was 6114 but that was not a power of 2. I was told to go by powers of 2 to figure out the cache can anyone explain why this is?
Here is the just of my code...I will post the rest if need be
{
struct timeval start;
struct timeval end; //
int n = 1; // change this to test different sizes
int array_size = 1048576*n; // I'm trying to check the time "manually" first before creating a loop for the program to do it by itself this is why I have a separate "n" variable to increase the size
char x = 0;
int i =0, j=0;
char *a;
a =malloc(sizeof(char) * (array_size));
gettimeofday(&start,NULL);
for(i=0; i<1000; i++)
{
for(j=0; j < array_size; j += 1)
{
x = a[j];
}
}
gettimeofday(&end,NULL);
int timeTaken = (end.tv_sec * 1000000 + end.tv_usec) - (start.tv_sec *1000000 + start.tv_usec);
printf("Time Taken: %d \n", timeTaken);
printf("Average: %f \n", (double)timeTaken/((double)array_size);
}
Often time methods take more than 3 parameters which are all of the same type, eg.
void mymethod (String param1, String param2, String param3)
then it's very easy for the client to mix up the parameters orders, for instance inverting param1 and param2:
mymethod (param2, param1, param3);
...which can be the cause of much time spent debugging what should be a trivial matter.
Any tips on how to avoid this sort of mistake (apart from unit tests) ?
I have changed timezone from General Settings, but that had no effect, time still shows as default UTC time zone. Then I changed timezone in wp-settings.php with date_default_timezone_set('Europe/Helsinki'); but that din't work either.
What could be wrong with my settings and why isn't timezone changing?
for a current webapp i need a "outlook-like" calendar... Here are some requirements for the calendar:
week-view for the appointments
different appointment types
direct display of the length and time of the date (like in googleCalendar)
multiple appointments for the same time
only using javascript, php and any DB
We need the calendar for the Zend Framework, so if the Calendar doesn't already support the ZF, the source needs to be editable!
do you know any calendar which fits my needs? or do you have any tipps for developing one by myself?
Given..
1 - The start-point GPS coordinates,
2 - The end-point GPS coordinates,
3 - The speed at which the object is travelling,
4 - Knowing that the trip trajectory will be a straight line...
How can I calculate what my GPS coordinated will be in n minutes' time? That is to say, how can I calculate my position at a given time after the trip has started before the trip has ended?
I have some functions written in C that I call from Haskell. These functions return IO (CInt). Sometimes I want to run all of the functions regardless of what any of them return, and this is easy. For sake of example code, this is the general idea of what's happening currently:
Prelude> let f x = print x >> return x
Prelude> mapM_ f [0..5]
0
1
2
3
4
5
Prelude>
I get my desired side effects, and I don't care about the results. But now I need to stop execution immediately after the first item that doesn't return my desired result. Let's say a return value of 4 or higher requires execution to stop - then what I want to do is this:
Prelude> takeWhile (<4) $ mapM f [0..5]
Which gives me this error:
<interactive:1:22:
Couldn't match expected type `[b]' against inferred type `IO a'
In the first argument of `mapM', namely `f'
In the second argument of `($)', namely `mapM f ([0 .. 5])'
In the expression: takeWhile (< 4) $ mapM f ([0 .. 5])
And that makes sense to me - the result is still contained in the IO monad, and I can't just compare two values contained in the IO monad. I know this is precisely the purpose of monads -- chaining results together and discarding operations when a certain condition is met -- but is there an easy way to "wrap up" the IO monad in this case to stop executing the chain upon a condition of my choosing, without writing an instance of MonadPlus?
Can I just "unlift" the values from f, for the purposes of the takeWhile?
Is this a solution where functors fit? Functors haven't "clicked" with me yet, but I sort of have the impression that this might be a good situation to use them.
Update:
@sth has the closest answer to what I want - in fact, that's almost exactly what I was going for, but I'd still like to see whether there is a standard solution that isn't explicitly recursive -- this is Haskell, after all! Looking back on how I worded my question, now I can see that I wasn't clear enough about my desired behavior.
The f function I used above for an example was merely an example. The real functions are written in C and used exclusively for their side effects. I can't use @Tom's suggestion of mapM_ f (takeWhile (<4) [0..5]) because I have no idea whether any input will really result in success or failure until executed.
I don't actually care about the returned list, either -- I just want to call the C functions until either the list is exhausted or the first C function returns a failure code.
In C-style pseudocode, my behavior would be:
do {
result = function_with_side_effects(input_list[index++]);
} while (result == success && index < max_index);
So again, @sth's answer performs the exact behavior that I want, except that the results may (should?) be discarded. A dropWhileM_ function would be equivalent for my purposes. Why isn't there a function like that or takeWhileM_ in Control.Monad? I see that there was a similar discussion on a mailing list, but it appears that nothing has come of that.
In our oroject we already have a lots of tables (100+). Some of them contains a lot of columns (50-100) and we are facing the need of adding more columns from time to time.
What do you think is best - from maintenance and performance point of view - to split these huge tables in smaller entities or to keep the tables the way they are ?
We are using an ORM tools, so we don't need to write custom request.
The other day, about two or three ago, I was simply typing in a Microsoft Word document when my screen froze. After a few moments, it went black...I thought it was my vid hardware (dual nVidia 9800 GTs).
Anyway, I did a hard reboot, and chose to Start Normally. The system blue screened telling me there was a failure in the Memory Manager. So then I thought maybe a RAM failure or vid memory failure.
I attempted reboot again, this time I got presented with the option to repair windows...so I went with that. The repair app finished and did an auto reboot. This time I got all the way back to my desktop where in a matter of a about 30 seconds, the system blue screened again and pointed to the Memory Manager as the area of cause.
Again I rebooted, the repair thingy came up again and I allowed it to do its thing. Deciding if the same failure occured I'd begin pulling hardware to see at what point I may have found the possibly defective party.
However, this time it rebooted, I got back to desktop and no crash. All looked well, untill I looked at the baloon messages when hovering over the System Bar icons. Also when I opened any of my browsers, the tabs had no text, and any window that pops up that has regular buttons (OK, Cancel, etc., etc.) looks weird. The buttons are really really long and have no text.
So it seems like the system is once again running smoothly, however something has gotten corrupted.. something relating to drawing basic windows user interface objects.
Help...all ideas are respected and appreciated. Have a great day everyone!
Scenario:
I've network multihoming (dual ISP) setup.
each ISP bandwidth 500Mbps
Currently ISP-A link bandwidth almost fully utilized then the second ISP-B link
From our investigation, it is because youtube server cache response to link ISP-A.
Some time the utilization of link ISP B increased because at that time youtube server cached is response to ISP B.
My question
how/Why did this happen?
how do I force youtube cache server using ISP link B?
I am thinking of spending some time in learning more math, will it be helpful for me as a software developer? I mean to ask, if it will be worth the effort to spend that extra time on math rather than spending it on something else?
I'm developing a web based game application using flex. I'm placing images dynamically inside a canvas . Whenever i place an image it should change it state after a period of time. For example after 2 mins it should change it state. The time has to be calculated for each image after i place the image. How shall i handle this.
sifr3 text doesn't load many time first time on FF 3.5? I haven't checked on other browser.
If i reload page again then it loads properly.
this is my code
sIFR.replace(futura, {
selector: '#Homepage h1', ratios: [6, 1.24, 9, 1.13, 10, 1.15, 16, 1.09, 21, 1.06, 22, 1.07, 25, 1.04, 26, 1.06, 29, 1.03, 30, 1.05, 31, 1.03, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01],
wmode: 'transparent',
css: '.sIFR-root { background-color: none; color: #ffffff; }'
});
I want to know how to run a progress bar and some other work simultaneously, then when the work is done, stop the progress bar in Python (2.7.x)
import sys, time
def progress_bar():
while True:
for c in ['-','\\','|','/']:
sys.stdout.write('\r' + "Working " + c)
sys.stdout.flush()
time.sleep(0.2)
def work():
*doing hard work*
How would I be able to do something like:
progress_bar() #run in background?
work()
*stop progress bar*
print "\nThe work is done!"