text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
well no one that's sensible).
Also mentioned below is the use of `#undef` but that can quickly start to get messy if you use that macro a lot. | [
0.6000590324401855,
-0.16698162257671356,
0.0677647590637207,
0.002769489772617817,
-0.06297668069601059,
-0.18396228551864624,
0.2706861197948456,
0.012050150893628597,
-0.2891938388347626,
-0.5115422606468201,
0.04434986039996147,
0.7816399931907654,
-0.388414591550827,
0.109799712896347... | |
I am trying to use com.sun.crypto.provider.SunJCE (for HMAC) in an OSGi Bundle.
I am using the maven-bundle-plugin with these configs:
```
<Embed-Dependency>*;scope=runtime;inline=false</Embed-Dependency>
<Import-Package>*;resolution:=optional</Import-Package>
```
When i execute my bundle I get this error:
```
Cau... | [
0.2432340383529663,
-0.1799338310956955,
0.16568128764629364,
-0.11339754611253738,
0.27524515986442566,
-0.2677781879901886,
0.418177992105484,
-0.32144322991371155,
-0.1604824960231781,
-0.7242266535758972,
-0.26514849066734314,
0.5473935008049011,
-0.43511584401130676,
-0.08324691653251... | |
It's only appropriate for dependencies which are genuinely optional.
Of course, your ultimate aim is to not fail at all, rather than just failing faster. As a starting point to understanding what's happening, have you opened up your built bundle and checked that the crypto packages are actually being embedded? It's a ... | [
0.41346776485443115,
-0.08690205216407776,
-0.3781893253326416,
-0.0232456736266613,
0.30668729543685913,
-0.310019314289093,
0.46075913310050964,
-0.13458207249641418,
0.07763160765171051,
-0.48287785053253174,
-0.28392958641052246,
0.7960022687911987,
-0.1428080052137375,
-0.339958727359... | |
property instead of embedding the dependency. | [
-0.03956940770149231,
-0.013189075514674187,
-0.09506192803382874,
-0.06597407907247543,
-0.03307091072201729,
-0.311097115278244,
0.41122204065322876,
-0.08138783276081085,
0.31943151354789734,
-0.5550455451011658,
-0.11703148484230042,
0.47343313694000244,
-0.1310056746006012,
0.46354663... | |
Given a SSRS report definition file with an embedded image in it, just wondering if its possible to extract that image XML to recreate the original image file.
e.g. :
inside the rdlc file, you might see xml like this :
```
<EmbeddedImage Name="tick">
<MIMEType>image/bmp</MIMEType>
<ImageData>Qk1mAwAAAAAAADYAA... | [
0.331126868724823,
-0.315373957157135,
-0.020695332437753677,
0.17657925188541412,
-0.2565101981163025,
0.005575459450483322,
-0.03021490015089512,
-0.42535772919654846,
-0.29928821325302124,
-0.5475523471832275,
0.0021448589395731688,
0.3983098566532135,
-0.17394040524959564,
-0.037468593... | |
detailed in [this blog post](http://beyondrelational.com/modules/2/blogs/65/posts/11587/extracting-images-from-ssrs-reports.aspx):
1. Copy the encoded image from one report to another if you need to reuse it there.
2. Export a copy of the report to Excel and copy the image from the spreadsheet.
Or if you need access ... | [
0.24708698689937592,
-0.055759530514478683,
0.12072739005088806,
0.2174038589000702,
-0.11379817128181458,
-0.16381517052650452,
0.0012512124376371503,
-0.05054660513997078,
-0.19826407730579376,
-0.5526111125946045,
-0.2593109607696533,
0.5329810976982117,
-0.23412123322486877,
-0.1827422... | |
I have a cache directory I'm trying to have ignored by git which lives in my CMS's root directory here:
```
/files/cache/
```
I've tried the following variations in a .gitignore file at the root of the project:
```
/files/cache
/files/cache/*
files/cache
files/cache/*
```
But the files still show up in Tower read... | [
0.39386501908302307,
0.18186192214488983,
0.43738722801208496,
0.04579399526119232,
-0.4217584729194641,
-0.00714749563485384,
0.36624547839164734,
0.09793082624673843,
-0.701587975025177,
-0.6965677738189697,
0.15140315890312195,
0.5284736156463623,
-0.16364192962646484,
0.010021119378507... | |
you'd have to untrack them and commit the deletion, first.
2. In Tower's "Status" view, which view mode do you use?
If we're talking about folders (not only individual files) matched by a pattern, "ALL" mode will continue to show the folder as untracked (while also hiding individual files). "MODIFIED" will hide the mat... | [
0.2187771201133728,
-0.3404737114906311,
0.5245751142501831,
0.08065204322338104,
0.196492537856102,
-0.07916790246963501,
0.2611966133117676,
-0.19667987525463104,
-0.31690266728401184,
-0.5210208296775818,
-0.13420359790325165,
0.4120914936065674,
-0.5062786340713501,
-0.1528449952602386... | |
I am making a website where I want to use range slider(I know it only supports webkit browsers).
I have integrated it fully and works fine. But I would like to use a `textbox` to show the current slide value.
I mean if initially the slider is at value 5, so in text box it should show as 5, when I slide the value in t... | [
0.30948418378829956,
-0.17064258456230164,
0.6800318360328674,
0.011774744838476181,
-0.2829548120498657,
-0.20391356945037842,
0.020136699080467224,
-0.2019907683134079,
-0.07517450302839279,
-0.9093120694160461,
0.07889494299888611,
0.8691189289093018,
-0.20580103993415833,
-0.0369138978... | |
document.getElementById('textInput').value=val;
}
```
```html
<input type="range" name="rangeInput" min="0" max="100" onchange="updateTextInput(this.value);">
<input type="text" id="textInput" value="">
``` | [
-0.03170417249202728,
-0.14723920822143555,
0.8772464990615845,
-0.0895630270242691,
-0.10877185314893723,
0.009930250234901905,
0.2501268684864044,
-0.3560662567615509,
-0.002320311265066266,
-0.8461601138114929,
-0.4413238763809204,
0.7337738275527954,
-0.13088937103748322,
-0.1177399158... | |
How can I convert 3D image to 2D image in order to view it without using a 3D glasses?

Update:
- I have no solution at the moment, but, you know, you can imagine that if you have a 3d image you will wear the glass to your camera and take another ... | [
0.6321943402290344,
0.060341183096170425,
0.45299428701400757,
0.2213817685842514,
-0.05090199038386345,
0.10995002835988998,
0.3006419539451599,
-0.22954528033733368,
-0.18622896075248718,
-0.8098324537277222,
0.12117720395326614,
0.5408703684806824,
-0.020116031169891357,
0.1288718134164... | |
case), polarization ( <http://en.wikipedia.org/wiki/Polarized_3D_glasses> ), animation ( <http://en.wikipedia.org/wiki/File:Home_plate_anim.gif> ) etc. The point is that 3d is two different images. There is no real way to merge them to one. If you have source images (e.g. separate images for right and lelft) you can ju... | [
0.11240178346633911,
-0.06865531951189041,
0.5195394158363342,
0.15015116333961487,
-0.2903013527393341,
0.2570857107639313,
-0.19492854177951813,
-0.3082541525363922,
-0.2024991363286972,
-0.8321729898452759,
-0.06757131963968277,
0.5448053479194641,
-0.2085336297750473,
0.218025520443916... | |
Basically I am using some open source code called OrderedDictionary that is derived from NSMutableDictionary. Then I want to save the ordered dictionary data to NSUserDefaults by adding encode and decode method to the OrderedDictionary class. However, I realized the encode and decode methods are not being called, as a ... | [
-0.09787677228450775,
-0.07484124600887299,
0.5675830245018005,
-0.19121335446834564,
-0.012339241802692413,
0.04258127510547638,
0.26647815108299255,
-0.1744193434715271,
-0.019037457183003426,
-0.8300265669822693,
-0.021638531237840652,
0.5076369047164917,
-0.5530681014060974,
0.07154017... | |
[coder encodeObject:array forKey:@"array"];
}
/**
* decode the object
*/
- (id)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self != nil)
{
dictionary = [coder decodeObjectForKey:@"dictionary"];
array = [coder decodeObjectForKey:@"array"];
}
return se... | [
-0.24263621866703033,
-0.1484891176223755,
0.42459407448768616,
-0.2688663899898529,
-0.07226058840751648,
0.17409086227416992,
0.3507435619831085,
-0.6205253005027771,
-0.10918030887842178,
-0.40243208408355713,
-0.37170156836509705,
0.5820965766906738,
-0.22532151639461517,
-0.0149478185... | |
forKey:@"myDictionary"];
}
else
{
NSUserDefaults *currentDefaults = [NSUserDefaults standardUserDefaults];
NSData *savedDictionary = [currentDefaults objectForKey:@"myDictionary"];
if (savedDictionary != nil)
{
OrderedDictionary *oldData = [NSKeyedUnarchiver unarchiveObjectWithData:savedDictio... | [
-0.4056594967842102,
-0.21390804648399353,
0.630700945854187,
-0.21516914665699005,
0.34442341327667236,
0.27509263157844543,
0.5019744038581848,
-0.14036154747009277,
-0.30553510785102844,
-0.4565177261829376,
-0.3457864820957184,
0.4208016097545624,
-0.11116281151771545,
0.54095983505249... | |
NSLog(@"Final contents of the retrieved: %@", oldData);
}
}
}
```
The thing is, the final retrievedDictionary does NOT have the original data order and the encode and decode methods are not called at all.
Thanks for any help in advance! :)
There's an NSObject method called `-classForCoder` that you nee... | [
-0.28610071539878845,
0.02353658154606819,
0.30893364548683167,
-0.11983107030391693,
0.06388694792985916,
-0.1336180418729782,
0.4205794036388397,
0.05337310954928398,
-0.17527367174625397,
-0.5500354170799255,
-0.2636614441871643,
0.3521076738834381,
-0.3059794008731842,
-0.0712204128503... | |
>
> The class to substitute for the receiver's own class during coding.
>
>
> Discussion
>
> This method is invoked by NSCoder. NSObject’s
> implementation returns the receiver’s class. The private subclasses of
> a class cluster substitute the name of their public superclass when
> being archived.
That las... | [
0.037098292261362076,
-0.1952047348022461,
0.09379395097494125,
-0.02783820405602455,
-0.08834762126207352,
0.09258010238409042,
0.2984808087348938,
-0.21737954020500183,
0.055287908762693405,
-0.6085309386253357,
-0.342276930809021,
0.5216190814971924,
-0.39832109212875366,
0.007345090154... | |
`[super initWithCoder:]` (or `[super encodeWithCoder:'`). I also changed the key strings to avoid collisions.
```
- (id)initWithCoder:(NSCoder *)coder
{
if (self != nil)
{
dictionary = [[coder decodeObjectForKey:@"OrderedDictionary_dictionary"] retain];
array = [[coder decodeObjectForKey:@"Orde... | [
-0.3446185886859894,
-0.006923481822013855,
0.4464024305343628,
-0.23725555837154388,
-0.13131871819496155,
0.20003873109817505,
0.5727583765983582,
-0.5763071179389954,
-0.025571301579475403,
-0.44165685772895813,
-0.03732680529356003,
0.7604730725288391,
-0.033751316368579865,
-0.0125871... | |
Up to a few days ago, Eclipse was working fine in locating the javadoc for base classes such as Java.io.File. Recently, though, hovering over these classes only yields a message indicating that the source and javadoc are missing:
"Note: This element has no attached source and the Javadoc could not be found in the atta... | [
0.25208383798599243,
0.04843069240450859,
0.0638781487941742,
0.041870176792144775,
-0.08634178340435028,
-0.3250989317893982,
0.4381074011325836,
-0.09731823205947876,
-0.23614853620529175,
-0.789567768573761,
-0.07120291143655777,
0.7176870703697205,
-0.04772622883319855,
0.2104127556085... | |
then specify the Javadoc location (as well as the source location).
 | [
-0.34667912125587463,
0.03694537654519081,
0.17370471358299255,
-0.31563282012939453,
0.3376111090183258,
-0.2735897898674011,
0.1857338398694992,
-0.18522915244102478,
-0.16456381976604462,
-0.5163425803184509,
-0.4149116575717926,
0.1836199164390564,
-0.2758127450942993,
0.02269661054015... | |
I am developing a website in Drupal, and my development directory tree is as follows:
```
modules
-->moduleA
-->moduleA.inc
-->moduleA.info
-->moduleA.php
-->moduleB
-->moduleB.inc
-->moduleB.info
-->moduleB.php
themes
-->themeA
-->themeA.info
... | [
0.17181828618049622,
0.13198943436145782,
0.8683260083198547,
-0.2490740567445755,
0.08752361685037613,
-0.07694067806005478,
-0.21847647428512573,
-0.09436644613742828,
-0.24812199175357819,
-0.5033209323883057,
-0.2402932494878769,
0.13536937534809113,
0.03048912063241005,
0.295161753892... | |
-->themeB.info
-->page.tpl.php
ShellScripts
-->scriptA.sh
-->scriptB.sh
legacyPerlScripts
-->script1.pl
-->script2.pl
```
There is no large development team; I am developing all the modules and themes myself. The modules and themes are somewhat independent, and each has its own version number.... | [
0.15944311022758484,
0.1110064834356308,
0.7195219397544861,
-0.05647433176636696,
-0.2122698575258255,
-0.10689043253660202,
0.10420788079500198,
-0.3823804557323456,
-0.31212761998176575,
-0.5958369970321655,
-0.14167320728302002,
0.11981412023305893,
0.044509585946798325,
0.071855224668... | |
module B may depend on a new feature in module A.
What is the best practice for using git for revision control? The options as I see them are:
1. Put everything in one large, monolithic repository.
2. Create a separate repository for each module, theme and script directory.
3. Use git-slave (gits) to create subprojec... | [
0.43018701672554016,
-0.14292113482952118,
-0.0021830499172210693,
0.16934514045715332,
0.009427463635802269,
-0.18108932673931122,
0.13908569514751434,
-0.5485279560089111,
-0.1985550820827484,
-0.4749632179737091,
-0.16171066462993622,
0.6337408423423767,
-0.27752888202667236,
0.24934341... | |
I guess that *mostly* works in your case, but it's not how classes are supposed to go.
Classes contain functions (methods) and data. For example, you have a ball:
```
class Ball(object):
# __init__ is a special method called whenever you try to make
# an instance of a class. As you heard, it initializes the o... | [
0.002677426440641284,
-0.09036405384540558,
-0.18050232529640198,
0.21660327911376953,
-0.24610266089439392,
-0.09523981064558029,
0.06237519532442093,
0.24327601492404938,
-0.02038441225886345,
-0.7300901412963867,
-0.07596475630998611,
0.3369961678981781,
-0.2352490872144699,
0.101210750... | |
self.position = (100, 100)
self.velocity = (0, 0)
# We can also add our own functions. When our ball bounces,
# its vertical velocity will be negated. (no gravity here!)
def bounce(self):
self.velocity = (self.velocity[0], -self.velocity[1])
```
Now we have a `Ball` class. How can we use ... | [
-0.013564825057983398,
0.020319046452641487,
0.8167139887809753,
0.09791985899209976,
-0.22677163779735565,
0.0753895565867424,
0.0551130436360836,
-0.4017128348350525,
-0.29330208897590637,
-0.5534186959266663,
0.18014658987522125,
0.5252247452735901,
-0.08653758466243744,
-0.041976425796... | |
but what's the advantage over a global variable? If you have another `Ball` instance, it will remain independent:
```
>>> ball2 = Ball()
>>> ball2.velocity = (5, 10)
>>> ball2.position
(100, 100)
>>> ball2.velocity
(5, 10)
```
And `ball1` remains independent:
```
>>> ball1.velocity
(0, 0)
```
Now what about that ... | [
-0.059291355311870575,
-0.017707915976643562,
0.46217843890190125,
0.387455016374588,
-0.048249535262584686,
-0.05619877949357033,
-0.11134733259677887,
-0.24607126414775848,
-0.27512603998184204,
-0.7583118677139282,
0.16801969707012177,
0.33928123116493225,
-0.2689737379550934,
0.0316851... | |
make a room. Rooms have names, so we'll have some data to store that:
```
class Room(object):
# Note that we're taking an argument besides self, here.
def __init__(self, name):
self.name = name # Set the room's name to the name we got.
```
And let's make an instance of it:
```
>>> white_room = Room... | [
0.03212149813771248,
0.30986079573631287,
0.21170689165592194,
-0.125318244099617,
0.054952532052993774,
0.018051907420158386,
0.5146934986114502,
-0.30811527371406555,
-0.2704099416732788,
-0.5950539112091064,
-0.3956749439239502,
-0.2205483317375183,
-0.47209176421165466,
0.5360336899757... | |
you can add more functionality or override the superclass's functionality.
Let's think about what we want to do with rooms:
> We want to interact with rooms.
And how do we do that?
> The user types in a line of text that gets responded to.
How it's responded do depends on the room, so let's make the room handle th... | [
0.16346292197704315,
0.009021854028105736,
0.14757156372070312,
0.2900392413139343,
-0.19302769005298615,
-0.0952906385064125,
0.49430832266807556,
0.02484547719359398,
-0.006203580182045698,
-0.814662754535675,
-0.17137861251831055,
-0.060259100049734116,
-0.35938116908073425,
0.258643120... | |
self.name = 'White Room'
def interact(self, line):
if 'test' in line:
print "'Test' to you, too!"
```
Now let's try interacting with it:
```
>>> white_room = WhiteRoom() # WhiteRoom's __init__ doesn't take an argument (even though its superclass's __init__ does; we overrode the superclass's... | [
-0.1052825003862381,
-0.038681596517562866,
0.11725257337093353,
-0.06247936934232712,
-0.33256635069847107,
0.075480155646801,
0.4057052731513977,
-0.2972472608089447,
0.02213270403444767,
-0.9752249717712402,
0.04834838956594467,
0.06814424693584442,
-0.6747491359710693,
0.14806252717971... | |
but I'm going to use one for simplicity.
```
class RedRoom(Room): # A red room is also a kind of room.
def __init__(self):
self.name = 'Red Room'
def interact(self, line):
global current_room, white_room
if 'white' in line:
# We could create a new WhiteRoom, but then it
... | [
-0.2631106376647949,
-0.07387958467006683,
0.19451655447483063,
0.23507100343704224,
0.06670721620321274,
0.010492365807294846,
0.2146291434764862,
0.27296870946884155,
-0.23980313539505005,
-0.7520139217376709,
-0.15155893564224243,
-0.011990628205239773,
-0.30524128675460815,
0.345446020... | |
(if it had any) after moving
# out of it and into it again.
current_room = white_room
```
Now let's try that:
```
>>> red_room = RedRoom()
>>> current_room = red_room
>>> current_room.name
'Red Room'
>>> current_room.interact('go to white room')
>>> current_room.name
'White Room'
```
**Exer... | [
-0.06636065244674683,
-0.15107718110084534,
0.42257609963417053,
-0.014983298256993294,
0.020518383011221886,
-0.09280429035425186,
0.20121756196022034,
-0.2935897409915924,
-0.37781593203544617,
-0.8865349292755127,
-0.13929903507232666,
0.14044135808944702,
-0.3180901110172272,
0.2236136... | |
the prompt!
```
def play_game():
global current_room
while True:
line = raw_input(current_room.name + '> ')
current_room.interact(line)
```
You might also want to make a function to reset the game:
```
def reset_game():
global current_room, white_room, red_room
white_room = WhiteRoom... | [
-0.38875165581703186,
-0.3200722932815552,
0.4583560824394226,
-0.10966597497463226,
0.2443440556526184,
-0.05318019539117813,
0.11011607944965363,
0.15168407559394836,
-0.07931166142225266,
-0.919094443321228,
-0.39537039399147034,
0.7092365622520447,
-0.4430240988731384,
0.10502354055643... | |
Room> test
'Test' to you, too!
White Room> go to red room
Red Room> go to white room
White Room>
```
To be able to play the game just by running the Python script, you can add this at the bottom:
```
def main():
reset_game()
play_game()
if __name__ == '__main__': # If we're running as a script...
main(... | [
0.1984286904335022,
-0.022374378517270088,
-0.04113936796784401,
-0.07994997501373291,
0.3364909887313843,
-0.2168716937303543,
0.36960384249687195,
0.0777137354016304,
-0.12607398629188538,
-0.6547820568084717,
-0.2548116445541382,
0.507747232913971,
-0.30433472990989685,
-0.1219303309917... | |
I have a table called routes within my database where each route has an origin and destination.
Given any origin, I want to be able to return a list of destinations that can be reached directly from this origin OR from any destination that links with this origin.
How can I do this in Ruby?
```
def find_available_route... | [
0.23643505573272705,
0.19674307107925415,
0.4503372013568878,
-0.1247006431221962,
0.18534377217292786,
0.09609445929527283,
0.09694480150938034,
-0.09178293496370316,
-0.1446501910686493,
-0.7895219922065735,
-0.11736493557691574,
0.10789411514997482,
-0.2652469277381897,
0.20862996578216... | |
exactly be fast, but depending on the needs of your application, it should be acceptable. Caching would be a simple option. | [
0.3493036925792694,
-0.2384776622056961,
-0.014269132167100906,
0.19702908396720886,
0.1425475925207138,
-0.20878973603248596,
-0.2653692364692688,
-0.029311619699001312,
0.0552036426961422,
-0.6585034728050232,
-0.051423829048871994,
0.5459125638008118,
-0.07453568279743195,
-0.1853961646... | |
My question is simple. When data is as below,
```
var1 var2 var3
10 40 60
15 10 5
```
I want to add a new column `MaxValueVar` that returns index of a column that has maximum value among `var1`, `var2` and `var3`. That is, I want to make a table as below.
```
var1 var2 var3 MaxVal... | [
-0.18053290247917175,
0.34932759404182434,
0.5029740929603577,
-0.04039015620946884,
-0.11924634873867035,
0.2618178427219391,
0.022695738822221756,
-0.46506503224372864,
-0.09545889496803284,
-0.5219928622245789,
-0.011593535542488098,
0.5639479160308838,
-0.21304401755332947,
-0.16896185... | |
3
15 10 5 1
```
In R I would use:
```
apply(vector, 1, which.max)
```
How can I accomplish this using SAS?
One Solution for your reference according to the sample you provide here. You didn't mention how to deal with ties. Here for ties, the first occurrence is fetched.
```
data test;
input var1 v... | [
0.12858639657497406,
-0.05958352982997894,
0.4759266674518585,
-0.3336975872516632,
-0.17067566514015198,
0.11365243792533875,
0.6386544108390808,
-0.8943512439727783,
0.16351614892482758,
-0.6169669032096863,
-0.4425926208496094,
0.5223914384841919,
-0.387776255607605,
0.00700366869568824... | |
do i=1 to dim(vars);
if maxvaluevar=0 then maxvaluevar=i*(maxvalue=vars(i))+maxvaluevar;
end;
drop i maxvalue;
run;
``` | [
0.1618349254131317,
-0.41025596857070923,
0.607246994972229,
-0.51798415184021,
0.20556966960430145,
-0.10848457366228104,
0.7469285726547241,
-0.5215423703193665,
0.17155563831329346,
-0.2957734763622284,
-0.482083797454834,
0.7962884902954102,
-0.25415167212486267,
0.4523276090621948,
... | |
I am creating a Java Server using Socket. I would like to print the URL the client applciation requested when contacting the server. That is, if the client requests: <https://your.server.com?usr=user_name>, I would like to read this url from the server's end.
Thanks!
Middleware acts as a hook into Django's request/res... | [
0.45261168479919434,
0.18638013303279877,
0.12874487042427063,
-0.34904715418815613,
-0.2619897425174713,
-0.19682902097702026,
-0.07367830723524094,
0.06538080424070358,
-0.17785604298114777,
-0.7197001576423645,
0.2624475061893463,
0.4142361283302307,
-0.32092517614364624,
0.104177720844... | |
local, and so on.
Read more on [Middleware](https://docs.djangoproject.com/en/dev/topics/http/middleware/).
Context processors just modify the context. Context is a key value mapping with variables passed to a template. A context processor takes a request object as its argument, and returns a dictionary of items tha... | [
-0.09082318842411041,
-0.0644264966249466,
0.3042891025543213,
-0.00418351124972105,
-0.10218024253845215,
0.23379135131835938,
-0.1090051531791687,
0.030520273372530937,
-0.19883954524993896,
-0.6927617192268372,
-0.1273803561925888,
0.6946572661399841,
-0.20175202190876007,
0.12539014220... | |
is a diagram that shows where middleware and context fit in in a typical django flow:

Django Flowchart
1. User requests a page
2. Request reaches Request Middlewares, which could manipulate or answer the request
3. The URLConffinds the related View... | [
0.018938591703772545,
-0.04274088144302368,
0.7681907415390015,
-0.055519089102745056,
-0.4912663400173187,
-0.05509936437010765,
-0.001114624203182757,
-0.27784493565559387,
0.1222524344921112,
-0.4408546984195709,
0.02690964750945568,
0.41973158717155457,
-0.30775555968284607,
0.18557664... | |
**Language:** vb.net
File size: 1GB, and stuff.
**Encoding of the text file:** UTF8 (so each character is represented by different numbers of bytes).
**Collation:** UnicodeCI (when several characters are essentially the same, the most popular version will be the one unique.). I think I know how to handle t his one.
... | [
0.051862578839063644,
-0.006459519732743502,
0.2619011104106903,
-0.11428274214267731,
-0.2942520081996918,
0.31386885046958923,
0.20068278908729553,
0.09773009270429611,
-0.24380190670490265,
-0.9355242848396301,
-0.19941577315330505,
0.06294799596071243,
-0.17163828015327454,
0.118307359... | |
Then we will check whether the same line shows up or not.
Is there special functions best for that?
Depending on how long the lines are, you may be able to compute an MD5 hash value for each line and store than in a `HashMap`:
```
Using sr As New StreamReader("myFile")
Dim lines As New HashSet(Of String)
Dim ... | [
0.19744111597537994,
-0.5318135619163513,
0.8596802949905396,
-0.12210369110107422,
0.1714848130941391,
0.03286946937441826,
0.19931617379188538,
-0.44852957129478455,
-0.1714152842760086,
-0.5864443778991699,
-0.21330271661281586,
0.4124087393283844,
-0.199474036693573,
0.1970961689949035... | |
If lines.Contains(hash) Then
'Lines are not unique
Exit While
Else
lines.Add(hash)
End If
End While
End Using
```
Untested, but this may be fast enough for your needs. I can't think of something much faster that still maintains some semblance of conciseness :) | [
-0.07485837489366531,
-0.05966746434569359,
0.40225881338119507,
0.07859735935926437,
-0.06268534809350967,
-0.1191430538892746,
0.4326157867908478,
-0.29416245222091675,
0.06493795663118362,
-0.6687405705451965,
-0.1620457023382187,
0.03137752041220665,
-0.31317323446273804,
0.35103103518... | |
I am trying to open the Twitter app from within my app in iOS 5, but it won't open. Any help would be appreciated, I have included the code I am using below.
```
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=TWITTER"]];
```
Please help me, and thanks in advance!
Do you want to launch t... | [
0.7043115496635437,
0.2412135750055313,
0.2867320477962494,
0.10165312886238098,
-0.11767484247684479,
0.22869262099266052,
0.4640079140663147,
0.2557826340198517,
0.017751196399331093,
-0.7863235473632812,
0.18329505622386932,
0.4106539487838745,
-0.3484911322593689,
-0.17427240312099457,... | |
show you how to use Twitter with the built in Twitter frameworks in iOS 5.
Now I recommend you download this sample code and see what else is required to send a tweet (like checking CanTweetStatus) but I'm attaching a basic idea of how to send a tweet in this post.
<https://developer.apple.com/library/ios/#samplecod... | [
0.5222319960594177,
-0.008099653758108616,
0.3070521950721741,
0.11912152916193008,
-0.26097166538238525,
-0.008801082149147987,
0.5125116109848022,
-0.00819662306457758,
0.009715243242681026,
-0.6189616322517395,
0.2950952351093292,
0.4192485809326172,
-0.45581772923469543,
-0.30980172753... | |
the user to use their Twitter accounts.
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
if(granted) {
// Get the list of Twitter accounts.
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
... | [
0.08649755269289017,
-0.11647063493728638,
0.6609341502189636,
0.0756300687789917,
0.15194502472877502,
0.22250041365623474,
0.5251191258430481,
0.08337832987308502,
-0.19691522419452667,
-0.5737420916557312,
0.12875445187091827,
0.6018278002738953,
-0.3408438265323639,
-0.1066147014498710... | |
ideally ask the user which account they want to tweet from, if there is more than one Twitter account present.
if ([accountsArray count] > 0) {
// Grab the initial Twitter account to tweet from.
ACAccount *twitterAccount = [accountsArray objectAtIndex:0];
// ... | [
0.1874966025352478,
-0.46704891324043274,
0.45260486006736755,
0.20004688203334808,
0.08501046150922775,
0.03720416873693466,
0.08815427124500275,
-0.2154737263917923,
0.08120524883270264,
-0.6223902702331543,
-0.09410785883665085,
0.5061120390892029,
-0.15123547613620758,
-0.4145707190036... | |
which in this example, posts a tweet to the user's timeline.
// This example uses version 1 of the Twitter API.
// This may need to be changed to whichever version is currently appropriate.
TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"htt... | [
-0.016755839809775352,
-0.2229718267917633,
0.4740208089351654,
-0.24976496398448944,
-0.15917322039604187,
-0.12096430361270905,
0.4792934060096741,
-0.0028109578415751457,
-0.33208346366882324,
-0.7048218846321106,
-0.21017447113990784,
0.20318974554538727,
-0.5083231329917908,
0.2570500... | |
// Set the account used to post the tweet.
[postRequest setAccount:twitterAccount];
// Perform the request created above and create a handler block to handle the response.
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSEr... | [
0.011531118303537369,
-0.27465498447418213,
0.14116716384887695,
-0.06121254339814186,
-0.29551368951797485,
0.2130872905254364,
0.6033586859703064,
-0.26825910806655884,
-0.1090906485915184,
-0.29306405782699585,
-0.2232683300971985,
0.2563784122467041,
-0.6398894190788269,
-0.17547369003... | |
NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];
[self performSelectorOnMainThread:@selector(displayText:) withObject:output waitUntilDone:NO];
}];
}
}
}];
}
```
Good Luck! | [
-0.5025633573532104,
0.0010088443523272872,
0.7304832935333252,
-0.4207528829574585,
0.14796392619609833,
0.008040685206651688,
0.790922224521637,
0.07119035720825195,
-0.2448597550392151,
-0.7282422184944153,
-0.3162321150302887,
0.609961748123169,
0.10906233638525009,
0.05829824134707451... | |
I have 2 forms set up. In the first form I have the following code.
```
frm_BL addBranch = new frm_BL();
do
{
addBranch.ShowDialog();
if (addBranch.txtAmount.Text == "")
{
break;
}
} while (true);
```
In the main form. And just this in the second form.
```
private void btnAccept_Click(ob... | [
0.13557904958724976,
0.06574869155883789,
0.8106526136398315,
-0.44215458631515503,
-0.0508919321000576,
-0.047451943159103394,
0.42452362179756165,
-0.22129665315151215,
-0.06871248036623001,
-0.6519995331764221,
-0.38788196444511414,
0.560053825378418,
-0.518556535243988,
0.1585432291030... | |
(addBranch.txtAmount.Text == "")
```
It closes the form. Can someone explain why that is?
The best way to do this is:
```
if (String.IsNullOrEmpty(addBranch.txtAmount.Text))
```
The `txtAmount.Text` property is a `string` containing the content of the textbox. If the textbox is empty then it's a zero-length strin... | [
0.009518475271761417,
0.3150334656238556,
0.3907381594181061,
-0.2657279670238495,
0.08940297365188599,
-0.47258123755455017,
0.24306917190551758,
0.1221807599067688,
0.027741197496652603,
-0.2815277576446533,
-0.45326951146125793,
0.6794058680534363,
-0.41397783160209656,
0.15218040347099... | |
string (equivalent to `String.Empty`), whereas `null` says the string doesn't exist. | [
-0.1881580799818039,
0.1063428446650505,
-0.32587307691574097,
-0.03555299714207649,
-0.20968852937221527,
-0.224577859044075,
0.3507139980792999,
0.3796162009239197,
-0.0539141446352005,
-0.06190021336078644,
-0.5661724209785461,
0.0756944864988327,
-0.4561218023300171,
0.5004234910011292... | |
Hi I have the following object:
```
Hashtable<Object, Double>
```
and I want to find the key of the maximum Double value in the table. Easiest way to do that?
Thanks
There is no built in function to get the maximum value out of a `Hashtable` you are going to have to loop over all the keys and manually determine the... | [
-0.18594780564308167,
-0.06204624101519585,
0.9087569713592529,
-0.1394283026456833,
0.008412305265665054,
-0.0010529966093599796,
0.3820640742778778,
-0.46978193521499634,
-0.05417788401246071,
-0.47019869089126587,
-0.11335474252700806,
0.4757874310016632,
-0.40866369009017944,
0.1005600... | |
To find more than 1 key for the max value
```
ArrayList<Object> maxKeys= new ArrayList<Object>();
Double maxValue = Double.MIN_VALUE;
for(Map.Entry<Object,Double> entry : table.entrySet()) {
if(entry.getValue() > maxValue) {
maxKeys.clear(); /* New max remove all current keys */
maxKeys.add(ent... | [
-0.1603352278470993,
-0.2864493131637573,
0.6909275054931641,
-0.24120324850082397,
0.4799778461456299,
0.019991373643279076,
0.19783204793930054,
-0.5646722316741943,
-0.2915136516094208,
-0.4941125810146332,
-0.48922738432884216,
0.7521653771400452,
-0.3403330147266388,
-0.04628413543105... | |
Ok I have this code:
```
//this is the hi.php//
<?php
//highlight items//
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("juliver", $con);
$result = mysql_query("SELECT * FROM hi WHERE pp='2'");
$hi = "";
while($row = mysql_fetch_array(... | [
-0.13067613542079926,
0.11362499743700027,
0.8308964967727661,
-0.2940942347049713,
-0.06281954795122147,
0.007036041934043169,
0.15590167045593262,
-0.37993931770324707,
-0.12314408272504807,
-0.6221652030944824,
-0.12722629308700562,
0.3177851438522339,
-0.26723816990852356,
0.1311044692... | |
echo $hi; ?>
</div>
</td>
```
But i get an error saying: "Warning: mysql\_fetch\_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\madeinusa\hi.php on line 13."
please, im stuck with this. Thank you in advance.
You probably have an error in your query `"SELECT * FROM hi WHERE pp='2'"`
... | [
0.12423030287027359,
-0.005888324696570635,
0.3835839331150055,
-0.31718647480010986,
-0.18992653489112854,
-0.07446815073490143,
0.6620836853981018,
-0.46742385625839233,
-0.09436313807964325,
-0.37506693601608276,
-0.12581786513328552,
0.6885277628898621,
-0.4956477880477905,
-0.12891730... | |
I have the following code to launch a file :
```
try {
path = fileJsonObject.getString("filePath");
if (path.indexOf("/") == 0) {
path = path.substring(1, path.length()); | [
0.14573176205158234,
-0.291007936000824,
0.5613585114479065,
-0.2493380457162857,
0.31514817476272583,
-0.3104259967803955,
0.457144558429718,
-0.4664091467857361,
0.2531038224697113,
-0.7267534136772156,
-0.3801783621311188,
0.5446228384971619,
-0.22787021100521088,
0.2575196623802185,
... | |
}
path = root + path;
final File fileToOpen = new File(path);
if (fileToOpen.exists()) {
if (fileToOpen.isFile()) { | [
-0.34122201800346375,
-0.27410081028938293,
0.691925585269928,
-0.16909094154834747,
0.6856353282928467,
-0.2041901797056198,
0.3965190649032593,
-0.16314156353473663,
-0.04812587797641754,
-0.8331301212310791,
-0.44393885135650635,
0.39721792936325073,
-0.22590002417564392,
0.278381407260... | |
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW);
myIntent.setData(Uri.parse(path));
final String pathToCheck = new String(path); | [
0.031616754829883575,
-0.2505512833595276,
0.9266926646232605,
-0.268045574426651,
0.09976469725370407,
0.3546682298183441,
0.5243176221847534,
-0.2986055016517639,
0.07128822058439255,
-0.7034632563591003,
-0.17521171271800995,
0.6914902329444885,
-0.3123685121536255,
-0.03926139697432518... | |
pathToCheck.toLowerCase();
if (pathToCheck.endsWith(".wav") || pathToCheck.endsWith(".ogg") || pathToCheck.endsWith(".mp3")
|| pathToCheck.endsWith(".mid") || pathToCheck.endsWith(".midi") || pathToCheck.endsWith(".amr")) { | [
-0.5232140421867371,
-0.13669994473457336,
0.5741720795631409,
-0.09999950230121613,
0.3840099573135376,
0.12274070084095001,
0.32094675302505493,
-0.36714881658554077,
-0.21329228579998016,
-0.39276257157325745,
-0.43292930722236633,
0.6644247174263,
0.17176154255867004,
0.193263977766037... | |
myIntent.setType("audio/*");
} else if (pathToCheck.endsWith(".mpg") || pathToCheck.endsWith(".mpeg") || pathToCheck.endsWith(".3gp")
|| pathToCheck.endsWith(".mp4")) { | [
-0.27140653133392334,
0.03130869194865227,
0.7671046257019043,
0.1265617460012436,
0.10796909779310226,
-0.03559071570634842,
0.46687695384025574,
-0.4527624249458313,
-0.3225271701812744,
-0.4973580837249756,
-0.43581423163414,
0.47669747471809387,
-0.5520324110984802,
0.12726904451847076... | |
myIntent.setType("video/*");
} else if (pathToCheck.endsWith(".jpg") || pathToCheck.endsWith(".jpeg") || pathToCheck.endsWith(".gif")
|| pathToCheck.endsWith(".png") || pathToCheck.endsWith(".bmp")) { | [
0.23445171117782593,
-0.18049795925617218,
0.6938315033912659,
0.22735635936260223,
0.20094262063503265,
-0.10328909754753113,
0.28984951972961426,
-0.1280011087656021,
-0.18342161178588867,
-0.5174381136894226,
-0.32627058029174805,
0.40363702178001404,
-0.29784420132637024,
0.10427118092... | |
myIntent.setType("image/*");
} else if (pathToCheck.endsWith(".txt") || pathToCheck.endsWith(".csv") || pathToCheck.endsWith(".xml")) {
Log.i("txt","Text fileeeeeeeeeeeeeeeeeeeeeeeeee");
myIntent.setType("text/*"); | [
-0.1634351909160614,
-0.1849309653043747,
0.7258096933364868,
0.022765984758734703,
0.32655951380729675,
-0.04239138588309288,
0.437356561422348,
-0.12110108882188797,
0.026357119902968407,
-0.7902548909187317,
-0.4351765811443329,
0.6835349202156067,
-0.1697654277086258,
0.043915729969739... | |
} else if (pathToCheck.endsWith(".gz") || pathToCheck.endsWith(".rar") || pathToCheck.endsWith(".zip")) {
myIntent.setType("package/*");
} else if (pathToCheck.endsWith(".apk")) { | [
-0.1456931084394455,
-0.14765842258930206,
0.23331530392169952,
-0.19823014736175537,
0.5519730448722839,
0.06715615093708038,
0.7051700949668884,
-0.4554625451564789,
-0.0028749031480401754,
-0.5414374470710754,
-0.4287867248058319,
0.5069378614425659,
-0.4898322820663452,
0.0005950012709... | |
myIntent.setType("application/vnd.android.package-archive");
}
((Activity) context).startActivityForResult(myIntent, RequestCodes.LAUNCH_FILE_CODE);
} else { | [
0.08185421675443649,
-0.16019617021083832,
0.4626754820346832,
-0.2373780459165573,
0.3178440034389496,
0.06286995857954025,
0.2644374966621399,
-0.21203608810901642,
0.11660543084144592,
-0.6132473945617676,
-0.40887895226478577,
0.4273653030395508,
-0.4545876681804657,
-0.011426494456827... | |
errUrl = resMsgHandler.errMsgResponse(fileJsonObject,
"Incorrect path provided. please give correct path of file");
return errUrl;
} | [
-0.7875268459320068,
-0.06070145592093468,
0.4339582622051239,
-0.4089720845222473,
0.10697288066148758,
0.3967145085334778,
0.6347891688346863,
-0.4489158093929291,
-0.05144723504781723,
-0.47991257905960083,
-0.3510175943374634,
0.5641041994094849,
-0.33729439973831177,
-0.02262315154075... | |
} else {
errUrl = resMsgHandler.errMsgResponse(fileJsonObject,"Incorrect path provided. please give correct path of file");
return errUrl;
}
} catch (Exception e) { | [
-0.49231356382369995,
-0.19319377839565277,
0.22390320897102356,
-0.31912046670913696,
0.2307080179452896,
0.13921423256397247,
0.5370193719863892,
-0.34866878390312195,
-0.1107339933514595,
-0.29607683420181274,
-0.3708968460559845,
0.5280060172080994,
-0.34968891739845276,
-0.03828155249... | |
e.printStackTrace();
Log.i("err","Unable to launch file" + " " + e.getMessage());
errUrl = resMsgHandler.errMsgResponse(fileJsonObject,
"Unable to launch file" + " " + e.getMessage());
return errUrl; | [
-0.4742427170276642,
-0.11867339164018631,
0.4822668433189392,
-0.20900684595108032,
0.25837984681129456,
0.1544370800256729,
0.4995168447494507,
-0.5031837224960327,
-0.2304752916097641,
-0.2788735032081604,
-0.7683663368225098,
0.36788901686668396,
-0.4086141586303711,
0.1886520981788635... | |
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
try {
if (requestCode == RequestCodes.LAUNCH_FILE_CODE) {
if (resultCode == RESULT_CANCEL... | [
0.06305066496133804,
-0.17153705656528473,
0.5603429079055786,
-0.1105140745639801,
0.2608870267868042,
-0.012042650952935219,
0.6112694144248962,
-0.5806052088737488,
0.337240606546402,
-0.2762143015861511,
-0.2830014228820801,
0.5203954577445984,
-0.37460577487945557,
0.13573509454727173... | |
String errUrl = responseMsgHandler.errMsgResponse(FileHandler.fileJsonObject, "Unable to launch file");
mWebView.loadUrl(errUrl);
} else if (resultCode == RESULT_OK) {
String successUrl = responseMsgHandler.launchfileResponse(FileHandler.fileJsonObject); | [
-0.4339539408683777,
-0.2171240895986557,
0.44551998376846313,
-0.34341302514076233,
0.01801121048629284,
0.30178534984588623,
0.4128987193107605,
-0.35942721366882324,
-0.12700264155864716,
-0.17019471526145935,
-0.723170816898346,
0.5627071857452393,
-0.32007360458374023,
0.2156957238912... | |
mWebView.loadUrl(successUrl);
}
```
Amd the result ctrl is at "if (resultCode == RESULT\_CANCELED)". So how to successfully launch this?
May be in short i am doing this:
```
final File fileToOpen = new File(path);
if (fileToOpen.exists()) {
if (fileToOpen.isFile()) {
Intent myIntent = new In... | [
0.26207610964775085,
-0.20191289484500885,
1.2995202541351318,
-0.0683358907699585,
0.2868293225765228,
-0.18310333788394928,
0.49834296107292175,
-0.6121681928634644,
-0.07896848767995834,
-0.81815505027771,
-0.26388877630233765,
0.8747572898864746,
-0.05011439323425293,
0.100450962781906... | |
Log.i("txt","Text fileeeeeeeeeeeeeeeeeeeeeeeeee");
myIntent.setType("text/*");
startActivityForResult(myIntent, RequestCodes.LAUNCH_FILE_CODE);
```
and
```
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-gen... | [
0.15876178443431854,
-0.14177565276622772,
0.6096622943878174,
0.007672749925404787,
0.37953343987464905,
-0.015882592648267746,
0.5593573451042175,
-0.43034934997558594,
0.11106587201356888,
-0.4097340703010559,
-0.33799365162849426,
0.5599653124809265,
-0.2967100143432617,
0.071302801370... | |
resultCode, data);
if (requestCode == RequestCodes.LAUNCH_FILE_CODE) {
if (resultCode == RESULT_CANCELED) {
Log.i ("err","errrrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
String errUrl = responseMsgHandler.errMsgResponse(FileHandler.fileJsonObject, "Unable to launch file"); ... | [
-0.23643358051776886,
-0.39883625507354736,
0.5294789671897888,
-0.009748733602464199,
0.1625305563211441,
0.18819409608840942,
0.22871197760105133,
-0.3028929531574249,
-0.14307908713817596,
-0.24100998044013977,
-0.6681038737297058,
0.39729413390159607,
-0.3104083836078644,
0.32335367798... | |
} else if (resultCode == RESULT_OK) {
String successUrl = responseMsgHandler.launchfileResponse(FileHandler.fileJsonObject);
mWebView.loadUrl(successUrl);
}
```
My err log:
```
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): java.lang.RuntimeExcept... | [
0.08864884823560715,
-0.10242367535829544,
0.5768764019012451,
-0.08255407959222794,
0.2802567183971405,
0.040704820305109024,
0.7442107796669006,
-0.28378331661224365,
-0.23417557775974274,
-0.42602819204330444,
-0.4829695224761963,
0.8541412353515625,
-0.4658263921737671,
-0.018110241740... | |
java.lang.NullPointerException
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-04 12:33:... | [
-0.5191555023193359,
0.31521356105804443,
0.4208664894104004,
-0.3939548432826996,
0.07186448574066162,
0.32220807671546936,
0.8676970601081848,
-0.47082948684692383,
-0.2821400761604309,
-0.6361426711082458,
-0.3255300521850586,
0.7355214357376099,
-0.38623666763305664,
-0.040425598621368... | |
ERROR/AndroidRuntime(3757): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at java.lang.reflect.Method.invokeNative(Native Method)
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at java.lang.reflect.Method.invoke(Method.java:521)
... | [
-0.30977964401245117,
0.1714964061975479,
0.339639276266098,
-0.31182703375816345,
0.14716926217079163,
0.411632776260376,
1.1554830074310303,
-0.17020098865032196,
-0.31978821754455566,
-0.4913017153739929,
-0.33505779504776,
0.7130050659179688,
-0.491486132144928,
0.11473091691732407,
... | |
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-04 12:33:08.635: ERROR/AndroidRuntime(3757): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
```
Thanks
Sneha
try this
```
if (item_ext.eq... | [
-0.5999512672424316,
0.04152682423591614,
0.7737705707550049,
-0.08069901168346405,
0.05972618609666824,
0.01542697288095951,
0.7767204642295837,
-0.6564207673072815,
0.1082606166601181,
-0.6567627191543579,
-0.4270090162754059,
0.9948151707649231,
-0.35638850927352905,
-0.0942998528480529... | |
} else {
Intent i = new Intent();
i.setAction(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(file), "audio/*");
startActivity(i);
}
} | [
0.35110417008399963,
-0.14303594827651978,
0.733479380607605,
-0.3563333749771118,
0.37662768363952637,
0.22782060503959656,
0.5275388360023499,
-0.6334661245346069,
0.20740044116973877,
-0.5628923773765564,
-0.32947179675102234,
0.9253891110420227,
-0.45825517177581787,
-0.139873713254928... | |
/*photo file selected*/
else if(item_ext.equalsIgnoreCase(".jpeg") ||
item_ext.equalsIgnoreCase(".jpg") ||
item_ext.equalsIgnoreCase(".png") ||
item_ext.equalsIgnoreCase(".gif") ||
item_ext.equalsIgnoreCase(".tiff")) { | [
0.21012431383132935,
-0.42367812991142273,
0.7414242029190063,
0.16087578237056732,
-0.1472054123878479,
0.13105228543281555,
-0.08848153799772263,
-0.39732104539871216,
0.15262500941753387,
-0.5788193345069885,
-0.10248611867427826,
0.4515094459056854,
-0.6185910701751709,
-0.066689781844... | |
if (file.exists()) {
if(mReturnIntent) {
returnIntentResults(file);
} else {
Intent picIntent = new Intent(); | [
0.27394914627075195,
-0.0972406268119812,
0.9749142527580261,
-0.24829483032226562,
0.46692994236946106,
0.14936266839504242,
0.6237781047821045,
-0.32934680581092834,
0.11294734477996826,
-0.45218536257743835,
-0.16991838812828064,
0.7781617641448975,
0.165135458111763,
0.1164452210068702... | |
picIntent.setAction(android.content.Intent.ACTION_VIEW);
picIntent.setDataAndType(Uri.fromFile(file), "image/*");
startActivity(picIntent);
}
}
}
/*video file selected--add more video formats*/ | [
0.27469590306282043,
-0.25809603929519653,
0.8855527639389038,
0.19671513140201569,
-0.04679756611585617,
0.2647504210472107,
-0.014256536029279232,
-0.25162050127983093,
-0.12334265559911728,
-0.5879861116409302,
-0.2072325348854065,
0.6904725432395935,
-0.32687610387802124,
0.07510970532... | |
else if(item_ext.equalsIgnoreCase(".m4v") ||
item_ext.equalsIgnoreCase(".3gp") ||
item_ext.equalsIgnoreCase(".wmv") ||
item_ext.equalsIgnoreCase(".mp4") ||
item_ext.equalsIgnoreCase(".ogg") ||
item_ext.equalsIgnoreCase(".wav")) { | [
-0.35851022601127625,
-0.22569753229618073,
0.7065994143486023,
-0.07973495870828629,
0.0762423500418663,
0.23757131397724152,
0.22932487726211548,
-0.29366594552993774,
0.11314217001199722,
-0.5737281441688538,
-0.14940036833286285,
0.4599725306034088,
-0.43664905428886414,
0.024558002129... | |
if (file.exists()) {
if(mReturnIntent) {
returnIntentResults(file);
} else {
Intent movieIntent = new Intent(); | [
0.45772549510002136,
-0.1761096864938736,
1.0712616443634033,
-0.28484198451042175,
0.6638463735580444,
-0.020140962675213814,
0.481277197599411,
-0.3054908215999603,
0.23898348212242126,
-0.3858891427516937,
-0.21620994806289673,
0.9525293707847595,
0.1451929658651352,
0.1792035847902298,... | |
movieIntent.setAction(android.content.Intent.ACTION_VIEW);
movieIntent.setDataAndType(Uri.fromFile(file), "video/*");
startActivity(movieIntent);
}
}
}
/*zip file */ | [
0.5229063034057617,
-0.39384350180625916,
0.9328041076660156,
-0.061359211802482605,
0.36986225843429565,
-0.03501572459936142,
0.09500773251056671,
-0.33379730582237244,
0.06491871923208237,
-0.4890115559101105,
-0.5564032793045044,
0.8823606371879578,
-0.38497498631477356,
-0.02718415297... | |
else if(item_ext.equalsIgnoreCase(".zip")) {
if(mReturnIntent) {
returnIntentResults(file);
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog alert;
mZippedTarget = | [
0.298401415348053,
-0.4275628328323364,
0.6368887424468994,
-0.28377148509025574,
0.3500153124332428,
0.10612083971500397,
0.6424061059951782,
-0.49770388007164,
-0.10857248306274414,
-0.6858653426170349,
-0.16981296241283417,
0.8423240184783936,
-0.5277573466300964,
-0.1485583484172821,
... | |
mFileMag.getCurrentDir() + "/" + item;
CharSequence[] option = {"Extract here", "Extract to..."};
builder.setTitle("Extract");
builder.setItems(option, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { | [
-0.11854445934295654,
-0.29776522517204285,
0.8987255096435547,
-0.5536819696426392,
0.6952471733093262,
0.4968949854373932,
0.3443390130996704,
-0.7458929419517517,
-0.1532457023859024,
-0.43347105383872986,
-0.3851560056209564,
0.7392677664756775,
-0.6647970676422119,
-0.0050923470407724... | |
switch(which) {
case 0:
String dir = mFileMag.getCurrentDir(); | [
0.01125145424157381,
-0.4938480257987976,
0.549980103969574,
-0.47859713435173035,
0.4765336811542511,
0.08729185909032822,
0.08978351950645447,
-0.5117903351783752,
-0.0029600646812468767,
-0.17076455056667328,
-0.2610381543636322,
0.8725757002830505,
-0.34247711300849915,
0.2740880846977... | |
mHandler.unZipFile(item, dir + "/");
break;
case 1: | [
-0.6018539667129517,
-0.23180493712425232,
0.1706768274307251,
-0.34483081102371216,
0.18067176640033722,
0.2944837808609009,
0.5469557642936707,
-0.5452699065208435,
-0.2835468649864197,
-0.3382495641708374,
-0.824935257434845,
0.1919340342283249,
-0.26806387305259705,
0.03694808855652809... | |
mDetailLabel.setText("Holding " + item +
" to extract");
mHoldingZip = true; | [
-0.22091080248355865,
-0.3838133215904236,
0.31227874755859375,
-0.34312868118286133,
0.2376956045627594,
0.10451066493988037,
0.4483135938644409,
-0.6268253326416016,
-0.20787431299686432,
0.17831915616989136,
-0.5944898128509521,
0.5789173245429993,
-0.5458200573921204,
-0.04255479946732... | |
break;
}
}
}); | [
-0.36579373478889465,
-0.09127259254455566,
0.26427534222602844,
-0.5939968824386597,
0.29559969902038574,
-0.42350316047668457,
0.460200697183609,
-0.010801158845424652,
-0.08881443738937378,
-0.16607381403446198,
-0.8046449422836304,
0.6240306496620178,
-0.3681366443634033,
0.14448143541... | |
alert = builder.create();
alert.show();
}
}
/* gzip files, this will be implemented later */
else if(item_ext.equalsIgnoreCase(".gzip") ||
item_ext.equalsIgnoreCase(".gz")) {
if(mReturnIntent) | [
0.05604088306427002,
-0.28203481435775757,
0.7054650187492371,
-0.36005014181137085,
0.2040739208459854,
0.0792640894651413,
0.5390856862068176,
-0.3273922801017761,
-0.17722757160663605,
-0.6699908971786499,
-0.2989327013492584,
0.7222470641136169,
-0.6074764132499695,
-0.0292900037020444... | |
{
returnIntentResults(file);
} else {
//TODO:
}
}
/*pdf file selected*/
else if(item_ext.equalsIgnoreCase(".pdf")) {
if(file.exists()) { | [
-0.3394545316696167,
-0.34185105562210083,
0.8406420350074768,
0.20689846575260162,
0.1128607764840126,
-0.0973544493317604,
-0.03983577340841293,
-0.5164653062820435,
0.1465091109275818,
-0.6528290510177612,
-0.4240040183067322,
0.5524323582649231,
-0.09089400619268417,
0.1322902143001556... | |
if(mReturnIntent) {
returnIntentResults(file);
} else {
Intent pdfIntent = new Intent();
pdfIntent.setAction(android.content.Intent.ACTION_VIEW); | [
0.13702580332756042,
-0.2549973726272583,
1.0280572175979614,
-0.2736358940601349,
0.395786851644516,
0.2748580276966095,
0.6666810512542725,
-0.5446322560310364,
0.2228144407272339,
-0.4747949242591858,
-0.42369893193244934,
0.933266818523407,
-0.18779921531677246,
-0.12354635447263718,
... | |
pdfIntent.setDataAndType(Uri.fromFile(file),
"application/pdf");
try { | [
-0.31399205327033997,
-0.18699771165847778,
0.6042572855949402,
0.001295891939662397,
0.16757024824619293,
0.11840790510177612,
0.30755549669265747,
-0.3501984477043152,
0.24617524445056915,
-0.5796323418617249,
-0.451663076877594,
0.5331408977508545,
-0.28191351890563965,
0.02257293276488... | |
startActivity(pdfIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "Sorry, couldn't find a pdf viewer",
Toast.LENGTH_SHORT).show(); | [
0.18075576424598694,
-0.2836730182170868,
0.36819854378700256,
-0.34750792384147644,
-0.0455874539911747,
-0.43002191185951233,
0.4771961569786072,
0.03748789429664612,
0.030332522466778755,
-0.5987434387207031,
-0.46519288420677185,
0.3101857602596283,
-0.30841827392578125,
-0.07013072818... | |
}
}
}
}
/*Android application file*/
else if(item_ext.equalsIgnoreCase(".apk")){
if(file.exists()) { | [
-0.1250835657119751,
0.031835660338401794,
0.6879304647445679,
-0.07371293008327484,
0.543131411075592,
0.38146334886550903,
0.12127141654491425,
-0.17275270819664001,
0.19419480860233307,
-0.796567976474762,
-0.2555718719959259,
0.6655516028404236,
-0.5066182613372803,
0.09697207808494568... | |
if(mReturnIntent) {
returnIntentResults(file);
} else {
Intent apkIntent = new Intent();
apkIntent.setAction(android.content.Intent.ACTION_VIEW); | [
0.265298455953598,
-0.22759877145290375,
0.8983898758888245,
-0.31869617104530334,
0.48056337237358093,
0.3898783326148987,
0.7368515133857727,
-0.6228427886962891,
0.07776598632335663,
-0.412940114736557,
-0.3201773464679718,
0.92678302526474,
-0.35868582129478455,
-0.09589164704084396,
... | |
apkIntent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
startActivity(apkIntent);
}
}
}
/* HTML file */
else if(item_ext.equalsIgnoreCase(".html")) {
if(file.exists()) { | [
-0.03845580294728279,
-0.11591574549674988,
0.7058950066566467,
-0.20825912058353424,
0.08772178739309311,
0.33921098709106445,
0.25108572840690613,
-0.6071963906288147,
-0.0322551392018795,
-0.6831720471382141,
-0.36642685532569885,
0.4175652861595154,
-0.7048901319503784,
-0.042913816869... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.