Hi
I want to write a simple client that downloads a file from a server using only bsd sockets.
I searched the web but couldn't find anything helpful. Can you give me a direction?
Thanks
Alex
I have a tuple of tuples (Name, val 1, val 2, Class)
tuple = (("Jackson",10,12,"A"),
("Ryan",10,20,"A"),
("Michael",10,12,"B"),
("Andrew",10,20,"B"),
("McKensie",10,12,"C"),
("Alex",10,20,"D"))
I need to return all combinations using itertools combinations that do not repeat classes. How can I return combinations that dont repeat classes. For example, the first returned statement would be: tuple0, tuple2, tuple4, tuple5 and so on.
I'm trying to redirect the output of my script and it needs to be called inside the script.
filename=uname -a
filename="$filename" date
2>&1 | tee $filename".txt"
That is what I have so far, but it's obviously wrong. I don't know too much SH scripting, so help is appreciated
-Alex
Hello,
.NET 4.0
I am looking for the easiest way to generate a Word document on our server.
Limitations :
Server side
I don't want to install word on the server
Data source is XML
I tried to generate a DOCX with XSLT which is fast and easy but the only way I could find to validate the generated document is to open it with Word and the only error I get when the document is not valid is "Error while opening document". Not very useful.
Any ideas?
Thanks,
Alex
i am building a formula like this:
=if(a1="something" or a1="alex","returned","not found")
but i guess the syntax is wrong. what is the correct way to write this?
Im trying to achieve current page highlights on wordpress similar to this site
Alex Soth.
I'm very nearly there with my css.
At present i have current page highlights on pages, ie. home,calendar, projects. However when it come to current page highlights on child pages i have a problem.
the indented child page list appears on hover when selecting a child page, but after page selection the menu reverts back to the standard pages menu with no visible child menus? unlike the link to the Alex Soth site where the extended menu stays and current page is highlighted
I know that the answer will be a simple piece of css involving current_page_item and possible position:relative to obtain the menu staying visible after selection. But i can for the life of me work it out.
Any ideas Ive attached my relivant pieces of css below??
thanks
/* =Link Styles
------------------------------------------------------------------*/
input#submit {
cursor: pointer;
}
input#searchsubmit {
background: url(images/search.png) no-repeat center;
}
input#searchsubmit:hover {
background: url(images/search.png) no-repeat center #3399FF !important;
cursor: pointer;
}
.navigation a:hover, input#submit {
background: #3399FF;
color: #3399FF !important;
}
a {
color: #666;
}
a:hover, a:hover span {
color: #c11501 !important;background-color: #fae100;
}
.entry sup a,
#main_nav .current_page_item a,
#main_nav .current_page_ancestor a
{
color: #666 !important;
}
#main_nav h1.masthead a {
color: #666;
}
#main_nav h1.masthead a:hover {
border-right: none;
}
h2 a, #main_nav a {
color: #3399FF;
}
img a, img a:hover {
text-decoration: none;
}
.post a, .navigation a {
font-weight: bold;
color: #000;
}
.navigation a {
background: #EEE;
color: #666;
font-weight: normal;
padding: 3px 0px;
border-radius: 0px;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
}
.post sup {
font-size: 11px;
color: #aaa;
}
.post sup a {
border: 0;
margin: 0;
font-weight: normal;
font-size: 10px;
}
#supplementary .post_nav ul.about_nav li a, #supplementary .post_nav ul.single_post_meta a, #supplementary ul.contact_key li a {
color: #888888;
border-bottom: 0;
}
/* =Main Menu
------------------------------------------------------------------*/
#main_nav ul.menu li {
position: relative;
}
#main_nav ul.menu li:hover ul.sub-menu,
#main_nav ul.menu li:hover ul.children {
display: block;
}
I am new to android development.
Have tried a couple times downloading the Android SDK and ADT plugin for Eclipse
In the Android SDK and AVD manager load fine but will not load any available packages.
Show:
- Android Repository
--"Some packages were found but are not compatible updates"
In the installed it shows 1.5 to 2.3 SDK platforms.
How to I get them available.
Appreciate help.
Thanks,
Alex
I have a SSIS package that I plan to deploy on my SQL Server 2008 machine.
I need to call this SSIS package remotely and synchronously from .NET. Obviously I need to pass parameters to this package as well.
How could I do that?
Thanks,
Alex
My app consists of Home and Map pages.
Home is ASP.NET. Map is hosting Silvellight.
How can I navigate from the Silverlight Map page to Home page?
Thanks,
Alex
Hi all
I'm trying to write a function that could receive it's second arg a name of a function.
In order to validate function's name (that will be used in an eval statement) I use function_exists such as:
if(function_exists($type)){
$toEval= $type.'(\''.$file.'\');';
}else{
But if the arg sent is include or require (with 'once' variations) this code fails (function_exists returns false).
How could this be fixed?
Thanks,
Alex
Hi everyone,
my background is totally not related to video stuff so pardon my newbie style.
I own a samsung HMX-H100P camcorder and I'm trying to encode videos to be uploaded to Youtube and Vimeo.
First problem:
videos generated by the camera with no processing appear like this: http://www.youtube.com/watch?v=AANbl_DTuzE when I play them
with Totem(Linux) or VideoLan.
Second problem:
When I try to encode the videos produced by the camera using mencoder I get the video at the resolution I chose but those ugly lines and lagging are still
present.
Here's the command I use:
mencoder $inputFile -aspect 16:9 -of lavf -lavfopts format=psp -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:coder=0:vcodec=libx264:acodec=libfaac:vbitrate=4500:abitrate=128 -vf scale=1280:720 -ofps 25000/1001 -o $outputFile
Any ideas?
Thanks in advance
I've been searching and reading through documents all morning and understand that I need to use some combination of chown and probably 'jailing' to securely give programmers access to directories on my centos webserver.
Here's the situation: I have an apache web server that has any number of virtual sites located in /var/www/site1 /var/www/site2 etc..
I have different developers that need full access both ssh and vsFTP to only the site they are working on. What is the best way to create and maintain security in this scenario. My thought would be to create a new user for each coder, jail that user to the website directory they are allowed to work in, add their user to a group and set the webroot's owner to that group.
Any thoughts? Good, bad, ugly? Thanks!
I am a littlebit frustrated, im working on a project with the aim to build a system witch print automatically e-mail attachments of incoming mails ("E-Mail to Print"-system). I already set up a e-mail server (exim4) which receive perfectly e-mail and stores them to a mbox in /var/mail/ - now I want to extract the attachments out of the mbox file throw MIME to the original .PDF, .DOC, .JPG, .GIF, ... and save them in a directory, from where they get print. After the e-mail attachments got extracted they should be deleted, so they don't get extracted again.
But how can I get this to work? I am not a coder, so I looked for existing scripts and programs but found nothing to work with. Could anyone give me little help - I would be very thankful!
Thanks, Simeon
I am setting up a Rails app on AWS that:
1) all traffic must ssl encrypted
2) will highly fluctuate in traffic on a weekly basis
3) will by maintained by someone that is a stronger coder than sysadmin, but will be responsible for both
I am thinking that SSL termination on an elastic load balancer backed by small ec2 instances running nginx and unicorn
A small subset of the requests will take longer than 10s, because of this I am also debating using 'thin' instead of 'unicorn'.
My question is this: Is this sane? I am stepping into a quagmire of cost, maintainability, security or performance problems?
I'm making a regression testing suite for some rendering software. I need to be able to load an image file (PNG or TGA, ideally) and compare the pixel values to a standard approved image.
I'd like it to be command line driven too, so I can make a batch file to run all the tests.
All the compare utilities I have found so far either show differences (I just need it to fail if they are different) or compare all the bytes, meaning that meta-data will trigger a fail.
Anyone got any suggestions? I am not a coder, and can only barely cobble a batch script together.
Thanks for any suggestions.
I am trying to push my server's CPU cores to the max, but no success.
Encoding 2-pass style, set my "-threads" to 128 . When running 2nd pass , the CPU seems to be at 98% usage, but first pass run totally ignores "-threads" option.
Using libx264 . Here is my preset:
flags=+loop+mv4
cmp=256
partitions=+parti4x4+parti8x8+partp4x4+partp8x8+partb8x8
me_method=hex
subq=7
trellis=1
refs=5
bf=3
flags2=+bpyramid+wpred+mixed_refs+dct8x8
coder=1
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
qmin=10
qmax=51
qdiff=4
Is there any reason why the 1st pass is not utilizing my CPUs ?
Thank you in advance! This community has always been very kind to me.
I am trying to push my server's CPU cores to the max, but no success.
Encoding 2-pass style, set my "-threads" to 128 . When running 2nd pass , the CPU seems to be at 98% usage, but first pass run totally ignores "-threads" option.
Using libx264 . Here is my preset:
flags=+loop+mv4
cmp=256
partitions=+parti4x4+parti8x8+partp4x4+partp8x8+partb8x8
me_method=hex
subq=7
trellis=1
refs=5
bf=3
flags2=+bpyramid+wpred+mixed_refs+dct8x8
coder=1
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
qmin=10
qmax=51
qdiff=4
Is there any reason why the 1st pass is not utilizing my CPUs ?
Thank you in advance! This community has always been very kind to me.
We are using Amazon EC2 m1.xlarge instance for video re-encoding and it looks like the actual encoding process takes a very long time.
For an average 250mb video file it takes about an hour to encode.
Intance: m1.xlarge (Xeon E5645 x 15gb ram)
Windows Server 2008 R2 64-bit
AviSynth version 2.5 (32bit) + ffms2 plugin (FFmpegSource 1.21)
FFmpeg SVN-r13712
libavutil 3213056
libavcodec 3356930
libavformat 3411456
libavdevice 3407872
Number of parallel jobs is 3
Average CPU utilization ~96%
Update#1
Source video: mp4/h.264
Parameters for ffmpeg:
--enable-memalign-hack --enable-avisynth --enable-libxvid --enable-libx264 +
--enable-libgsm --enable-libfaac --enable-libfaad --enable-liba52 +
--enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-pthreads +
--enable-swscale --enable-gpl
Video files encoded to mp4/h.264 with the following extra command line options:
-threads 0 -coder 0 -bf 0 -refs 1 -level 30 -maxrate 10000000 -bufsize 10000000
1) I've got a 30K row table.
2) When I run a long, 50-line query on that table, a GROUP function reduces the number of rows to 7K.
3) I want to export the grouped 7K rows as a new table, or save them as a CSV.
When I attempt to export, instead of getting the grouped 7K rows, I get the old, pre-query 30K rows.
What am I doing wrong, and what should I be doing?
NOTE: I'm not a coder, so I'd really appreciate a solution that just used the PHPMyAdmin GUI.
Thanks!
On a scale depicting how closely best practices are followed, with "always" on one end and "never" on the other, my current company falls uncomfortably close to the latter. Just a couple trivial examples:
We have no code review process
There is very little documentation despite a very large code base (and some of it is blatantly incorrect/misleading)
Untested/buggy/uncompilable code is frequently checked in to source control
It is comically complicated to create a debuggable build for some of our components because of its underlying architecture.
Unhandled exceptions are not uncommon in our releases
Empty Catch{ } blocks are everywhere.
Now, with the understanding that it's neither practical nor realistic to follow ALL best practices ALL the time, my question is this: How closely have commonly accepted best practices been followed at the companies you've worked for? I'm kind of a noob--this is only the second company I've worked for--so I'm not sure if I'm just more of an anal retentive coder or if I've just ended up at mediocre companies. My guess (hope?) is the latter, but a coworker with way more experience than me says every company he's ever worked for is like this. Given the obvious benefits of following most best practices most of the time, I find it hard to believe it's like this everywhere. Am I wrong?
I am scheduled to share on NuGet (http://nuget.codeplex.com/) at the Deerfield Beach Coder’s Café on March 1st, 2011. My goal for this talk is to present demos and content covering how to leverage this new neat utility to easily “package” .Net-based binaries or tools and share them with others, who in-turn, can just as easy reference and readily use that same package in their Visual Studio 2010 .Net projects.
Scott Hanselman has recently blogged in great detail on creating NuGet packages.
For hosting a local NuGet package repository, Jon Galloway has a nice article update with a complete PowerShell script to simplify downloading the default feed packages which can be accessed here.
Information on my upcoming talk can be found at: http://www.fladotnet.com/Reg.aspx?EventID=514
The following is a brief abstract of the talk:
NuGet (formerly known as NuPack) is a free, open source developer focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development. NuGet is a member of the ASP.NET Gallery in the Outercurve Foundation. In this session we will:
Discuss the concept, vision and goal behind NuGet
See NuGet in action within an ASP.Net MVC project
Look at the NuGet integration in Microsoft WebMatrix
Create a NuGet package for our demo library
Explore the NuGet Project site
Configure a NuGet package feed for a local network
Solicit attendees input and feedback on the tool
Look forward to meeting you all there.
--Sam
The definition of a programmer is not obvious. It has happened that I have asked questions in this forum where people believe it don’t belong here because it’s not programmer related. I thought this question may clarify the definition.
What characteristics, roles and activities do you think defines a programmer?
Is there a typical programmer?
The technology changes so fast that it may be hard to be typical programmer.
From wikipedia:
A programmer, computer programmer or coder is someone who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software. One who practices or professes a formal approach to programming may also be known as a programmer analyst. A programmer's primary computer language (C, C++, Java, Lisp, Delphi etc.) is often prefixed to the above titles, and those who work in a web environment often prefix their titles with web. The term programmer can be used to refer to a software developer, software engineer, computer scientist, or software analyst. However, members of these professions typically possess other software engineering skills, beyond programming; for this reason, the term programmer is sometimes considered an insulting or derogatory oversimplification of these other professions. This has sparked much debate amongst developers, analysts, computer scientists, programmers, and outsiders who continue to be puzzled at the subtle differences in these occupations
I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events:
internal event InputEvent XYZPressed;
internal event InputEvent XYZHeld;
internal event InputEvent XYZReleased;
where XYZ is the name of the Keys object representing that key. To fire these events, I have the following for each key:
if (Keyboard.GetState().IsKeyDown(XYZ))
{
if (PreviousKeyState.IsKeyDown(XYZ))
{
if (XYZHeld != null)
XYZHeld();
}
else
{
if (XYZPressed != null)
XYZPressed();
}
}
else if (PreviousKeyState.IsKeyDown(XYZ))
{
if (XYZReleased != null)
XYZReleased();
}
However, this is a lot of repeated code (the above needs to be repeated for each input key). Aside from being a hassle to write, if any keys are added to/removed from the keys (if functionality is added/removed), a new section needs to be added (or an existing one removed).
Is there a cleaner way to do this? Perhaps something along the lines of
foreach key
check which state it's in
fire this key's event for that state
where the code does the foreach (automatically checking exactly those keys that "exist") rather than the coder?