Ok I just started a template for a website
http://clickforclicks.com/design1/
I'm trying to make it tableless.
Notice I have a red div along the side. I tried to get one on the otherside aswell that looked the same. But when I do it. It goes to a new line =[
How might I get this effect without using Javascript or Absolute positioning that wont look proper on all resolution sizes.
I'm learning Python, and have run into a bit of a problem. On my OSX install of Python 3.1, this happens in the console:
>>> filename = "test"
>>> reader = open(filename, 'r')
>>> writer = open(filename, 'w')
>>> reader.read()
''
>>> writer.write("hello world\n")
12
>>> reader.read()
''
And calling more test in BASH confirms that there is nothing in test. What's going on?
Thanks.
I have this structure for my navigation index.php?v=page
I am looking to convert it to: www.domain.com/page/ - using mod_rewrite..any ideas on that? I read through some tuts and examples, but couldnt get it working right.
Thanks,
Ryan
In Firefox 'A' shows in the middle, on Chrome/IE it doesn't:
<button type="button" style="width:24px; text-align:center; vertical-align:middle">A</button>
Note the following has the same results:
<button type="button" style="width:24px;">A</button>
I have no clue how to validate this string. I am simply supplying an IV for an encryption, but can find no "is_hex()" or similar function, I can't wrap my head around it! I read on a comment in the php documentation (user contrib. notes) this:
if($iv == dechex(hexdec($iv))) {
//True
} else {
//False
}
But that doesn't seem to work at all.. It only says false.
If it helps my input of my IV would be this:
92bff433cc639a6d
need some help with building a powershell script to help with some basic string manipulation. I know just enough powershell to get in trouble, but can't figure out the syntax or coding to make this work.
I have a text file that looks like this -
Here is your list of servers:
server1
server2.domain.local
server3
Total number of servers: 3
I need to take that text file and drop the first and last lines (Always first and last.) Then I need to take every other line and basically turn it into a CSV file.
The final output should be a text file that looks like this -
server1,server2.domain.local,server3
Any suggestions on where to start? Thanks!
I've created a few sounds for use in my game. I can play them at certain events without issue:
// create sounds
CFBundleRef mainBundle;
mainBundle = CFBundleGetMainBundle();
_soundFileShake = CFBundleCopyResourceURL(mainBundle, CFSTR("shake"), CFSTR("wav"), NULL);
AudioServicesCreateSystemSoundID(_soundFileShake, &_soundIdShake);
// later...
AudioServicesPlaySystemSound(_soundIdShake);
The game has a mechanism which allows you to shake the device to activate some functionality. I've got the shaking code done so I get get a "shaking started" and "shaking ended" message to my game. What I need to have happen is start playing "shave.wav" when shaking starts and loop it until it stops. Is there a way to do this with AudioToolbox/AudioServices? How could I do this if not?
I was looking at this SO question: http://stackoverflow.com/questions/1168215/ado-net-entity-framework-update-only-certian-properties-on-a-detached-entity. This was a big help for me. I know now that I need to attach an entity before making my changes to it. But how can do I do this:
I have an MVC website, a Customer Update Page with fields: ID, Name, Address, etc. My MVC is parsing this into a Customer entity. How do I do the following:
Update my entity and Save the changes to it.
Catch the exception if my changes have been made since I loaded my entity.
I have a number between 0.0 and 1.0, I would like to convert it to a grayscale color.
White = 0
Black = 1
You can show me how in any understandable language (I prefer actionscript 3)
Please, don't just give a name of a function that a language have to do this, I want to know how it does.
I have a single table with lots of records ( 100k) that I need to be able to index and search on several text fields. The easiest searches will have the first part of the string specified (eg, LIKE 'ABC%' in SQL). The tougher searches will need to search for any substring within the text fields (eg, LIKE '%ABC%' in SQL).
I need to run on the Compact Framework. SQL Compact is a memory hog and overkill for my one table. Besides, I'd like to be able to run on Silverlight 4 eventually.
The file and indexes can be generated on the full .NET Framework and I only need read capability on the Compact Framework. My records are not especially large and can be expressed in fix length format.
I'm looking for some existing code or libraries to avoid having to write a file-based BTree implementation from scratch.
I'm new to SQL and I don't think this question should be hard to answer. I have a high-score table for a game that contains the columns name, score, and rank. I want to know how I can order the table by descending order each time a new score is added so the table can always stay ordered by score.
I know this is the wrong way of doing this, but I hope this makes my point kind of clearer.
UPDATE `HSTable`.`Highscores` ORDER BY `Highscores`.`score` DESC;
What is the correct way of approaching this?
One more thing, is there a way I can set it so that the ranking value always stays where it's suppose to be from the SQL, for example, 1st place is always at the top regardless the score?
Thanks!
In my Android application, I use a bunch of open source libraries such as libyuv, libvpx, libcrypto, libssl, etc. Some of them come with Android.mk. For others, I hand-crafted Android.mk.
The code is built only for arm for now. Here is my Application.mk:
APP_ABI := armeabi-v7a
APP_OPTIM := release
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti
I am looking for way to generate binaries that are optimized for neon. Browsing the net, I found the following setting that someone is using in his Android.mk:
LOCAL_CFLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7
I wonder if I simply put this setting in Application.mk, will it automatically get applied across all the libraries?
A step before each library is built is the following:
include $(CLEAR_VARS)
Is it better to include LOCAL_CFLAGS directive after this line (instead of including it in Application.mk)?
Finally, why doesn't ndk-build automatically optimize for neon when it sees armabi in Application.mk? Regards.
Going off of my other question and it's pair.
I'm looking to grab the Hostname:Port value as found in the phpinfo() function. I can't seem to find it anywhere and it's not in $_SERVER.
I am confused about why this code does not display any image:
In the app delegate:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSRect rect = window.frame;
rect.origin.x = 0;
rect.origin.y = 0;
BlueImageView *blueImageView = [[BlueImageView alloc]initWithFrame:rect];
window.contentView = blueImageView; // also tried [window.contentView addSubview: blueImageView];
}
BlueImageView.h:
@interface BlueImageView : NSImageView {
}
@end
BlueImageView.m:
@implementation BlueImageView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self setImage: [NSImage imageNamed:@"imagefile.png"]];
NSAssert(self.image, @"");
NSLog (@"Initialized");
}
return self;
}
- (void)drawRect:(NSRect)dirtyRect {
}
@end
The file imagefile.png exists. The NSAssert is not causing an exception. The NSLog is firing. But no image shows up in the window.
I'm trying to profile my code to check how long it takes to execute some parts of my code.
I've wrapped my most time-consuming part of the code in something like that:
DateTime start = DateTime.Now;
...
... // Here comes the time-consuming part
...
Console.WriteLine((DateTime.Now - start).Miliseconds);
The program is executing this part of code for couple of seconds (about 20 s) but in console I get the result of something about 800 miliseconds. Why is that so? What am I doing wrong?
Hello, I have some Regex, it looks like this:
string regexForDrop = @"^((%27)|'|(\-\-))\s*(d|%64|%44)(r|%72|%52)(o|%6F|%4F)(p|%70|%50)$";
It works fine, when i write to the input "--drop", but it does not works, when i write "drop table users" or something like that. I need that it would be working, no matter what comes after "--drop". How i can implement that?
Thanks
Screenshot:
http://habreffect.ru/files/200/4cac2487f/antlr.png
If I type "\nabc", it works.
If I put ESC_SEQ on right, "abc" works, but "\nabc" doesn't.
I am beginner in PHP. I am trying to parse this xml file.
<relationship>
<target>
<following type="boolean">true</following>
<followed_by type="boolean">true</followed_by>
<screen_name>xxxx</screen_name>
<id type="integer">xxxx</id>
</target>
<source>
<notifications_enabled nil="true"/>
<following type="boolean">true</following>
<blocking nil="true"/>
<followed_by type="boolean">true</followed_by>
<screen_name>xxxx</screen_name>
<id type="integer">xxxxx</id>
</source>
</relationship>
I need to get the value of the field 'following type="boolean" ' for the target and here's my code -
$xml = simplexml_load_string($response);
foreach($xml->children() as $child)
{
if ($child->getName() == 'target')
{
foreach($child->children() as $child_1)
if ( $child_1->getName() == 'following')
{
$is_my_friend = (bool)$child_1;
break;
}
break;
}
}
but I am not getting the correct output. I think the ' type="boolean" ' part of the field is creating problems. Please help.
I have created a repository AAA and another BBB.
In AAA I have created a file A with the values a1, a2, a3 and commit
In BBB I have created a file B with the values b1, b2, b3, commit and export a bundle.
I add the bundle in AAA and merge.
I make a change in B, and write b33 in AAA and another change in B and write b23 in BBB. and commit both. I create bundle of BBB and add the bundle in AAA. I do a merge.
Now I decide to revert to the revert to step 2. I no more want to have the merge of 4. changes done in B as they were bad merges.
Now I want to add the bundle of 3 but I can see that it can`t see any changes anymore. Why? How can I do the merge once more?
Hello!
I'm writing a very stupid program using Boost Date_Time library.
int main(int srgc, char** argv) {
using namespace boost::posix_time;
date d(2002,Feb,1); //an arbitrary date
ptime t1(d, hours(5)+nanosec(100)); //date + time of day offset
ptime t2 = t1 - minutes(4)+seconds(2);
ptime now = second_clock::local_time(); //use the clock
date today = now.date(); //Get the date part out of the time
}
Well I cannot compile it, compiler does not recognize a type...
Well I used many features of Boost libs like serialization and more... I correctly built them and, looking in my /usr/local/lib folder I can see that libboost_date_time.so is there (a good sign which means I was able to build that library)
When I compile I write the following:
g++ -lboost_date_time main.cpp
But the errors it showed me when I specify the lib are the same of those ones where I do not specify any lib.
What is this? Anyone knows?
The error is
main.cpp: In function ‘int main(int,
char**)’: main.cpp:9: error: ‘date’
was not declared in this scope
main.cpp:9: error: expected ‘;’ before
‘d’ main.cpp:10: error: ‘d’ was not
declared in this scope main.cpp:10:
error: ‘nanosec’ was not declared in
this scope main.cpp:13: error:
expected ‘;’ before ‘today’
Hi Everyone
Can anybody please tell me how to implement an audio player appilcation in iphone. I am pretty new to iphone development and i am just starting to learn the tricks of the trade.
Thanks
I have lists of data such as
a = [1,2,3,4]
b = ["a","b","c","d","e"]
c = ["001","002","003"]
And I want to create new another list that was mixed from all possible case of a,b,c like this
d = ["1a001","1a002","1a003",...,"4e003"]
Is there any module or method to generate d without write many for loop?
I'm starting to look into Google's Picasa API for photo data, which provides you with a big XML file with info about albums and photos.
I'm doing some quick and dirty tests to parse the XML file (which is saved locally to my hard drive for now) with JQuery and pull out the album id's, which are stored as "gphoto:id" tags, and display them in a div:
$(document).ready(function() {
$.get(
'albums.xml',
function(data)
{
$(data).find('entry').each(function()
{
var albumId = $(this).children('gphoto:id').text();
$('#photos').append(albumId + '<br />');
})
})
})
I'm getting the following error in the console:
jquery.js:3321 - Uncaught Syntax error, unrecognized expression: Syntax error, unrecognized expression: id
This will work with other tags in the XML file (such as title, author, updated, etc.), but I'm trying to understand what's going on here. Does it have to do with the colon in "gphoto:id", somehow?