is a 27 year-old software engineer that lives in OPorto, Portugal.
Web Development
Developing and maintaining the current webmail client of Portugalmail.
Build a Dovecot[1] plugin to add document search capability when using Solr[2] as the indexing service.
[1] http://www.dovecot.org/
[2] http://lucene.apache.org/solr/
Trainer at "Linux and Networks Workshop"
I am building a web application that interact with documents for later printing. In some points is similar to Google Docs. I am considering using cm/mm on the CSS of my documents pages because it will help me on the document generation. Example:
// A4 size
.page {
width: 210mm;
height: 297mm;
margin: 2cm 5cm;
}
<div class="page">
...
</div>
What are the main issues of following this approach?
I think that the issues that you refer are not related.
As far as I understand you compile your LESS file on the server side and all you want to do is to retrieve the new css file and not the cached one? Am I right?
Did you tried disable cache on google chrome?
I created a submodule (a bitbucket repo) on my openshift repo.
My current .gitmodules configuration:
[submodule "php"]
path = php
url = git@bitbucket.org:sgtcarneiro/repo.git
The problem is that after I push this code into my Openshift app i get the folling error:
remote: Host key verification failed.
remote: fatal: The remote end hung up unexpectedly
remote: Clone of 'git@bitbucket.org:sgtcarneiro/repo.git' into submodule path 'php' failed
This is expected since i didn't mention anywhere on bitbucket the pub key from the Openshift server. I already tried to check my .ssh/ to find/edit the public key but I do not have any permissions to access that.
PS: As a workaround I am using HTTPS authentication with user and password on the submodule and is working fine.
-edit-
The question do not says it all. :)
It may run on Unix and it will be used for email searching (Dovecot, Postfix and maildir).
Lucene is not a problem, im just analyzing some alternatives.
This should be trivial, but i am not getting it :\
HTML
<form id="myform" action="#">
<input type="submit" value="Submit" />
<a href="#" onclick="$('myform').submit()">Submit</a>
</form>
JS (Prototype)
$('myform').observe('submit', function(e) {
alert('submitted!');
e.stop();
});
Why the submit is only triggered with the submit via input? Shouldn't the submit event be triggered with $('myform').submit() also?
JSFiddle: http://jsfiddle.net/d8BdM/
I always used clear: both or only left/right to avoid extra spaces on IE (example).
So, if always worked for me, in all browsers, AFAIK there is no general reason for the width: 100%.
You need to add Content-Disposition to you message part:
Try to change this:
$message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST\n';
To this:
$message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST\n';
$message .= 'Content-Disposition: attachment';
$message .= 'Content-Transfer-Encoding: base64';
Not sure that this work cause i didn't tested and it can behave differently on each mail client.
Try Jquery jCrop.
You will need to do the real crop on server side though.
You can float: left all the 3 column with percentage widths. Something like this:
#col1, #col2, #col3 {
float: left;
}
#col1, #col3 {
width: 25%;
}
#col2 {
width: 50%;
text-align: center;
}
Also, if you are using Twitter Bootstrap you may want to use the Fluid Grid System with 3 columns.
Internal server errors are one of the many HTTP Status Codes and the origin is on the server side (PHP most likely).
Check your webserver log. The origin of your 500 error is there :)
If you want to save a couple lines of code you can use array_map and create_function:
$a = array(array('A' => 'khaja.ghc@cdc.com'), array('A' => 'bag@example.com'));
$result = array_map(create_function('$x','$y = array_values($x); return $y[0];'), $a))
Although the saving on the number of code lines, I don't encourage you to take this approach. The code will be much easier to read and understand with a simple foreach loop.
I am currently using Sublime Text with LESS.build package to compile my .less files into CSS.
My current LESS.build cmd is:
"cmd": ["lessc", "screen.less", "${file_path}/screen.css", "--verbose"]
I tried to add some extra folders to the --include-path:
"cmd": [
"lessc",
"screen.less",
"${file_path}/screen.css",
"--verbose",
"--include-path='.:/var/www/whatever/'"
]
But, whenever i try to build my .less files the --include-path params seems to be ignored.
The only workaround i found is adding the full relative path on my @import:
@import "../../../www/whatver/config.less"; //Ugly solution
Can anyone point me where i am failing and/or any other workaround prettier than mine's?
Your solution is removing overflow: hidden
To fix the float bug on the second example you gave try to use 100% of the width:
body#basic_page.brands_controller #content .text_info {
overflow: hidden;
font-size: 12px;
width: 100%; /* new rule */
}
As T.J said, your markup is invalid. With the correct markup you can achieve this with only HTML and CSS.
Something like this:
HTML
<li id="231" class="main">
<label class="name">David</label>
<div class="hidden" id="231" >
<p>Some Msg!!<p>
</div>
</li>
CSS
div.hidden {
display: none;
}
li.main:hover div.hidden {
display: block;
}
Example: http://jsfiddle.net/MWbS4/
Did you already considered using a template engine for PHP?
Some years ago I used smarty on one of my projects but it should be a ton on template engines out there.
I was trying to use the Holo Light theme with dark action bars as recommended on android guidelines.
This is my themes.xml file:
<resources>
<style name="Theme.MyApp" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/Widget.MyApp.ActionBar</item>
</style>
<style name="Widget.MyApp.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@android:drawable/dark_header</item>
<item name="android:titleTextStyle">@style/MyApp.ActionBar.TextAppearance</item>
</style>
<style name="MyApp.ActionBar.TextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@android:color/primary_text_dark</item>
</style>
</resources>
The result without using the search interface is the expected, but when I use the SearchView the background is from Holo.Light theme:
There is any way to change the SearchView default style on the ActionBar?
A negative margin or position: absolute will fix your problem.
I think you cannot achieve that without javascript.
The better I can get is this: http://jsfiddle.net/QeWz2/2/
I used display: inline-block and vertical-align: top to get that behaviour
Update
I think Columnizer is the jQuery plugin you are looking for.
I have no idea if it is possible to disable event bubbling is this case.
However in these cases I make a inverted event bubbling:
while(targ != null) {
if (targ.nodeName.toLowerCase() === 'button') {
alert(targ.nodeName.toLowerCase());
break;
}
targ = targ.parentElement;
}
Fiddle: http://jsfiddle.net/jVeMw/1/
Is not perfect for performance but since you are restricting the click event to the vidCommentBoard div it should not be a problem.
Just another option:
$('#myGallery0 img').slice(1)
I think changing the source code for "styling reasons" is a bad idea.
You can easily change the default CSS by changing the default skin (v2 skin I think) or by adding a custom skin to CKEditor.
Form (with firebug highlight hover the td):
Label column CSS:
width: auto;
padding: 0;
margin: 0;
The problem:
Why my left columns have that invisible "padding-right"? It's not possible to shrink columns to fit their content?
--EDIT--
The problem was the table itself. I defined table with "width: 100%". Removed that and the problem is gone.
I am not familiar with jquery tools, but if your z-index is not working you must need a !important tag or making it position:relative or position:absolute
From what I understand from your long post you just need to remove all select child's before starting to append the new option from the AJAX request.
Try something like this before your for loop:
$('#group').html('');
There is several ways to read a XML in Android. My first option is DocumentBuilder since do not create an API version restriction (is available since API Level 1).
An example from one of my projects:
public Document parseXML(InputSource source) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(false);
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(source);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
How do you read the file and access the document values after this, well, its pretty basic, just Google it.
I cannot tell you the reason but if you force the container div to have 100% width the behaviors of the two cases are identical.
#calendar {
display: table;
height:900px;
width: 100%;
}
Updated version: http://jsfiddle.net/DLjnH/1/
The problem is that, by default, Prototype library can’t access anything in the iframe.
There is some workarounds I found (e.g example) but no one provides full support for protytpe/iframes. Does anyone know a way to do that?
PS: not using iframes is not an option :)
In my current project I need to index all e-mails and their attachments from multiple mailboxes.
I will use Solr, but I don't know what is the best approach to build my index's structure. My first approach was:
<fields>
<field name="id" require="true"/>
<field name="uid" require="true"/>
//A lot of other fields
<dynamicField name="attachmentName_*" require="false">
<dynamicField name="attachmentBody_*" require="false">
</fields>
But now I am not really sure if it is the best structure. I don't think I can search for one term (e.g stackoverflow) and know where the term was (e.g. *attachmentBody_1* or *_2* or *_3* etc) with a single query.
Anyone have a better suggestion to my index's structure?
Why do you use width and height 100%? Those values are too buggy on IE. Use just the fixed values:
#ajax-overlay {
z-index:9999;
display:none;
position:fixed;
top:0;
left:0;
bottom: 0;
right: 0;
background:#000;
opacity:0.8;
}
With this code you will get the ajax-overlay div filling the screen no matter what happens on the rest of the page.
I think the answer is: No
You will need to use the URL hash. They were created just to do that.
In JavaScript, the fragment identifier of the current HTML or XHTML page can be accessed in the "hash" property location.hash — note that Javascript can be also used with other document types. With the rise of AJAX, some websites use fragment identifiers to emulate the back button behavior of browsers for page changes that do not require a reload, or to emulate subpages.
Still, I don't get it. What is your problem with hashes anyway?
That article is pretty good and I already read that. But my problem is that I will be using cm/mm not only for printing (e.g. @media print) but for the whole application. But since I want screen and print to be 100% identical I have my doubts that cm/mm is not the best approach.
This comment is way more clear than your original post. Please consider editing the OP :)
checkboxes are tricky to customize only with CSS if you want a cross-browser solution. you should also consider a javascript alternative.
Was a honest question :) But yes things changed a lot.
How Google Docs works then?
Yep was a typo. Already accepted the answer, thank you :)
Sry, can't help you :(
Ok. I got it. I think you can't do that because Outlook (other clients can behave on a different way) always display text/calendar inline. GMail does the same. You can't have both of the 2 worlds: send as attachment and add the calendar automatically (AFAIK).
You are correct. The array structure is what you described.
I think your bottleneck is on the SMTP server and not on PHP.
Apparently this issue is common for nodejs too, so, i am accepting this as the correct answer
Thank you for the link but I am using lessc with node.js :(
Please consider adding a working example on jsfiddle.net (or similar)
Please consider to add some HTML as example or a jsfiddle with the iteration that you are trying to achieve
@CQM here is any kind of pattern on this behavior?
Shared by Nuno SalvaterraIn Focus, a news photography blog on the official site of The Atlantic Magazine.
Fantastic 20-part WWII photo retrospective.
Submitted by: 100t
Posted at: 2011-10-26 10:02:05
See full post and comment: http://9gag.com/gag/417376
Submitted by: bennybb
Posted at: 2011-10-25 07:46:40
See full post and comment: http://9gag.com/gag/411012
O Capitão Nascimento de Tropa de Elite está em Portugal para chefiar uma operação secreta internacional para apanhar os políticos mentirosos e corruptos e não parece muito contente com Pedro Passos Coelho.
Submitted by: weed13
Posted at: 2011-10-26 09:30:24
See full post and comment: http://9gag.com/gag/417283
Shared by Mário
we like our shit as it is. don't pull a facebook on us, google folks! :(
The announcement that Nexus One users won’t be getting upgraded to Android 4.0 Ice Cream Sandwich led some to justifiably question Google’s support of their devices. I look at it a little differently: Nexus One owners are lucky. I’ve been researching the history of OS updates on Android phones and Nexus One users have fared much, much better than most Android buyers.
I went back and found every Android phone shipped in the United States1 up through the middle of last year. I then tracked down every update that was released for each device - be it a major OS upgrade or a minor support patch - as well as prices and release & discontinuation dates. I compared these dates & versions to the currently shipping version of Android at the time. The resulting picture isn’t pretty - well, not for Android users:
Other than the original G1 and MyTouch, virtually all of the millions of phones represented by this chart are still under contract today. If you thought that entitled you to some support, think again:
Also worth noting that each bar in the chart starts from the first day of release - so it only gets worse for people who bought their phone late in its sales period.
This may be stating the obvious but there are at least three major reasons.
Ever since the iPhone turned every smartphone into a blank slate, the value of a phone is largely derived from the software it can run and how well the phone can run it. When you’re making a 2 year commitment to a device, it’d be nice to have some way to tell if the software was going to be remotely current in a year or, heck, even a month. Turns out that’s nearly impossible - here are two examples:
The Samsung Behold II on T-Mobile was the most expensive Android phone ever and Samsung promoted that it would get a major update to Eclair at least. But at launch the phone was already two major versions behind — and then Samsung decided not to do the update after all, and it fell three major OS versions behind. Every one ever sold is still under contract today.
The Motorola Devour on Verizon launched with a Megan Fox Super Bowl ad, while reviews said it was “built to last and it delivers on features.” As it turned out, the Devour shipped with an OS that was already outdated. Before the next Super Bowl came around, it was three major versions behind. Every one ever sold is still under contract until sometime next year.
Besides the obvious platform fragmentation problems, consider this comparison: iOS developers, like Instapaper’s Marco Arment, waited patiently until just this month to raise their apps’ minimum requirement to the 11 month old iOS 4.2.1. They can do so knowing that it’s been well over 3 years since anyone bought an iPhone that couldn’t run that OS. If developers apply that same standard to Android, it will be at least 2015 before they can start requiring 2010’s Gingerbread OS. That’s because every US carrier is still selling - even just now introducing2 - smartphones that will almost certainly never run Gingerbread and beyond. Further, those are phones still selling for actual upfront money - I’m not even counting the generally even more outdated & presumably much more popular free phones.
It seems this is one area the Android/Windows comparison holds up: most app developers will end up targeting an ancient version of the OS in order to maximize market reach.
In the chart, the dashed line in the middle of each bar indicates how long that phone was getting any kind of support updates - not just major OS upgrades. The significant majority of models have received very limited support after sales were discontinued. If a security or privacy problem popped up in old versions of Android or its associated apps (i.e. the browser), it’s hard to imagine that all of these no-longer-supported phones would be updated. This is only less likely as the number of phones that manufacturers would have to go back and deal with increases: Motorola, Samsung, and HTC all have at least 20 models each in the field already, each with a range of carriers that seemingly have to be dealt with individually.
That’s a very good question. Obviously a big part of the problem is that Android has to go from Google to the phone manufacturers to the carriers to the devices, whereas iOS just goes from Apple directly to devices. The hacker community (e.g. CyanogenMod, et cetera) has frequently managed to get these phones to run the newer operating systems, so it isn’t a hardware issue.
It appears to be a widely held viewpoint3 that there’s no incentive for smartphone manufacturers to update the OS: because manufacturers don’t make any money after the hardware sale, they want you to buy another phone as soon as possible. If that’s really the case, the phone manufacturers are spectacularly dumb: ignoring the 2 year contract cycle & abandoning your users isn’t going to engender much loyalty when they do buy a new phone. Further, it’s been fairly well established that Apple also really only makes money from hardware sales, and yet their long term update support is excellent (see chart).
In other words, Apple’s way of getting you to buy a new phone is to make you really happy with your current one, whereas apparently Android phone makers think they can get you to buy a new phone by making you really unhappy with your current one. Then again, all of this may be ascribing motives and intent where none exist - it’s entirely possible that the root cause of the problem is just flat-out bad management (and/or the aforementioned spectacular dumbness).
All of the even slightly cheaper phones are much worse than the iPhone when it comes to OS support, but it’s interesting to note that most of the phones on this list were actually not cheaper than the iPhone when they were released. Unlike the iPhone however, the “full-priced” phones are frequently discounted in subsequent months. So the “low cost” phones that fueled Android’s generally accepted price advantage in this period were basically either (a) cheaper from the outset, and ergo likely outdated & terribly supported or (b) purchased later in the phone’s lifecycle, and ergo likely outdated & terribly supported.
Also, at any price point you’d better love your rebates. If you’re financially constrained enough to be driven by upfront price, you can’t be that excited about plunking down another $100 cash and waiting weeks or more to get it back. And sometimes all you’re getting back is a “$100 Promotion Card” for your chosen provider. Needless to say, the iPhone has never had a rebate.
Along similar lines, a very small but perhaps telling point: the price of every single Android phone I looked at ended with 99 cents - something Apple has never done (the iPhone is $199, not $199.99). It’s almost like a warning sign: you’re buying a platform that will nickel-and-dime you with ads and undeletable bloatware, and it starts with those 99 cents. And that damn rebate form they’re hoping you don’t send in.
I’m not going to. I do think that having 15 months or so of history gives a good perspective on how a phone has been treated, but it’s also just a labor issue - it takes a while to dredge through the various sites to determine the history of each device. I plan to continue on and might also try to publish the underlying table with references. I also acknowledge that it’s possible I’ve missed something along the way.
For the major Android version release dates, I used the date at which it was actually available on a normal phone you could get via normal means. I did not use the earlier SDK release date, nor the date at which ROMs, hacks, source, et cetera were available.
Finally, it’s worth noting that people outside the US have often had it even worse. For example, the Nexus One didn’t go on sale in Europe until 5 months after the US, the Droid/Milestone FroYo update happened over 7 months later there, and the Cliq never got updated at all outside of the US.
Thanks primarily to CNET & Wikipedia for the list of phones.↩
Yes, AT&T committed to Gingerbread updates for its 2011 Android phones, but only those that had already been released at the time of the July 25 press release. The Impulse doesn’t meet that criterion. Nor does the Sharp FX Plus.↩
A couple of samples just from the past week: 1, 2 - in comments.↩
Shared by Rui
Suicidal Bunnies, melhores commics de sempre :D
Submitted by: furkey
Posted at: 2011-10-23 14:49:15
See full post and comment: http://9gag.com/gag/401337
Shared by Rui
True story :)
Barcelona… looks like simcity ;)
O Grande Mestre e mentor de Passos Coelho, Ângelo Darth Sidious Correia, já veio dizer que se solidariza com os cidadãos que vão ficar sem subsídios de férias e de Natal (sinto-me tocado por tal gesto altruísta), mas que se recusa a prescindir da subvenção vitalícia, porque é um "direito adquirido". Impressionado - e comovido - por tal repentino assomo de esquerdismo, fui procurar confirmação ao blogue mais bem informado do momento e claro, descobri um texto muito interessante, por sinal publicado no órgão oficial dos seus novos compagnons de route, o Avante, no qual Ângelo Correia afirma que, cito e abro aspas, "os direitos adquiridos são uma burla". Portanto, Sidious Correia revela ao mundo que se prepara para burlar o Estado português, ao não abdicar do seu "direito adquirido". Será que a PJ costuma ler jornais e ouvir rádio? O anúncio de um crime não é assim uma coisa tão comum. Aproveitem!