text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
} } } } } ``` But my logic must be wrong because im getting this result for my array: ``` [4] [7] = 1 [4] [8] = 1 [4] [9] = 1 [5] [7] = 1 [6] [7] = 1 ``` Any idea why im missing additional data? `MooseX::Aliases` has several moving parts to make this functionality happen, that's because the behavior ne...
[ 0.44195547699928284, 0.08427030593156815, 0.18319371342658997, -0.0029118764214217663, 0.11431335657835007, -0.32208725810050964, 0.7318817377090454, -0.3000466823577881, -0.17498238384723663, -0.46594324707984924, 0.20543090999126434, 0.6744323968887329, -0.38884881138801575, 0.0475191064...
wrong when you try to register your trait. `MooseX::Aliases` uses `Moose::Util::meta_attribute_alias` rather than the old fashioned way you're using here. Try replacing your `Moose::Meta::Attribute::Custom::Trait::OtherName` section with a call to `Moose::Util::meta_attribute_alias 'OtherName';` inside your Role. Seco...
[ 0.3113321363925934, -0.09529305249452591, -0.04881535470485687, 0.06091010197997093, 0.19743499159812927, -0.0918312817811966, 0.5627291798591614, -0.006996425334364176, -0.13729138672351837, -0.6872619986534119, 0.38435912132263184, 0.6179473996162415, -0.45500922203063965, 0.004913632292...
are applied properly when everything is compiled. I've gotten a simple version of this working up through immutable. This code is also on [github](https://github.com/perigrin/MooseX-AltInitArg). First the Attribute trait: ``` package MooseX::AltInitArg::Meta::Trait::Attribute; use Moose::Role; use namespace::autocle...
[ 0.07242874801158905, -0.13442008197307587, 0.5603433847427368, -0.00016540373326279223, -0.1699053943157196, 0.09062476456165314, 0.41705307364463806, -0.6160243153572083, -0.027334064245224, -0.7539554834365845, -0.08243061602115631, 0.8484170436859131, -0.5582695007324219, -0.36201432347...
# don't run if we haven't set any alt_init_args # don't run if init_arg is explicitly undef unless $self->has_alt_init_arg && $self->has_init_arg; if (my @alternates = grep { exists $params->{$_} } ($self->alt_init_arg)) { if (exists $params->{ $self->init_arg }) { push @alterna...
[ 0.369601309299469, -0.15655414760112762, 0.40314429998397827, -0.08917438238859177, 0.03169603645801544, 0.28153806924819946, 0.8267983794212341, -0.34683772921562195, -0.16458766162395477, -0.16444364190101624, -0.24039395153522491, 0.5428566336631775, -0.6439498066902161, -0.158485621213...
'Conflicting init_args: (' . join(', ', @alternates) . ')' ) if @alternates > 1; $params->{ $self->init_arg } = delete $params->{ $alternates[0] }; } $self->$orig(@_); }; 1; __END__ ``` Next the Class trait. ``` package MooseX::AltInitArg::Meta::Trait::Class; use Moose::Role; use namespace...
[ 0.2657586932182312, -0.2951304018497467, 0.4463805854320526, 0.16619537770748138, -0.1933378130197525, 0.32945916056632996, 0.6163691878318787, -0.6354288458824158, 0.1374627947807312, -0.02192799001932144, 0.02530045621097088, 0.5477216839790344, -0.6704230904579163, 0.11597326397895813, ...
# only run on aliased attributes unless $attr->meta->can('does_role') && $attr->meta->does_role('MooseX::AltInitArg::Meta::Trait::Attribute'); return @orig_source # don't run if we haven't set any aliases # don't run if init_arg is explicitly undef unless $attr->has_alt_i...
[ 0.42459747195243835, -0.19864967465400696, 0.34835970401763916, 0.07254000753164291, 0.090250663459301, -0.1293906718492508, 0.9832915663719177, -0.09932011365890503, 0.04525364562869072, -0.24725393950939178, -0.12164375931024551, 0.9142382144927979, -0.5512722730636597, -0.33239409327507...
(my @aliases = grep { exists $params->{$_} } (qw(' . $attr->alt_init_arg . '))) {', 'if (exists $params->{' . $init_arg . '}) {', 'push @aliases, \'' . $init_arg . '\';', '}', 'if (@aliases > 1) {',
[ 0.11080770939588547, -0.05269874632358551, 0.7347536683082581, -0.04381353035569191, 0.10892529040575027, 0.38607165217399597, 0.6209761500358582, -0.19667337834835052, -0.027580583468079567, -0.4996452331542969, -0.3925584852695465, 0.39412713050842285, -0.22637717425823212, 0.21161621809...
$self->_inline_throw_error( '"Conflicting init_args: (" . join(", ", @aliases) . ")"', ) . ';', '}', '$params->{' . $init_arg . '} = delete $params->{$aliases[0]};', '}',
[ 0.16530971229076385, 0.1704617291688919, 0.40550678968429565, 0.1032882109284401, -0.16295520961284637, 0.28418925404548645, 0.7991905808448792, -0.503227174282074, -0.009103858843445778, -0.22837798297405243, 0.1283237338066101, 0.7194839715957642, -0.5969085693359375, -0.2311744689941406...
@orig_source, ); }; 1; __END__ ``` Finally the `Moose::Exporter` glue. ``` package MooseX::AltInitArg; use Moose(); use Moose::Exporter; use MooseX::AltInitArg::Meta::Trait::Attribute; Moose::Exporter->setup_import_methods( class_metaroles => { class => ['MooseX::AltInitArg::Meta::Trait::Class'] } ); 1; _...
[ -0.2314561903476715, 0.12245304137468338, 0.5994030833244324, -0.01087137870490551, -0.060660943388938904, 0.054562684148550034, 0.43317654728889465, -0.4662435054779053, -0.45385992527008057, -0.6399592757225037, -0.29109159111976624, 0.44378095865249634, -0.5120896697044373, -0.203788861...
have solely to do with maximizing performance) you bite off a lot of work when you dive in. Good luck.
[ 0.3448382616043091, 0.008452940732240677, -0.013772556558251381, 0.11627621203660965, 0.0948987528681755, -0.39501720666885376, 0.6782147884368896, 0.3909045457839966, -0.1763094812631607, -0.49343204498291016, 0.027225082740187645, 0.920795202255249, 0.22663196921348572, -0.28711920976638...
I have a couple of small packaged apps on the Chrome Web Store (that's packaged, not hosted, so I'm not hosting anything myself). I was wondering whether I can still use Google Analytics, and how to test whether it's working before publishing the app. I'm guessing the answer might be no, because their [FAQ](https://de...
[ 0.5189467072486877, 0.3546699285507202, 0.371618390083313, 0.11038879305124283, -0.06523265689611435, 0.09134167432785034, 0.17989501357078552, -0.06403083354234695, -0.41960570216178894, -0.6347463726997375, 0.08717743307352066, 0.655128002166748, 0.02318376488983631, -0.27836528420448303...
of small differences. First, I did not modify in any way the code that I copied from GA. Second, I pasted my GA ID in the app publishing form in my developer dashboard (go to developer dashboard, click edit for the app in question, then find the GA field). I hope this might help: <http://code.google.com/chrome/extensio...
[ 0.3090613782405853, 0.15316468477249146, 0.25096598267555237, -0.08948672562837601, -0.32467740774154663, 0.48105812072753906, 0.24114295840263367, -0.10201138257980347, -0.3347095251083374, -0.45880037546157837, 0.3030414581298828, 0.7287684082984924, -0.07094095647335052, -0.079678751528...
I have to multiply a very small sized matrix ( size - 10x10 ) with a vector several times 50000 to 100000 times ( could even be more than that). This happens for 1000 different matrices (could be much more). Would there be any significant performance gain by doing this operation on CUDA. Yes, it's an ideal task for the...
[ 0.2473221868276596, 0.1843172162771225, 0.41393938660621643, 0.049768444150686264, 0.01327492855489254, 0.15728265047073364, -0.2230568677186966, -0.33795180916786194, -0.26278990507125854, -0.6843990087509155, 0.31467878818511963, 0.3889458179473877, -0.1462157964706421, 0.240758016705513...
I have a table as below: ``` id value ------------------------- 1 1 5 1 7 1 8 4 ``` I can't get to table as below: ``` id value ------------------------- 1
[ -0.07015535980463028, 0.5392091274261475, 0.3113703429698944, -0.14584656059741974, 0.06055239215493202, 0.017774982377886772, -0.0005116303800605237, -0.1365591585636139, -0.02587411180138588, -0.47583940625190735, 0.13310427963733673, 0.5607612729072571, -0.1010533794760704, 0.2209980636...
1 8 4 ``` The SQL is ``` select id,value from table_1 group by id_a ``` All you have here is a simple `MIN()` aggregate. ``` SELECT MIN(id), value AS id FROM table_1 GROUP BY value ```
[ -0.17070047557353973, 0.27726316452026367, 0.10653446614742279, -0.1990727037191391, -0.3351728022098541, 0.20161351561546326, -0.1469181478023529, -0.23622727394104004, 0.023229671642184258, -0.36050644516944885, 0.11176718026399612, 0.5092423558235168, -0.2273912876844406, 0.031288783997...
I'm creating a old school music emulator for the old GWBasic `PLAY` command. To that end I have a tone generator and a music player. Between each of the notes played I'm getting a chirp sound that mucking things up. Below are both of my classes: **ToneGen.h** ``` #import <Foundation/Foundation.h> @interface ToneGen ...
[ 0.18375669419765472, -0.05368424206972122, 0.42215853929519653, 0.02648879773914814, 0.26273006200790405, 0.13199841976165771, 0.020488690584897995, -0.4278832674026489, 0.01690235175192356, -0.6978211402893066, 0.04883768409490585, 0.8660435080528259, -0.2837354242801666, 0.37103110551834...
AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
[ -0.28147825598716736, 0.007263635750859976, 0.49410295486450195, 0.2568490505218506, 0.02261671982705593, -0.03351433575153351, 0.15869413316249847, -0.1391885131597519, 0.296467661857605, -0.7408744692802429, -0.32740676403045654, 0.9677751064300537, -0.3201984763145447, 0.104990378022193...
UInt32 inNumberFrames, AudioBufferList *ioData); void ToneInterruptionListener(void *inClientData, UInt32 inInterruptionState); @interface ToneGen() @property (nonatomic) AudioComponentInstance toneUnit; @property (nonatomic) NSTimer *timer; - (void)createToneUnit;...
[ 0.11850032210350037, -0.2565971314907074, 0.2434672713279724, -0.14786815643310547, 0.05805758759379387, 0.27622005343437195, 0.1123533770442009, -0.8988205790519714, 0.18227830529212952, -0.40007129311561584, -0.005446916911751032, 0.997357189655304, -0.2719048857688904, 0.194796696305274...
[super init]; if (self) { self.sampleRate = 44100; self.frequency = 1440.0f; return self; } return nil; } - (void)play:(float)ms { [self play]; self.timer = [NSTimer scheduledTimerWithTimeInterval:(ms / 100)
[ 0.20473819971084595, -0.435170978307724, 0.463752806186676, -0.23753564059734344, 0.30217722058296204, 0.23571209609508514, 0.45952850580215454, -0.5757047533988953, -0.30491429567337036, -0.3968628942966461, 0.04838215187191963, 0.6596487760543823, -0.29332616925239563, 0.2179661393165588...
target:self selector:@selector(stop)
[ -0.007049242500215769, -0.35999736189842224, -0.1324983537197113, -0.26136696338653564, -0.215542271733284, 0.5025281310081482, 0.33277109265327454, -0.17752543091773987, -0.23017285764217377, -0.5579906105995178, -0.1309729665517807, 0.5971871018409729, -0.2885633707046509, 0.090684823691...
userInfo:nil repeats:NO]; [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; } - (void)play { if (!self.toneUnit) { [self createToneUnit]; // Stop changing parameters
[ -0.15634474158287048, -0.25599876046180725, 0.33152449131011963, -0.38620781898498535, 0.5767581462860107, 0.19028276205062866, 0.4941854774951935, -0.12050148099660873, -0.04608931392431259, -0.5454407930374146, -0.07355422526597977, 1.150577425956726, -0.3768232762813568, -0.027840601280...
on the unit OSErr err = AudioUnitInitialize(self.toneUnit); if (err) DLog(@"Error initializing unit"); // Start playback err = AudioOutputUnitStart(self.toneUnit); if (err) DLog(@"Error starting unit"); } } - (void)stop { [self.timer invalidate];...
[ -0.2189660519361496, 0.011595070362091064, 0.39042410254478455, -0.20629602670669556, 0.3483271300792694, 0.20142120122909546, 0.28598591685295105, -0.31880828738212585, 0.01962277851998806, -0.31502559781074524, -0.359172523021698, 1.3048477172851562, 0.028848830610513687, 0.4251618385314...
(self.toneUnit) { AudioOutputUnitStop(self.toneUnit); AudioUnitUninitialize(self.toneUnit); AudioComponentInstanceDispose(self.toneUnit); self.toneUnit = nil; } if(self.delegate && [self.delegate respondsToSelector:@selector(toneStop)]) { [self.delegate performSelect...
[ -0.16731804609298706, 0.011650781147181988, 0.5545702576637268, -0.2816762626171112, 0.19726067781448364, 0.41606777906417847, 0.5912962555885315, -0.6225362420082092, 0.19775880873203278, -0.43368053436279297, -0.5450900793075562, 1.3422698974609375, -0.2282874882221222, -0.03893217444419...
// Get the default playback output unit AudioComponent defaultOutput = AudioComponentFindNext(NULL, &defaultOutputDescription); if (!defaultOutput) DLog(@"Can't find default output"); // Create a new unit based on this that we'll use for output OSErr err = AudioComponentInstanceNew(defaultOutpu...
[ -0.2077648937702179, -0.15218457579612732, 0.8706338405609131, -0.19388282299041748, 0.2664279341697693, 0.33381566405296326, 0.22551403939723969, -0.2729804813861847, 0.19607767462730408, -0.7321752309799194, -0.28648191690444946, 1.0890003442764282, -0.09841744601726532, 0.22842638194561...
= (__bridge void*)self; err = AudioUnitSetProperty(self.toneUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
[ -0.09234731644392014, 0.2269214540719986, 0.43838581442832947, -0.4199005365371704, 0.34820541739463806, 0.45646169781684875, 0.470043808221817, -0.38209420442581177, 0.1874271035194397, -0.5415350794792175, -0.13828544318675995, 1.1345826387405396, -0.19851616024971008, -0.076155893504619...
0, &input, sizeof(input)); if (err) DLog(@"Error setting callback"); // Set the format to 32 bit, single channel, floating point, linear PCM
[ -0.30647724866867065, -0.04913362115621567, 0.6082019805908203, -0.1990499645471573, 0.2550465762615204, 0.21832004189491272, -0.23102010786533356, 0.002051405608654022, -0.22826425731182098, -0.22224950790405273, -0.25512903928756714, 0.6903491616249084, -0.10396820306777954, 0.1599282026...
const int four_bytes_per_float = 4; const int eight_bits_per_byte = 8; AudioStreamBasicDescription streamFormat; streamFormat.mSampleRate = self.sampleRate; streamFormat.mFormatID = kAudioFormatLinearPCM; streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInter...
[ -0.17472608387470245, 0.11038142442703247, 0.6319740414619446, -0.19851285219192505, 0.12358551472425461, 0.21934713423252106, 0.5138383507728577, -0.6833017468452454, -0.11165208369493484, -0.22063136100769043, -0.4517165720462799, 0.8665367960929871, -0.18738752603530884, 0.1075932085514...
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0,
[ -0.29892244935035706, -0.019057657569646835, -0.06579966098070145, 0.2536287009716034, -0.11870911717414856, 0.677266001701355, -0.04882284626364708, 0.24493685364723206, 0.06663341820240021, -0.6243420243263245, -0.35882094502449036, 0.23363274335861206, -0.31727129220962524, 0.3436571359...
&streamFormat, sizeof(AudioStreamBasicDescription)); if (err) DLog(@"Error setting stream format"); } @end OSStatus RenderTone( void *inRefCon,
[ -0.10406546294689178, -0.11121755838394165, 0.5431192517280579, -0.16717436909675598, 0.3854077458381653, 0.09734341502189636, 0.5392696857452393, -0.16137193143367767, 0.32038506865501404, -0.6080803275108337, -0.34511521458625793, 1.0005080699920654, -0.1869373768568039, 0.36790937185287...
AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
[ -0.28147825598716736, 0.007263635750859976, 0.49410295486450195, 0.2568490505218506, 0.02261671982705593, -0.03351433575153351, 0.15869413316249847, -0.1391885131597519, 0.296467661857605, -0.7408744692802429, -0.32740676403045654, 0.9677751064300537, -0.3201984763145447, 0.104990378022193...
UInt32 inNumberFrames, AudioBufferList *ioData) { // Fixed amplitude is good enough for our purposes const double amplitude = 0.25; // Get the tone parameters out of the view controller ToneGen *toneGen =
[ -0.16934961080551147, -0.5000095963478088, 0.6883320808410645, -0.13336880505084991, 0.11352071911096573, -0.12166011333465576, 0.3377467095851898, -0.3786572813987732, 0.053593870252370834, -0.3888356685638428, -0.08148514479398727, 0.941591739654541, -0.4247782826423645, -0.1243196949362...
(__bridge ToneGen *)inRefCon; double theta = toneGen.theta; double theta_increment = 2.0 * M_PI * toneGen.frequency / toneGen.sampleRate; // This is a mono tone generator so we only need the first buffer const int channel = 0; Float32 *buffer = (Float32 *)ioData->mBuffers[channel].mData; // Ge...
[ 0.07403071224689484, -0.21106567978858948, 0.3231378197669983, -0.25287705659866333, -0.04875991865992546, 0.5249708890914917, 0.21773988008499146, -0.7708000540733337, 0.07145839184522629, -0.30236515402793884, 0.15941724181175232, 0.6941968202590942, -0.28468382358551025, 0.2509651482105...
+= theta_increment; if (theta > 2.0 * M_PI) { theta -= 2.0 * M_PI; } } // Store the theta back in the view controller toneGen.theta = theta; return noErr; } void ToneInterruptionListener(void *inClientData, UInt32 inInterruptionState) { ToneGen *toneGen = (__br...
[ -0.3249453902244568, -0.525875985622406, 0.8104420304298401, -0.12209918349981308, 0.11494375020265579, 0.22856402397155762, 0.07596174627542496, -0.3243909180164337, -0.1685103178024292, -0.6578293442726135, -0.12375666946172714, 0.8979763388633728, -0.28149208426475525, 0.196355268359184...
stop; @end ``` **Music.m** ``` #import "Music.h" #import "ToneGen.h" @interface Music() @property (nonatomic, readonly) ToneGen *toneGen; @property (nonatomic, assign) int octive; @property (nonatomic, assign) int tempo; @property (nonatomic, assign) int length; @property (nonatomic, strong) NSData *music; @proper...
[ -0.11200454831123352, -0.3064441382884979, 0.20086973905563354, -0.07996974885463715, 0.1652718335390091, 0.2022063136100769, 0.1138625219464302, -0.6278880834579468, -0.21950547397136688, -0.5045351982116699, -0.5205663442611694, 0.8564083576202393, -0.2895353138446808, 0.1278006434440612...
octive = 0; if (octive > 6) octive = 6; _octive = octive; } @synthesize tempo = _tempo; - (void)setTempo:(int)tempo { // Sinity Check if (tempo < 30) tempo = 30; if (tempo > 255) tempo = 255; _tempo = tempo; } @synthesize length = _length; - (void)setLength:(int)length { ...
[ -0.14031802117824554, -0.556481659412384, 0.413429856300354, 0.0002576722763478756, -0.06809340417385101, 0.3179613947868347, -0.07794167846441269, -0.6353899836540222, -0.37099581956863403, -0.36163172125816345, -0.17566607892513275, 0.7798365950584412, -0.2862791121006012, -0.04377410933...
length = 1; if (length > 64) length = 64; _length = length; } @synthesize music = _music; @synthesize dataPos = _dataPos; @synthesize isPlaying = _isPlaying; - (id)init { self = [super init]; if (self) { self.octive = 4; self.tempo = 120; self.length = 1; ret...
[ -0.13231711089611053, -0.2466060221195221, 0.506939709186554, -0.08239544928073883, 0.13508014380931854, 0.30816900730133057, 0.14519411325454712, -0.7220728397369385, -0.3595956563949585, -0.3704475164413452, 0.09844529628753662, 0.8461615443229675, -0.06824101507663727, -0.01508960127830...
return nil; } - (void) play:(NSString *)music { DLog(@"%@", music); self.music = [[music stringByReplacingOccurrencesOfString:@"+" withString:@"#"] dataUsingEncoding: NSASCIIStringEncoding]; self.dataPos = 0; self.isPlaying = YES; [self playNote]; } - (void)stop { self.isPlay...
[ 0.04615182802081108, -0.20297014713287354, 0.5046586990356445, -0.3752584755420685, 0.2776889204978943, 0.03624675050377846, 0.3244709074497223, -0.3580096364021301, -0.4305807948112488, -0.5113579034805298, -0.41290444135665894, 0.94294273853302, -0.22801043093204498, 0.2632127106189728, ...
return; } unsigned char *data = (unsigned char*)[self.music bytes]; unsigned int code = (unsigned int)data[self.dataPos]; self.dataPos++; switch (code) { case 65: // A case 66: // B case 67: // C case 68: // D case 69: // E
[ -0.02641579881310463, 0.14550958573818207, 0.3407670557498932, -0.214272141456604, 0.27028435468673706, 0.4043939411640167, 0.1868252456188202, -0.7351605892181396, -0.1541595160961151, -0.14571258425712585, -0.15412761270999908, 0.6994749903678894, -0.1455211639404297, 0.13283762335777283...
case 70: // F case 71: // G { // Peak at the next char to look for sharp or flat bool sharp = NO; bool flat = NO;
[ -0.3663941025733948, -0.06229197606444359, 0.28166499733924866, -0.6739201545715332, -0.09488441795110703, 0.2086254507303238, 0.2771707773208618, 0.09110832214355469, 0.014557727612555027, -0.2277374118566513, -0.5562936067581177, 0.8048354387283325, -0.3699510991573334, -0.19121307134628...
if (self.dataPos < self.music.length) { unsigned int peak = (unsigned int)data[self.dataPos]; if (peak == 35) // # {
[ -0.12906233966350555, -0.20222942531108856, 0.46910127997398376, -0.03294689953327179, 0.045462466776371, 0.12419235706329346, 0.21383774280548096, -0.428036630153656, -0.1719980239868164, 0.17719677090644836, 0.10485269129276276, 0.894653856754303, -0.1933615803718567, -0.1661547720432281...
self.dataPos++; sharp = YES; } else if (peak == 45) // -
[ -0.05772535875439644, -0.2895423173904419, 0.4586068391799927, -0.09673655033111572, 0.054819051176309586, 0.10169932246208191, 0.4007336497306824, -0.45058438181877136, 0.13400483131408691, -0.196955144405365, 0.24281196296215057, 0.9092997908592224, -0.23677407205104828, -0.2981030344963...
{ self.dataPos++; flat = YES; } }
[ -0.23793552815914154, -0.3352503776550293, 0.38532426953315735, 0.044616732746362686, 0.14426825940608978, 0.2570038437843323, 0.06698161363601685, -0.22159980237483978, -0.045343708246946335, -0.36507806181907654, 0.011930329725146294, 0.9657713770866394, -0.20825031399726868, -0.21878196...
// Peak ahead for a length changes bool look = YES; int count = 0; int newLength = 0; while (self.dataPos < self.music.length && look) {
[ -0.15210780501365662, -0.43614888191223145, 0.7469320297241211, -0.3004909157752991, 0.2800059914588928, 0.1473424881696701, 0.4731203317642212, -0.343214750289917, -0.28132396936416626, -0.16427388787269592, -0.14145901799201965, 1.0317721366882324, 0.09412334114313126, -0.133020192384719...
unsigned int peak = (unsigned int)data[self.dataPos]; if (peak >= 48 && peak <= 57) { peak -= 48;
[ 0.13870450854301453, -0.32927143573760986, 0.37790969014167786, -0.36245009303092957, 0.03860630840063095, -0.084427110850811, 0.5242047309875488, -0.554009735584259, 0.03585395589470863, 0.057619646191596985, -0.10511940717697144, 0.6743254065513611, -0.38142162561416626, -0.3394536375999...
int n = (count * 10); if (n == 0) { n = 1; } newLength += peak * n; self.dataPos++;
[ -0.17327150702476501, -0.4299717843532562, 0.4343361556529999, -0.3829430341720581, 0.09516748040914536, -0.05512688308954239, 0.4503965973854065, -0.44016653299331665, -0.3382108807563782, -0.18907521665096283, -0.09648770838975906, 0.5655027627944946, -0.3875313103199005, -0.093355916440...
} else { look = NO; } } // Pick
[ -0.16278903186321259, -0.40399667620658875, -0.2883860468864441, -0.36087003350257874, 0.29663679003715515, 0.1412326693534851, -0.09663145989179611, -0.06103425472974777, -0.017510080710053444, -0.305541068315506, -0.09059620648622513, 0.634408175945282, -0.06939447671175003, -0.000513702...
the note length int length = self.length; if (newLength != 0) { DLog(@"InlineLength: %d", newLength); length =
[ -0.05569347366690636, -0.04927898943424225, 0.6489696502685547, -0.3699793517589569, 0.047183360904455185, 0.1273122876882553, 0.44694197177886963, -0.2814028859138489, 0.019436318427324295, -0.47163572907447815, 0.0931997001171112, 0.6848261952400208, -0.06543901562690735, 0.1206243261694...
newLength; } // Create the note string NSString *note = [NSString stringWithFormat:@"%c", code]; if (sharp) note = [note stringByAppendingFormat:@"#"];
[ -0.0915863886475563, -0.2503316104412079, 0.5230216979980469, -0.5999576449394226, 0.24342386424541473, 0.006147568579763174, 0.38131242990493774, -0.3646864593029022, -0.11646074056625366, -0.5454224944114685, -0.34134042263031006, 0.5252093076705933, -0.029321346431970596, 0.168346256017...
else if (flat) note = [note stringByAppendingFormat:@"-"]; // Set the tone generator freq [self setFreq:[self getNoteNumber:note]]; // Play the note
[ -0.06019672006368637, -0.12851986289024353, 0.5784514546394348, -0.5290957093238831, 0.013433602638542652, 0.11622046679258347, -0.02061394788324833, -0.39990469813346863, 0.12533894181251526, -0.4527560770511627, -0.21856072545051575, 1.0446394681930542, 0.026985876262187958, -0.124890260...
[self.toneGen play:(self.tempo / length)]; } break; case 76: // L (length) { bool look = YES; int newLength = 0;
[ -0.032897092401981354, -0.3050520420074463, 0.41423168778419495, -0.7464408278465271, 0.29591789841651917, 0.18183794617652893, 0.285953551530838, -0.4270983636379242, -0.23956705629825592, -0.32802796363830566, -0.42399173974990845, 0.7882011532783508, -0.08206679672002792, -0.03821874409...
while (self.dataPos < self.music.length && look) { unsigned int peak = (unsigned int)data[self.dataPos]; if (peak >= 48 && peak <= 57) { peak -= 48;
[ 0.010171448811888695, -0.11743969470262527, 0.5468506217002869, -0.17797520756721497, 0.2005683183670044, 0.1674649566411972, 0.44367697834968567, -0.4628843665122986, -0.10177534818649292, 0.1583319753408432, -0.04210714250802994, 0.8667747378349304, -0.0911809653043747, -0.09013406932353...
newLength = newLength * 10 + peak; self.dataPos++; } else { look = NO; }
[ -0.35023006796836853, -0.5201056599617004, 0.7261987924575806, -0.39996862411499023, 0.07471673935651779, 0.003825284307822585, 0.404653936624527, -0.2768140435218811, -0.3802279829978943, -0.47351711988449097, -0.19079452753067017, 0.7551315426826477, -0.23294976353645325, -0.062487907707...
} self.length = newLength; DLog(@"Length: %d", self.length); [self playNote]; } break; case 79: // O (octive) {
[ -0.27471044659614563, -0.15232619643211365, 0.27379849553108215, -0.3925912380218506, 0.5386525988578796, 0.08513814955949783, 0.2933020293712616, -0.21200144290924072, -0.2569364607334137, -0.4877104163169861, -0.2596231698989868, 0.7804824113845825, -0.16959775984287262, -0.0309415068477...
bool look = YES; int newOctive = 0; while (self.dataPos < self.music.length && look) { unsigned int peak = (unsigned int)data[self.dataPos]; if (peak >= 48 && peak <=
[ -0.07378150522708893, -0.2257368117570877, 0.6910123229026794, -0.38098734617233276, 0.08156111091375351, 0.19697940349578857, 0.5730999112129211, -0.48795002698898315, -0.15210288763046265, -0.10381493717432022, -0.35149282217025757, 0.8633617758750916, -0.11890486627817154, -0.0396638624...
57) { peak -= 48; newOctive = newOctive * 10 + peak;
[ 0.18501338362693787, -0.3559563159942627, 0.3665613532066345, -0.3008895516395569, 0.18641872704029083, 0.17632216215133667, 0.6059615015983582, -0.7231852412223816, -0.10169149935245514, -0.10645415633916855, -0.2805290222167969, 0.28633788228034973, -0.3778378367424011, 0.064704455435276...
self.dataPos++; } else { look = NO; } }
[ -0.171909898519516, -0.2768867313861847, 0.2567102611064911, -0.08824696391820908, 0.018431052565574646, 0.08225196599960327, 0.3375536799430847, -0.25762468576431274, -0.0023066592402756214, -0.5741686224937439, 0.19957353174686432, 0.7344692945480347, -0.48293232917785645, -0.13155074417...
self.octive = newOctive; DLog(@"Octive: %d", self.self.octive); [self playNote]; } break; case 84: // T (tempo) {
[ -0.23491594195365906, -0.3840799629688263, 0.17305751144886017, -0.277439683675766, 0.34724703431129456, 0.09972766041755676, 0.30040350556373596, -0.22387586534023285, -0.09616358578205109, -0.44255775213241577, -0.30413320660591125, 0.9727014899253845, -0.17074359953403473, -0.1933482140...
bool look = YES; int newTempo = 0; while (self.dataPos < self.music.length && look) { unsigned int peak = (unsigned int)data[self.dataPos]; if (peak >= 48 && peak <= 57)
[ -0.17652036249637604, -0.17796413600444794, 0.6254919171333313, -0.3690076172351837, -0.09995163232088089, 0.32357972860336304, 0.60300612449646, -0.42553332448005676, -0.1730998456478119, -0.09467829018831253, -0.37052440643310547, 0.7533276677131653, -0.06596224755048752, -0.192039564251...
{ peak -= 48; newTempo = newTempo * 10 + peak; self.dataPos++;
[ -0.27543407678604126, -0.4282226860523224, 0.4222724735736847, -0.21791794896125793, -0.11438945680856705, 0.15586256980895996, 0.4909282922744751, -0.31535035371780396, -0.10711084306240082, -0.06540324538946152, 0.02060188725590706, 0.8503538370132446, -0.3414022922515869, -0.47564709186...
} else { look = NO; } } self.tempo = newTempo;
[ -0.5071386694908142, -0.5072814226150513, 0.023571597412228584, -0.49508136510849, 0.07035667449235916, -0.012032762169837952, 0.22620290517807007, -0.11694199591875076, -0.014556770212948322, -0.45405665040016174, -0.029402010142803192, 0.984340488910675, -0.0994165688753128, -0.204705998...
DLog(@"Tempo: %d", self.self.tempo); [self playNote]; } break; default: [self playNote]; break; } } - (int)getNoteNumber:(NSString*)note {
[ -0.3523389399051666, -0.29942086338996887, 0.458484023809433, -0.2282707691192627, 0.1043863445520401, -0.010282905772328377, 0.3440229594707489, -0.17551875114440918, -0.2673373222351074, -0.8485918641090393, -0.4253482222557068, 0.8101403117179871, -0.08930152654647827, -0.05301797389984...
note = [note uppercaseString]; DLog(@"%@", note); if ([note isEqualToString:@"A"]) return 0; else if ([note isEqualToString:@"A#"] || [note isEqualToString:@"B-"]) return 1; else if ([note isEqualToString:@"B"] || [note isEqualToString:@"C-"]) return 2; else if ([note isEqua...
[ -0.35976988077163696, 0.022294582799077034, 0.4807366728782654, -0.37787342071533203, -0.14671121537685394, 0.023934664204716682, 0.3589215874671936, -0.5951380133628845, 0.13001683354377747, -0.45212239027023315, -0.5975480675697327, 0.5789757966995239, -0.18733666837215424, -0.0738205686...
else if ([note isEqualToString:@"D"]) return 5; else if ([note isEqualToString:@"D#"] || [note isEqualToString:@"E-"]) return 6; else if ([note isEqualToString:@"E"] || [note isEqualToString:@"F-"]) return 7; else if ([note isEqualToString:@"F"] || [note isEqualToString:@"E#"]) ...
[ -0.5138277411460876, 0.008667612448334694, 0.2751139998435974, -0.05396833270788193, -0.07075247913599014, 0.17373254895210266, 0.43209490180015564, -0.6046708226203918, 0.11625625193119049, -0.4968947768211365, -0.4902770519256592, 0.7887685298919678, -0.07334504276514053, -0.138337060809...
return 10; else if ([note isEqualToString:@"G#"]) return 11; } - (void)setFreq:(int)note { float a = powf(2, self.octive); float b = powf(1.059463, note); float freq = roundf((275.0 * a * b) / 10); self.toneGen.frequency = freq; } - (void)toneStop { [self playNote]; } @end ``` To pl...
[ -0.01873675547540188, 0.0552062913775444, 0.5280857086181641, -0.2611522078514099, 0.2872315049171448, 0.25190913677215576, 0.035447265952825546, -0.5677857995033264, -0.23237013816833496, -0.5223663449287415, -0.30515414476394653, 1.0725452899932861, -0.2008967101573944, -0.12797845900058...
L4 O4 BB P4 GG P4 O3 C#C#EB L2 B L4 O4 BB P4 F+F+ P4 O3 DDF#A L2 O4 D L4 O5 DD P4O4 AA P4 O3 DDF#A L2 O4 D L4 O5 DD P4O4 BB P4 EEG L8 B P8 ML B1 L4 MN G#A ML L3 O5 F#1L4 MN D O4 F# ML L2 F# MN L4 E ML L2 B MN L4 AD P8 D8 D4"]; ``` Any idea on how to remove the chirp between notes? I think that the bit where you stop ...
[ -0.2483803927898407, 0.3844760060310364, 0.3983296751976013, -0.4429435133934021, -0.04460084065794945, 0.3110598027706146, 0.6096859574317932, -0.3461509048938751, -0.009294786490499973, -0.2748580873012543, -0.22755104303359985, 0.6994566917419434, -0.16350659728050232, 0.227883964776992...
AudioUnitUninitialize(self.toneUnit); AudioComponentInstanceDispose(self.toneUnit); self.toneUnit = nil; } ``` Just leave the tone unit active and you'll have less chirping. You'll need some other way to generate silence, probably by having RenderTone continue to run but generate amplitude zero. I was able t...
[ 0.08487829566001892, -0.021902738139033318, 0.5622380375862122, -0.1420263946056366, 0.1349932998418808, -0.11984796822071075, 0.48718535900115967, -0.12902867794036865, 0.14138555526733398, -0.5797622203826904, -0.05393579229712486, 1.0550392866134644, -0.2136378139257431, 0.1196729987859...
can probably get the old-school effect without the chirps. Here's my fading `RenderTone` function (currently using evil global variables): ``` double currentFrequency=0; double currentSampleRate=0; double currentAmplitude=0; OSStatus RenderTone( void *inRefCon, AudioUnitRende...
[ -0.1111157089471817, -0.04037607088685036, 0.6947303414344788, -0.21592432260513306, 0.37834641337394714, 0.046853527426719666, 0.6766191720962524, 0.00878910906612873, 0.1260751187801361, -0.4684327244758606, -0.1152823194861412, 0.8111393451690674, -0.20057322084903717, 0.400526672601699...
UInt32 inBusNumber, UInt32 inNumberFrames,
[ -0.5108815431594849, -0.3783325254917145, 0.19764475524425507, 0.08789575845003128, -0.036997806280851364, 0.1490437239408493, -0.08701962977647781, 0.15129199624061584, -0.03379804641008377, -0.9960228800773621, -0.22657008469104767, 0.45459163188934326, -0.3008357882499695, 0.11725234985...
AudioBufferList *ioData) { // Fixed amplitude is good enough for our purposes const double amplitude = 0.5; // Get the tone parameters out of the view controller ToneGen *toneGen = (__bridge ToneGen *)inRefCon; double theta = toneGen.theta; BOOL fadingOut = NO; if ((currentFre...
[ -0.12948206067085266, -0.5542211532592773, 0.8886715173721313, 0.014583715237677097, 0.1434185951948166, -0.292936772108078, 0.3664860725402832, -0.4830135703086853, 0.10918116569519043, -0.3826563358306885, -0.11922023445367813, 0.9969457387924194, -0.3604898154735565, 0.1787763386964798,...
{ fadingOut = YES; } else { currentFrequency = toneGen.frequency; currentSampleRate = toneGen.sampleRate; } } double theta_increment = 2.0 * M_PI * currentFrequency /currentSampleRate; //
[ -0.06533706933259964, -0.7917222380638123, 0.514761745929718, -0.30546778440475464, 0.36761003732681274, 0.11815834790468216, 0.36738911271095276, -0.3721943795681, 0.10430896282196045, -0.23243318498134613, -0.0712728276848793, 0.5737721920013428, -0.20351143181324005, 0.2402246594429016,...
This is a mono tone generator so we only need the first buffer const int channel = 0; Float32 *buffer = (Float32 *)ioData->mBuffers[channel].mData; // Generate the samples for (UInt32 frame = 0; frame < inNumberFrames; frame++) { buffer[frame] = sin(theta) * currentAmplitude; //NSL...
[ -0.13182903826236725, -0.27291712164878845, 0.4097001254558563, -0.3016810417175293, -0.15622131526470184, 0.5448930859565735, 0.3000223934650421, -0.812421977519989, 0.2013484388589859, -0.21096430718898773, 0.16141223907470703, 0.6113980412483215, -0.31533750891685486, 0.1466007083654403...
{ theta -= 2.0 * M_PI; } if (fadingOut) { if (currentAmplitude > 0) { currentAmplitude -= 0.001;
[ -0.14030000567436218, -0.7570666074752808, 0.6909770965576172, -0.6200993061065674, 0.49707889556884766, -0.029725058004260063, 0.355550080537796, -0.3624204993247986, 0.2467343956232071, -0.48433706164360046, -0.4177106022834778, 0.6161413192749023, -0.18956618010997772, 0.193151861429214...
if (currentAmplitude < 0) currentAmplitude = 0; } } else { if (currentAmplitude < amplitude) {
[ -0.47341057658195496, -0.6620994210243225, 0.576991081237793, -0.33817335963249207, 0.26289427280426025, -0.07692933827638626, 0.009554607793688774, -0.669175386428833, -0.05136222764849663, -0.08997812122106552, -0.1668526828289032, 0.9134419560432434, -0.3251194357872009, -0.031693059951...
currentAmplitude += 0.001; if (currentAmplitude > amplitude) currentAmplitude = amplitude; } } } // Store the theta back in the view controller toneGen.theta = theta;
[ -0.4639984369277954, -0.7287952303886414, 0.7672327160835266, -0.19167214632034302, 0.15038172900676727, 0.11044292896986008, 0.15053798258304596, -0.20179255306720734, 0.14487487077713013, -0.36531251668930054, 0.035495661199092865, 0.9213324785232544, -0.33377546072006226, 0.049070835113...
return noErr; } ```
[ -0.40951472520828247, 0.1366811841726303, -0.08118795603513718, -0.34227949380874634, 0.047448258846998215, -0.05102895572781563, 0.3535272777080536, 0.16342714428901672, 0.27079707384109497, -0.3279731273651123, -0.5048785209655762, 0.8225445747375488, -0.35446345806121826, 0.275525122880...
I would like the user to be able to edit the title of the navigation bar. I feel like I've seen it in an app before. Is this possible? If you are using a `UINavigationController` then play around with ``` self.navigationItem.titleView = // UITextView ```
[ 0.3481244742870331, 0.058567389845848083, 0.7270443439483643, 0.1513623595237732, 0.23095931112766266, -0.37863948941230774, 0.23520134389400482, 0.11039505153894424, 0.1972360461950302, -0.9533379077911377, -0.08831153064966202, 0.7734622955322266, 0.14759521186351776, 0.34770697355270386...
I want to use the actual pointer address (not marked volatile) to an object to uniquely identify the object. Is this a bad thing to do? In general does system memory management move the objects and hence it's address about or is the pointer stable? Thanks Your pointer is guaranteed to remain stable for the life of th...
[ 0.14958608150482178, 0.32616880536079407, 0.3706657886505127, 0.3516700267791748, 0.270207017660141, -0.12906093895435333, 0.19993017613887787, 0.11954375356435776, -0.33831390738487244, -0.43119412660598755, -0.022529611364006996, 0.5894131064414978, -0.013646113686263561, 0.1476769894361...
Wikipedia defines `XMPP` as: > ...an open-standard communications protocol for message-oriented middleware based on XML. xmpp.org defines `XMPP` as: > The Extensible Messaging and Presence Protocol (XMPP) is an open XML technology for real-time communication, which powers a wide range of applications. Although I'm ...
[ 0.40859436988830566, 0.13805446028709412, 0.47297340631484985, 0.08083108067512512, -0.33525484800338745, -0.28449109196662903, 0.16883626580238342, 0.06536725163459778, -0.4034108519554138, -0.669293224811554, -0.37838977575302124, 0.25428542494773865, -0.4192989468574524, -0.138235241174...
tier? If so, **how**?!?! A good, King's-English explanation of XMPP, along with some practical examples (preferable MOM-centric) would be greatly appreciated. Thanks in advance! XMPP can be used for a wide range of messaging based applications. Basically, it provides core services which can be used to build XML based ...
[ 0.22103367745876312, -0.07108089327812195, 0.6162760257720947, 0.3534192740917206, -0.3605058789253235, -0.1459091603755951, -0.051469869911670685, -0.09294123947620392, -0.32206279039382935, -0.49258390069007874, -0.2515469789505005, 0.21032392978668213, -0.28390800952911377, -0.054658804...
chat, gaming, systems control, geolocation, middleware/cloud computing, data syndication * bots (weather, database interface, system monitoring) messaging modes/patterns... * point-to-point messaging is used to send to a specific receiver * multi-user messaging is used to message to a group of receivers * publish/sub...
[ 0.08597055077552795, -0.2529725432395935, 0.41000744700431824, 0.2842341661453247, -0.254829466342926, -0.019077137112617493, 0.0914376825094223, 0.018708065152168274, -0.49185657501220703, -0.5608780384063721, -0.5444700121879578, 0.1207093745470047, -0.5087650418281555, -0.10262075811624...
requests addressed to the user * XMPP Server plugins - deployed as part of the server plugin architecture * XMPP Components - service external to an XMPP server that connects and behaves like a plugin Java Integration * [Smack API](http://www.igniterealtime.org/projects/smack/) - A pure Java library, it can be embedd...
[ 0.4215754568576813, -0.2491808384656906, 0.20354431867599487, 0.39245572686195374, -0.30743473768234253, -0.10965948551893234, 0.017401112243533134, -0.3120238184928894, -0.07559134811162949, -0.5534412264823914, -0.00031574073364026845, 0.43744224309921265, -0.3106071650981903, -0.1681097...
applications via XML messaging and XMPP APIs * whether its the best technology choice depends heavily upon requirements * one good use case, interactive system monitoring/management...[here are some other examples](http://wiki.xmpp.org/web/XMPP_Case_Studies) Also, XMPP integration with Camel is trivial. See this [came...
[ -0.040723301470279694, -0.266637921333313, 0.1986360400915146, 0.4537285268306732, -0.3106764853000641, -0.08213827013969421, 0.26558658480644226, -0.31657862663269043, -0.2409781962633133, -0.5455207228660583, -0.3156648576259613, 0.5593186020851135, -0.5316261053085327, -0.18667759001255...
I am playing with a toy problem (Convex hull identification) and needed lexicographic sorting twice already. One of the cases was given a list of `type Point = { X: float; Y: float }`, I would like to sort by X coordinate, and in case of equality, by Y coordinate. I ended up writing the following: ``` let rec lexiC...
[ 0.0452437587082386, 0.06839966773986816, 0.3058014512062073, -0.10283748805522919, -0.10018014162778854, 0.1088704988360405, -0.10250194370746613, -0.14594028890132904, -0.03183465078473091, -0.46640196442604065, -0.010270293802022934, 0.3337218463420868, -0.37720179557800293, 0.2300013601...
lexiCompare tail a b let xComparer p1 p2 = if p1.X > p2.X then 1 else if p1.X < p2.X then -1 else 0 let yComparer p1 p2 = if p1.Y > p2.Y then 1 else if p1.Y < p2.Y then -1 else 0 let coordCompare = lexiCompare [ yComparer; xComparer ] ``` Which allows me to do ``` let lowest (points: Point...
[ -0.33966705203056335, 0.045546211302280426, 0.40357527136802673, -0.23485171794891357, -0.04902678355574608, 0.31553125381469727, 0.1316167265176773, -0.19304755330085754, 0.21273796260356903, -0.2899070978164673, -0.027917353436350822, 0.5194500088691711, -0.22619204223155975, 0.092376530...
to create specific comparers returning -1, 0 or 1, and so far I can't see a straightforward way to use this in cases like List.minBy. Ideally, I would like to do something along the lines of providing a list of functions that can be compared (like [(fun p -> p.X); (fun p -> p.Y)]) and do something like lexicographic mi...
[ 0.1756128966808319, 0.007993567734956741, 0.0771060436964035, 0.30238649249076843, -0.47346433997154236, 0.2898366153240204, 0.11830593645572662, -0.07438783347606659, -0.08050530403852463, -0.7662377953529358, 0.13601477444171906, 0.7826213836669922, -0.14661625027656555, -0.1670857816934...
this incorrectly? F# does this for you automatically when you define a record type like yours: ``` > type Point = { X: float; Y: float };; type Point = {X: float; Y: float;} ``` You can immediately start comparing values. For example, defining a 3-element list of points and sorting it into lexicographic order ...
[ -0.0979195162653923, 0.09833967685699463, 0.39385825395584106, 0.05956488475203514, -0.002302282489836216, -0.026734042912721634, 0.1273985505104065, -0.47006556391716003, -0.27608463168144226, -0.47742101550102234, -0.010832740925252438, 0.421387255191803, -0.19510704278945923, 0.06263506...
Y = 3.0;}; {X = 2.0; Y = 2.0;}; {X = 2.0;
[ -0.16695845127105713, -0.06336406618356705, 0.3694155216217041, -0.4578484296798706, -0.12367230653762817, -0.08149470388889313, 0.3130040168762207, -0.0720285102725029, 0.19322748482227325, -0.029726725071668625, -0.6057438254356384, 0.6996597051620483, -0.26279154419898987, 0.20307388901...
Y = 3.0;}] ``` Note that the results were sorted first by `X` and then by `Y`. You can compare two values of any comparable type using the built-in `compare` function. If you want to use a custom ordering then you have two options. If you want to do all of your operations using your custom total order then it belon...
[ -0.1415616273880005, -0.06516940146684647, 0.16958573460578918, 0.1488858461380005, 0.013422379270195961, 0.33835482597351074, -0.09679897874593735, -0.34663471579551697, -0.2345840483903885, -0.5301428437232971, 0.08751289546489716, 0.5069023966789246, -0.3060362637042999, 0.1121198982000...
higher-order functions like `List.sortBy` and `List.sortWith`. For example, `List.sortBy (fun p -> p.Y, p.X)` will sort by `Y` and then `X` because F# generates the lexicographic comparison over 2-tuples for you (!). This is one of the big advantages of F#.
[ -0.36046481132507324, -0.35719016194343567, 0.29735472798347473, 0.13277924060821533, -0.40246495604515076, -0.04439307749271393, 0.06266256421804428, -0.08353202790021896, -0.27582958340644836, -0.5568004846572876, -0.45987674593925476, 0.6740232706069946, -0.3027527332305908, -0.20598548...
I want to get the home directory of a user of a unix system. Why doesn't the following work: ``` # sudo su $offender -c "bash -s < <(echo echo \$HOME)" sh: Syntax error: redirection unexpected ``` It works for me in Ubuntu and Fedora using `sudo su $offender -c "echo \$HOME"` You could also gouge it from your /etc/p...
[ 0.33215945959091187, 0.2322337031364441, 0.17306272685527802, -0.21563571691513062, 0.06077372655272484, 0.060319364070892334, 0.31231489777565, -0.07775135338306427, -0.06191980466246605, -0.8075130581855774, -0.1718408763408661, 0.5294833183288574, -0.1704285889863968, 0.2115196883678436...
Instead of showing the keyboard I want to display a popover view when a textField is selected (my code is at the bottom). If the keyboard isn't showing then everything works great. However, if the keyboard is showing and then the textfield is selected the keyboard doesn't get dismissed, somewhere the firstResponders mu...
[ -0.25334471464157104, 0.012593692168593407, 0.8008394241333008, -0.23536089062690735, -0.03015083260834217, 0.08385607600212097, 0.4214170277118683, -0.3484286665916443, -0.1967090219259262, -0.7485007643699646, -0.33227622509002686, 0.5058410167694092, -0.16109828650951385, 0.037133187055...
self; self.popoverController = [[UIPopoverController alloc] initWithContentViewController:datePickerVC]; [self.popoverController setDelegate:self]; [self.popoverController presentPopoverFromRect:CGRectMake(0, 0, 5, 5) inView:textField permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES]; } ``` This is...
[ -0.19509190320968628, 0.01552712731063366, 0.9123958945274353, -0.13283216953277588, -0.02064422518014908, -0.011815154924988747, 0.45705240964889526, -0.22666113078594208, 0.1574014127254486, -0.6225214600563049, -0.3838696777820587, 0.7963147163391113, -0.0973464623093605, 0.149735346436...
I have a table with a lot of rows, which makes the page scroll. There's some other content above the table. I would like to add a functionality using jQuery, to show div across the page top, as soon as the table scrolls to the point, where the top row disappears above the top border of the screen. I assume I'll add a ...
[ 0.05113333836197853, -0.096002496778965, 0.5521130561828613, 0.029162004590034485, -0.19058483839035034, -0.1806817352771759, -0.0023888954892754555, -0.1424410492181778, -0.16808335483074188, -0.8699519634246826, -0.103831946849823, 0.5238919258117676, -0.2700214982032776, 0.0651834085583...
your UITextFieldDelegate methods specifically UITextFieldShouldBeginEditing and return NO and execute the code to show the popover instead. This way the keyboard is never shown to begin with. ``` - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { [self.view endEditing:YES]; // added this in for case when...
[ -0.24291495978832245, -0.24134932458400726, 0.7862051129341125, -0.22713570296764374, -0.2638806700706482, -0.13056562840938568, 0.34850969910621643, 0.007091570179909468, 0.11625039577484131, -0.7909635305404663, -0.32694920897483826, 0.8322298526763916, -0.2999383509159088, 0.08570191264...
I want to create a non-stop spinning square using html and css. I currently have: ``` @-webkit-keyframes spinnow { 100% { transform: rotate(360deg); -webkit-transform: rotate(360deg); } } @-moz-keyframes spinnow { 100% { transform: rotate(360deg); -moz-transform: rotate(360d...
[ 0.30233606696128845, -0.1383768916130066, 0.7946341037750244, 0.06999281793832779, -0.3871823847293854, 0.19649983942508698, -0.018336191773414612, -0.09284771233797073, -0.10702777653932571, -0.6205791234970093, -0.024980224668979645, 0.2353326976299286, -0.21269270777702332, 0.5499107241...
} } ``` What I have currently got will make the square spin, but it will always stop after one full rotation, then start shortly afterwards. How do I make it continuously spin without stopping? N.B. I'm using @-webkit-keyframes, @-moz-keyframes and @-ms-keyframes. Thanks very much, Lucas It has nothing to do with ...
[ 0.11817812919616699, -0.09856758266687393, 0.6225658059120178, 0.22516214847564697, -0.22161033749580383, 0.18896155059337616, 0.009423923678696156, -0.08438935875892639, -0.44037845730781555, -0.4425533711910248, 0.08795881271362305, 0.4279666841030121, 0.0012720163213089108, 0.4030718803...
up and then slow down using the swing animation, but rather use a linear, smooth approach, so that the speed is distributed and does not make the square appear to stop. This keyword was the important one for me - I had the `infinite` keyword already. <http://jsfiddle.net/GXPS8/>
[ 0.20464779436588287, -0.3336792588233948, 0.5540556311607361, -0.25307396054267883, -0.406608521938324, -0.028923027217388153, -0.059862468391656876, -0.4942719042301178, -0.6937525868415833, -0.33006930351257324, -0.12166094034910202, 0.17483192682266235, -0.26434800028800964, -0.12872850...
In my upcoming iPhone game different scene elements are split up into their own CCNode. My Obstacle node contains many nodes, each representing an obstacle. Inside every obstacle node are the images that make up the obstacle (1 - 4 images), and there are only ~10 obstacles at a time. Every update my game calls the up...
[ -0.22045892477035522, -0.10653620958328247, 0.8515164852142334, 0.1922760307788849, 0.24448342621326447, 0.3738069236278534, 0.3154410421848297, -0.2320665866136551, -0.25830936431884766, -0.8110036849975586, 0.17346243560314178, 0.2893806993961334, -0.36278337240219116, -0.338351249694824...
way the Obstacle node does, but it has no noticeable effect on performance. But it has hundreds of images at a time. My question is why do the obstacles slow it down so much but the particles don't? I have even tried replacing the images used in the obstacles with the ones in the particles and it makes no (noticeable)...
[ 0.15889684855937958, -0.1653558611869812, 0.0756576657295227, 0.3834158480167389, -0.07199246436357498, 0.09685396403074265, 0.13975606858730316, 0.1209435760974884, -0.644869327545166, -0.8330327272415161, 0.35074812173843384, 0.28900471329689026, -0.22557517886161804, -0.1822287142276764...
require more processing between frames as they interact with the physics system and requiring node-specific rendering. The last time I looked at the render loop code, it was basically O(n) based on the number of CCnodes you had in a scene. Using NSTimers versus Cocos' built in run loop also makes quite a bit of differe...
[ 0.13743621110916138, 0.1398107260465622, 0.17339985072612762, 0.1183570921421051, 0.21642127633094788, 0.07468291372060776, 0.21975570917129517, -0.13998347520828247, -0.27461281418800354, -0.6432359218597412, 0.019901981577277184, 0.6131703853607178, -0.12922339141368866, -0.3518614172935...