Id
int64
1.68k
75.6M
PostTypeId
int64
1
1
AcceptedAnswerId
int64
1.7k
75.6M
Question
stringlengths
7
2.03k
Answer
stringlengths
0
2.25k
Image
imagewidth (px)
4
9.41k
27,203,512
1
27,203,788
I'm trying to create to make this form in Android <IMAGE> 1. You see the EditText has some shadows at the front. How do I create that? 2. I created AutoComplete Text Views for State and Place. But how to I add that line and arrow on it?
You can set background drawable to achieve.either create custom drawable with shape or use background images and put it in the layout xml android:background="@drawable/text_bg" create an "testing_gradient.xml" file in /res/drawable ''' <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/grey"> <shape android:shape="rectangle" android:thickness="10dp"></shape> </item> <item android:drawable="@color/white" android:left="50dp"> <shape android:shape="rectangle"></shape> </item> </layer-list> ''' apply the code in layout xml file ''' <EditText android:background="@drawable/testing_gradient" android:layout_width="match_parent" android:textColor="@color/black" android:text="User input" android:paddingLeft="60dp" android:layout_height="60dp"/> ''' final result <IMAGE> Again, you can add more layer to input more images <IMAGE>
11,249,756
1
24,869,226
With Google's Chart Image API (which was unfortunately deprecated April 2012), you can generate QR codes. <IMAGE> I'm sure I can change the size of the resulting image using the API, but I'd rather just use CSS and the width and height properties to make it a little bigger. In Chrome at least, this results in nasty anti-aliasing (not preferable, since it needs to be parsable by machines). Is there a way to tell browsers not to anti-alias upscaled images?
This guy has the solution: <URL> ''' img { image-rendering: optimizeSpeed; /* PREFER SPEED OVER SMOOTHING */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ image-rendering: optimize-contrast; /* CSS3 Proposed */ -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ } ''' Sooo for you: ''' imgQR { width:100px; height:100px; image-rendering: optimizeSpeed; /* PREFER SPEED OVER SMOOTHING */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ image-rendering: optimize-contrast; /* CSS3 Proposed */ -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ } '''
15,911,510
1
15,912,269
In my application, in storyboard, I have a screen with a lot of Table View Cells. For example, in first two of them, I need to move checkmarks, when user touches one of them (make a select). <IMAGE> Is there are an easy way to do it, for example, like outlet connection? Or how it is possible to do? Thanks.
Check out Apple's documentation on <URL> in your table view's 'didSelectRowAtIndexPath' method. Here's a rough implementation, assuming you have an array of available 'taskTypes', and a property for the 'currentTaskType' selected. ''' - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:NO]; NSInteger taskTypeIndex = [taskTypes indexOfObject:[self currentTaskType]]; if ( taskTypeIndex == [indexPath row] ) { return; } NSIndexPath *oldIndexPath = [NSIndexPath indexPathForRow:taskTypeIndex inSection:0]; UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath]; UITableViewCell *oldCell = [tableView cellForRowAtIndexPath:oldIndexPath]; if ( [newCell accessoryType] == UITableViewCellAccessoryNone ) { [newCell setAccessoryType:UITableViewCellAccessoryCheckmark]; [self setCurrentTaskType:[taskTypes objectAtIndex:[indexPath row]]]; } if ( [oldCell accessoryType] == UITableViewCellAccessoryCheckmark ) { [oldCell setAccessoryType:UITableViewCellAccessoryNone]; } } '''
26,098,232
1
26,382,524
In my DataGrid Headers I would like to align the content to the right. Currently I'm doing this using a style on the DataGrid: ''' <Style TargetType="DataGridColumnHeader" x:Key="ResultatenHeader" BasedOn="{StaticResource MetroDataGridColumnHeader}"> <Setter Property="HorizontalContentAlignment" Value="Right"/> </Style> ''' However this produces the following result: <IMAGE> As you can see my header has two lines, I've done this with the following code: ''' <DataGridTextColumn Width="100" Header="neerslag&#x0a;(m3)" Binding="{Binding Path=Resultaten[2].Double, StringFormat={}{0:f2}}"/> ''' How would I go about making the second line (the unit, m3) also align right.
Rather than setting the ContentTemplate to Null like dkozl suggested I decided to edit the ContentTemplate to: ''' <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock TextBlock.FontWeight="SemiBold" Text="{Binding Converter={StaticResource ToUpperConverter}}" TextAlignment="Right"/> </DataTemplate> </Setter.Value> </Setter> ''' I applied this to all my tables involving numbers and it works like a charm :)
13,888,168
1
13,888,196
Let's say I have this table in my database: <IMAGE> Each 'time' is a UNIX timestamp that range from December 6 to December 14(today). Some rows have the same day but not the same time (ie: Dec 14 8:39PM, Dec 14 10:21 PM) and such. However, I'm trying to make a mysql query that will add up all 'gained' points for each day. I currently have a 'while' list that goes down the list sorted by 'uid' because 'UID' is the 'id' of the user. This is my currently 'while' query: ''' $get_statuses = mysql_query("SELECT * FROM 'history' WHERE 'uid' = '$logged[id]' ORDER BY 'id' DESC LIMIT 50"); ''' Assuming I use this '$fullDate = date("F j, Y", $status['4']);' for each current loop beacuse I did this 'while ($status = mysql_fetch_array($get_statuses)) {...}', how do I do this? Maybe a 'SELECT(SUM)'?
Use this query. ''' SELECT Date(From_unixtime('time')) AS 'Date', Sum('gained') FROM 'tbl' WHERE 'uid' = '$logged_id' GROUP BY 'Date' ORDER BY 'id' DESC ''' You can add More where condition here. Like ''' From_unixtime('time') >= '2012-12-06' AND From_unixtime('time') <= '2012-12-14' '''
15,906,443
1
15,906,907
I have a list of dictionaries; ''' information = [{'Edu':'School','Age':'40','Height':'5.11','DOB':'<PHONE>','Name':'Jack'}, {'Edu':'College','Age':'30','Height':'4.11','DOB':'<PHONE>','Name':'Alex','Pro':'Teacher'}, {'Name':'Elizabeth','Nickname':'Lizzy','DOB':'<PHONE>'}] ''' I would like to write this to a csv. <IMAGE> So far I've been able to get the unique headers to be written to the csv like this... ''' unique_headers = [] for info in information: unique_headers.append(s.keys()) # append keys to a list - but this would take ages right? certainly not pythonic ordered_fieldnames = set(flatten(unique_headers)) with open('profile.csv','wb') as fou: dw = csv.DictWriter(fou, delimiter=',', fieldnames=ordered_fieldnames) dw.writeheader() # unique headers are written ''' Now, how do I get the records written to the csv under the relevant headers?
You are almost there: ''' ... dw.writeheader() dw.writerows(information) '''
42,057,890
1
42,060,476
I have a solution : <IMAGE> - 'Business''Business.Interfaces''DataAccess.Interfaces''Factory''IDataAccess''DataAccess.Interfaces'- 'MainProject''Business.Interfaces''Factory''IBusiness''Business.Interfaces' My factory project use 'Unity' for resolve dependencies. This project must have a reference to all others project except 'MainProject' to access to constructors of concrete class and do mapping between class and interfaces. But I don't add a reference to 'Business' in 'Factory' project because Visual Studio says to me : How to resolve this ?
As @Andrei pointed out, when configuring an to use DI, the should be responsible for wiring up all of its dependencies in its <URL>. > A Composition Root is a (preferably) unique location in an application where modules are composed together. Furthermore, the composition root should be moved to an external library. Think of the composition root as a modern replacement for a '.config' file. It is the that is responsible for loading it and providing its contents to the dependent assemblies - the same is true for the Composition Root. It is the Composition Root's job to the dependencies down into the rest of the application. The dependent assemblies should not try to their own dependencies. It's called the - "Don't call us, we'll call you". That said, it is also common to use the <URL> in conjunction with DI. See <URL> for a good visual representation of how it should work. Your application looks a like the first image - you should aim to make it like the second one. The application is setup in separate layers that depend on each other, but it is very flat.
22,742,754
1
22,744,470
I'm new to networkx and actually a bit confused on how to efficiently find the n-degree neighborhood of a node. The n-degree neighborhood of a node v_i is the set of nodes exactly n hops away from v_i. Given a specified n, I need find the n-degree neighborhood for each node in the graph/network. Suppose I have the following graph and I want to find the n=1 neighborhood of node v1. That would be v2 and v3. Next suppose I want to find the n=2 neighborhood of node v1, then that would be v4. <IMAGE>
''' import networkx as nx G = nx.Graph() G.add_edges_from([('v1','v2'),('v2','v4'),('v1','v3')]) def neighborhood(G, node, n): path_lengths = nx.single_source_dijkstra_path_length(G, node) return [node for node, length in path_lengths.iteritems() if length == n] print(neighborhood(G, 'v1', 1)) # ['v2', 'v3'] print(neighborhood(G, 'v1', 2)) # ['v4'] '''
9,979,846
1
9,979,877
I have table structure as displayed in first table. And want to fetch Both Male and Female Counts in a single query so that request will go only for one time onto the server. <IMAGE>
This is what you need to do: ''' select gender, count(case when age between 0 and 20 then 1 else null end) Age_0_20, count(case when age between 21 and 40 then 1 else null end) Age_21_40 from yourtable group by gender ''' Adjust accordingly :) Note that 'COUNT' aggregate function only counts non-null values. Thus, the 'else' values in the 'case' must be 'NULL'. The 'When' value returns '1' but it could just be any non-null value. Some people implement this by using 'SUM': ''' select gender, sum(case when age between 0 and 20 then 1 else 0 end) Age_0_20, sum(case when age between 21 and 40 then 1 else 0 end) Age_21_40 from yourtable group by gender ''' The result is going to be absolutely the same.
24,996,135
1
24,996,224
I have this code: ''' for i in (1..5) div:nth-child({i})::after content 'i*i' for i in (6..10) div:nth-child({i})::after ij = (i - 5) content '(ij*ij)' for i in (1..10) div:nth-child({i}) ij = (i - 5) if i >= 6 height ij * ij px else height i * i px ''' Which outputs this: <IMAGE> But I need it to reverse at 25, so it goes: 1 4 9 16 25 25 16 9 4 1 Not sure how to do it?
Change the way you calculate ij , from to ''' for i in (1..5) div:nth-child({i})::after content 'i*i' for i in (6..10) div:nth-child({i})::after ij = 11-i content '(ij*ij)' for i in (1..10) div:nth-child({i}) ij = 11-i if i >= 6 height ij * ij px else height i * i px '''
14,101,321
1
14,122,895
I have two simple projects in a single Visual Studio solution to understand how a jQuery ajax request works. One is a web service and the second one is a project consuming the web service. You can download the very small project from here. <URL> As you can see in the project, Whenever I try to call the Web Service, Internal Server Error 500 is occurring. In chrome, I can see the following alert (executed by "Error" function of Ajax call) <IMAGE> Please assist me to find the problem.. EDIT: ''' function btnClick() { debugger; var txtValue = $('#txtValue'); var text = txtValue.val(); // // $.ajax({ url: "http://localhost:12000/ExampleJsonWS.asmx/getValue", type: "POST", dataType: "json", data: "{" + txtValue.val() + "}", timeout: 30000, async: false, contentType: "application/json; charset=utf-8", success: function (data) { debugger; alert(data); return data; }, error: function (result) { debugger; //alert(e); alert(result.status + ' ' + result.statusText); } }); } '''
The problem was that its not possible to POST with keeping the web service in different project while a GET can do that. (Explained by <URL> For more info you can have a look at this <URL>
26,520,252
1
26,520,364
1:here is a SQL query , which i find in the book ''' select distinct T.branch_name from branch as T, branch as S where T.assets > S.assets and S.branch_city = 'Brooklyn' ''' what i am confused is T and S both indicate table branch right? why they use 'T.assets>S.assets', is it the same as 'branch.asset > branch.asset' what's the difference. 2: the meaning of the following query is to "Find all customers who have an account at all branches located in Brooklyn" <IMAGE> But I did not get it somehow, also struggle with the key word
Think of code like this: ''' for (i=0; i<10; ++i) for (j=0; j<10; ++j) print i, j ''' How can i and j not be the same value? Easy -- they are both looping over the same set of values from 0 to 9, but on each iteration of the loop, they each have a value within that range of integers. That's similar to table aliases. Think of a join like this kind of nested loop. Each time two rows are joined, S and T are (which is the technical term) that reference one row at a time in your 'branch' table.
14,828,798
1
14,828,870
well its really a basic question! I want to build a div block that contains other divs that may overflow on another div! This is an example picture: <IMAGE> Well i used position:relative with top and left, but it looks awkward!
Make sure that your container div is set to "Position:relative;" and its children divs set to "position:absolute;". That way all the children divs will take the div with the relative positioning as a point of reference.
15,747,351
1
15,747,766
<IMAGE> I have a project with StoryBoard (iOS 5+), with two UIViewController. The task would be to instantiate programmatically a second UIViewController (CoordinationController) but I'd like to use it's XIB file for the user interface design. The evident workaround to copy the XIB to StoryBoard is not working or not usable for undocumented reasons. Even the rule would be that in case the view controller of the second storyboard has no view it will look for the same named XIB... is not working. How to instantiate the second UIViewController and use its XIB file?
You can load the nib file and set your view in an initWithCoder: method of CoordinationController: ''' -(id)initWithCoder:(NSCoder *)aDecoder { if (self = [super initWithCoder:aDecoder]) { UINib *nib = [UINib nibWithNibName:@"CoordinationController" bundle:nil]; NSArray *nibObjects = [nib instantiateWithOwner:self options:nil]; self.view = nibObjects.lastObject; } return self; } '''
9,290,319
1
9,573,842
<IMAGE> I have summary row in my table. But user can see it only when he will scroll down all grid. But it could be better, if summary row will be fixed at the bottom of the grid, and it will be visible always, when the grid is shown. How can I modify it?
I'm not sure how to fix a row like you're suggesting, but for something that needs to be visible 100% of the time, have you thought about adding a top bar or a bottom bar that displays these values? You can use the <URL> to show text in such a place. I'm doing this in several projects.
26,550,008
1
26,550,096
Is there a way to program (Java), I mean, write some piece of code anywhere in IDE, to evaluate something in the current debug context when the program execution is waiting on some debug point in an Eclipse IDE? The feature I require is very much similar to what 'Google Chrome' offers for a 'Javascript' developer. In below image '$(this).text()' returns the button's text in current debug context. <IMAGE>
Use Display window. You can write piece of code in display window and see the result immidiately.
12,256,562
1
12,256,605
I am developing a graphical flow chart kind of application where I link together "modules" which the user can drag around and what not. I'm using libraries like draw2d (which uses raphael.js, for example) that use SVG and HTML5 canvas to do the graphics. However, I'm not even approaching what I would consider "stress" levels just yet and it's running ridiculously slow in my browser. When I drag the modules (blue boxes), it feels like 10 frames per second, or even less. Screenshot to show what I have on screen: <IMAGE> On my laptop I have a System Monitor provided by AMD showing what percentage of my CPU cores and GPU is being used. When I drag the objects, my CPU cores (all 4 of 'em) get used up to the max, but the GPU doesn't get used at all. Are graphics-based web frameworks not using the GPU? Given what my application is trying to do and the poor state it's currently in performance-wise, is it likely that I'll have to find a new graphics library that uses openGL or something? Does such a thing exist?
It really depends on the library and used browser. If you use chrome the first step is to go to chrome://gpu and see what features are enabled for GPU acceleration. Then it purely depends on 2D framework library if it is using standard canvas drawing functions or implements own software rendering functionality.
17,970,225
1
17,977,008
I am using a Java FX2.2 WebView embedded in a JPanel for showing web pages. This works well, except for the default font that I don't like. It looks very bold/rounded/anti-aliased/blurry. <IMAGE> On the left is the text from my Chrome browser, on the right of the FX Browser. It seems that it is using the "System Regular" Font as a default font, this font is returned by Font.getDefault(). I have tried changing it with reflection but the browser still uses the same font. Also I looked into 'WebView.setFontScale()' and 'WebView.setFontSmoothingType()', the first only changes the size and the latter only has a 2nd font smoothing type that is even worse than the default. I looked at Safari, which is, like FX WebView, based on WebKit, and this browser has the option to change the default font (I think most browsers have this option). Does anyone know a way to change this default Font for the Java FX WebView? EDIT: Made a feature request here: <URL>
Try using <URL>, the default font rendering mechanism for some platforms has been updated. You will need to evaluate yourself whether there appears to be an improvement to your eyes on your target platforms. Also note there is an <URL>. WebView loads HTML, so the standard methods of changing fonts in HTML apply to it (the deprecated HTML font tag or CSS). As to setting the default font used by WebView - I am unaware of a mechanism to do that. You can create a <URL> which demonstrates that this feature is available in Chrome.
31,124,120
1
31,124,720
My question is going to be pretty concise. I saw this Deezer page and I tried to zoom in and out to see that the image is "out of zoom" (see the image below) <IMAGE> Below is a structure we consider to be my page: ''' <body> <div class="visual-header"> <div class="container"> SOME TEXT </div> </div> PAGE CONTENT </body> ''' How am I supposed to use 'image.png' of a size of 2000x800 pixels to get this effect?
This will make the background image fit the width of the screen, whatever the zoom level. ''' BODY { background-image: url("http://www.psdgraphics.com/file/colorful-triangles-background.jpg"); background-size: 100%; } ''' If you want the image to stretch both horizontally and vertically (and not retain its aspect ratio), use: ''' BODY { margin: 0; min-height: 100vh; background-image: url("http://www.psdgraphics.com/file/colorful-triangles-background.jpg"); background-size: 100% 100%; } '''
29,951,300
1
29,953,048
I have a set of Eclipse plugins: <IMAGE> that I'd like to build using maven. since there is no one single entry point, how do I use maven to organise the building?
you should create a project that have all modules( your projects ) and then build this project that actually will build all of your plugins. For more info please refer to <URL> and <URL>
6,008,675
1
6,008,815
I have a custom ViewController which allows selection of an image from a grid. The ViewController uses the AQGrid control and is really just a modified version of the samples shipped with AQGrid. I'm trying to hook it up in InterfaceBuilder, but documentation on how to do this seems sparse. In standard Cocoa apparently I should create an IB plugin to use with IB, but I'm just looking for the quickest option really as there are a few of these custom ViewControllers which I need to hook up (including a rating control). I've also tried dragging the "Object" controller in IB to my tabpage, but it just gets added to the tree outside of the tabcontroller (see screenshot). <IMAGE>
As far as I understand your question, you have to add a generic 'UIViewController' to your nib file and then change its class in the Identity inspector to whatever you need as long as it's a subclass of 'UIViewController'.
20,814,309
1
20,814,385
I developed and publish some apps to google play using "old" interface. Now I published an app using new interface and seems that all were successful because my app appears as "published". However, previous apps were active in 1h, but now, after 2 days, I am unable to find it in google play and also unable to find any link on any option inside developer console. Is my app published? How could I then know google play link? <IMAGE>
> How could I then know google play link? The links for Apps in the Playstore are always built with the same pattern, it looks like this: <URL> so you can use that link to see if your App is published or not, just replace YOUR.PACKAGE.NAME with the actual name of the package like com.google.android.music
6,413,977
1
7,164,756
Is there any way to have a Shortcut Recorder in Objective-C, where the user can choose the shortcut? I tried 'DDHotKey', which worked for me, but with this library users can not choose the shortcut themselves. Then I tried to implement the 'Shortcut Recorder', but there I can only work with Xcode 3 because of the ibplugin. So is there any way to have something like this in Xcode 4 ? :<IMAGE> DDHotKey: <URL> Shortcut Recorder:<URL>
IBPlugins do not work in Xcode 4, as you've found out. (<URL> However, this does not prevent you from instantiating the control programmatically...
19,002,101
1
19,003,784
How to make auto increment of an existing primary key in Azure? <IMAGE>
Your table has to be rebuild from scratch, it's not possible to assign an auto_increment to an existing table. Try this script, wich will build a table for you with auto_increment, transfer all the data from your old table to the new one, drops the old table and renames the new one to the old one. Just make sure that your data is compatable with the auto_increment property! ''' BEGIN TRANSACTION SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON COMMIT BEGIN TRANSACTION GO CREATE TABLE dbo.Tmp_schema_version ( version int NULL, datetime datetime NULL, comments nvarchar(150) NULL, id int NOT NULL IDENTITY (1, 1) ) ON [PRIMARY] GO ALTER TABLE dbo.Tmp_schema_version SET (LOCK_ESCALATION = TABLE) GO SET IDENTITY_INSERT dbo.Tmp_schema_version ON GO IF EXISTS(SELECT * FROM dbo.schema_version) EXEC('INSERT INTO dbo.Tmp_schema_version (version, datetime, comments, id) SELECT version, datetime, comments, id FROM dbo.schema_version WITH (HOLDLOCK TABLOCKX)') GO SET IDENTITY_INSERT dbo.Tmp_schema_version OFF GO DROP TABLE dbo.schema_version GO EXECUTE sp_rename N'dbo.Tmp_schema_version', N'schema_version', 'OBJECT' GO ALTER TABLE dbo.schema_version ADD CONSTRAINT PK_schema_version PRIMARY KEY CLUSTERED ( id ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO COMMIT '''
9,247,025
1
9,247,103
Why IntelliSense dosen't give me option to select properties of the Glasses collection(i.e itemToDelete) after implimenting the LINQ. Here is my C# LINQ: ''' public static void DeletePicturesFromHrdDisc(List<Glasses> Temp, int GlassID) { var itemToDelete = (from item in Temp where item.GlassesID==GlassID select item); itemToDelete.(dosen't give me the optipn to select Properties of the Glasses class) } ''' here is my Glasses class: ''' public class Glasses { public string Brand { get; set; } public string SmalPicture { get; set; } public string BigPicture { get; set; } public string color { get; set; } public string FrameType { get; set; } public int GlassesID { get; set; } public string NameGlasses { get; set; } public string Collection { get; set; } } ''' But I can see Glasses properties if i use .First() or .FirstorDefault() extensions as follows: <IMAGE> Any idea why can't I access the properties in the first version and why i see them in IntelliSense only if i use .First() or .FirstorDefault() extensions on my LINQ. Thank you in advance!
When you apply Where/Select to Temp, you're not just getting a single result (there could be more than one result matching 'where item.GlassesID==GlassID', the compiler cannot be sure) so it does not return a single object instance of Glasses but an <URL>. Simplified, think that you get a List<Glasses> back and you need to extract the actual object from the List before using its properties. If you definitely know there's at most only one result returned, you can use <URL> which returns the Glasses instance in the IEnumerable and throws an error if there isn't one. Both throw an exception if there is more than one result. Using <URL> would mean that if you accidentally get more than one result, you'll in this case get the first one, a random one. Perhaps not a good thing for an "itemToDelete", you'd probably want to know if your assumption is wrong.
19,270,759
1
19,272,635
I'm clustering text documents. I'm using tf-idf and cosine similarity. However there's something I don't really understand even tho I'm using these measures. Do the tf-idf weights affect the similarity calculations between two documents? Suppose I have these two documents: 1- High trees. 2- High trees High trees High trees High trees. Then the similarity between the two documents will be 1, although the tf-idf vectors of the two documents are different. Where the second should normally have higher weights for the terms compared to the first document. Suppose the weights for the two vectors are (just suppose): v1(1.0, 1.0) v2(5.0, 8.0) calculating the cosine similarity gives 1.0. Here is a sketch of two random vectors that share the same terms but with different weights. There's an obvious angel between the vectors, so the weights should play a role! <IMAGE> This triggers the question, where do the tf/idf weights play a role in the similarity calculations? Because what I understood so far is that the similarity here only cares about the presence and absence of the terms.
I think you are mixing two different concepts here. 1. Cosine similarity measures the angle between two different vectors in a Euclidean space, independently of how the weights have been calculated. 2. TF-IDF decides, for each term in a document and a given collection, the weights for each one of the components of a vector that can be used for cosine similarity (among other things). I hope this helps.
47,257,378
1
47,261,280
We noticed that your app requires users to register with personal information to access non account-based features. Apps cannot require user registration prior to allowing access to app content and features that are not associated specifically to the user. We are taking Email id on SignUp because all data is tracking in Backend behalf on Email id. What to do? Please anybody help me. <IMAGE>
I think Apple does not know where you are using Email ID...So to solve this issue what you can do is you can send the otp to users Email Address to verify valid user and you can give the reason as After the user order is confirmed you are going to send order confirmation mail and there Bill details in their Email id....Just mention all this Terms and condition in one screen what i have said above.I hope it helps..Thanks.
49,059,026
1
49,208,826
I have Xamarin Forms Master Detail page (Android) and need to add shadow for top navigation bar. I tried it this way: <URL> but shadow is shown above navigation button, i need it below. I guess i need to create custom renderer for master detail page but that seems like a lot of work. <IMAGE>
My solution was to use frame on top of each content page: ''' <Frame HeightRequest="2" HasShadow="True" Padding="0" CornerRadius="0" MinimumHeightRequest="1" VerticalOptions="Start" HorizontalOptions="FillAndExpand"/> '''
3,953,143
1
4,218,255
i have problem with UIACtionSheet and iPad keyboard , when try to show an UIActionSheet with 'firstResponder' keyboard my sheet becomes like this : <IMAGE> what is the problem ?
With a UIActionSheet, you dont really need to use 'firstResponder' unless you have a textField or something else to type in.
4,692,869
1
4,724,875
It is possible to configure Eclipse to show lines like it is done in intellJ IDEA, please see screenshot below. <IMAGE>
As investigation shown there is no such a possibility.
7,693,530
1
7,971,112
First: I'm using Excel 2007, but the code has to work for Excel 2003 as well. My problem is the following: I need to access cells in a different workbook, which may be closed. The following code can be found all around the web: ''' Function Foo() Dim cell As Range Dim wbk As Workbook Set wbk = Workbooks.Open("correct absolute path") ' wbk is Nothing here so the next statement fails. Set cell = wbk.Worksheets("Sheet1").Range("A1") Foo = cell.Value wbk.Close End Function ''' sadly, wbk is Nothing after the open statement (I'd love to give a better error message, but no idea how I'd do that; what I'd give for a real IDE and an useful language :/). The absolute path is correct and points to a valid excel xlsx file. Also I assume the best way to do this, is to "cache" the workbook and not open/close it every time the function is called? Any possible problems with that (apart from having to handle the situation when the workbook is already open obviously)? Image while stepping through: <IMAGE>
I can reproduce this problem. It only happens to me when I attempt to paste this code into a user-defined function. I believe this is by design (the quote is for XL 2003, but the same thing happens to me on XL 2010) > Using VBA keywords in custom functionsThe number of VBA keywords you can use in custom functions is smaller than the number you can use in macros. Custom functions are not allowed to do anything other than return a value to a formula in a worksheet or to an expression used in another VBA macro or function. For example, custom functions cannot resize windows, edit a formula in a cell, or change the font, color, or pattern options for the text in a cell. If you include "action" code of this kind in a function procedure, the function returns the #VALUE! error. <URL> The only workaround I've found is to call this kind of code via a normal macro. Something like selecting the cells to apply it to, then looping over Selection or the like.
18,820,032
1
18,822,039
This is the structure of my Table which stores meter readings for machines. I need to save all readings so I can retrieve readings for any date and validate any new readings. <IMAGE> I have an index on AssetID, ForDate Descending so the latest readings are at the top. It's taking too long to find the latest meter reading for a machine with this table. I don't want to de-normalize the meter reading against the Machine as it would cause concurrency issues when two or more people try to enter readings at once. Any suggestions to make this faster? EDIT: This is my LINQ2SQL Query ''' Dim res = From a In db.AssetMeterReadings Where _ a.AssetID = ast.AssetID And a.ForDate <= dAt.Date _ And a.isInactive = False _ Order By a.ForDate Descending, a.ApproximateReading Descending Take 1 '''
Are you trying to get just one row or the latest entry for many/all AssetID? If you are trying to query for many the latest entry for many different assets then the index will not help you much. I would suggest you to 1. Add a now column IsLatestReading(bit) 2. Add trigger for INSERT, UPDATE, DELETE to keep column IsLatestReading just be careful with the recursive trigger it will cause the trigger something like: update MyTable set IsLatestReading = 0 inner join DELETE on DELETE.AssetID = MyTable and IsLatestReading = 1 update table MyTable set IsLatestReady = 1 inner join INSERTED on INSERTED.MeterReadingID = MyTable.MeterReadingID 3. create index on IsLatestReading DESC, AssetID, ForDate Note: If you use bulk insert to load the readings, you'll won't need the trigger, just an update to the column would do...
27,182,573
1
27,182,677
I am making an app i want to set my position of 'UITextfield'. but i am stuck in it, it is setting only 'vertical position' not 'horizontal position'. below is my code and screen shot ''' Msgtextfield.placeholder=@"demo"; CGRect frame = CGRectMake(100,100,10,100); UILabel * leftView = [[UILabel alloc] initWithFrame:frame]; leftView.backgroundColor = [UIColor clearColor]; self.Msgtextfield.leftView = leftView; self.Msgtextfield.leftViewMode = UITextFieldViewModeAlways; self.Msgtextfield.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; self.Msgtextfield.contentHorizontalAlignment=UIControlContentHorizontalAlignmentCenter; ''' <IMAGE>
use 'CATransform3DMakeTranslation' don't forget to import 'Quartzcore framework' ''' self.Msgtextfield.layer.sublayerTransform=CATransform3DMakeTranslation(5, 0, 0); '''
27,132,599
1
27,152,732
I'm working on plotting gene orders of two organisms using genoPlotR in R. I have my data downloaded from Nucleotide NCBI database in gb format. My data plots perfectly, however, names of genes appear to be crammed up, and I did not really find a way to make space between them or expand size of segment. my code is the following: data files: ''' twelve<-try(read_dna_seg_from_file("//Users/location/12.gb")) thirteen<-try(read_dna_seg_from_file("//Users/location/13.gb")) ''' annotation files: ''' ann_twelve<-annotation(x1=middle(twelve), text=twelve$name, rot = 30) ann_thirteen<-annotation(x1=middle(thirteen), text=thirteen$name, rot = 30) ''' comparison file: ''' out144<-try(read_comparison_from_blast("/Users/location/out144.out")) ''' plotting: ''' plot_gene_map(dna_segs=list(twelve,thirteen),comparisons= list(out144),annotations=list(ann_twelve, ann_thirteen), annotation_height=0.8, gene_type="side_blocks",dna_seg_scale=TRUE,scale=FALSE, dna_seg_labels=c("twelve","thirteen")) ''' I have been trying different ways to modify segment size on the plotting code, but was not successful. Here is how my plotted data looks like: <IMAGE>
Crossposted on <URL>. Use the argument annotation_cex=0.5 (or less) in plot_gene_map function.
13,825,952
1
13,830,633
Could you please suggest how is it possible to implement the next thing : when the user clicks on the file name/line number, the editor is switched to that file. <IMAGE> P.S. The source code is available <URL>.
Check the following classes/methods: - <URL> Usage example: - <URL> See also <URL> help section.
10,686,949
1
10,689,840
I have a very strange issue. I am not able to run a windows azure application which has a WCF service and mschart in it. Following are the steps to reproduce the error: 1) Create a new windowsazureapplication with a blank asp.net webrole 2) Now add a new WCfService 3) run to check it runs ok 4) now in one of the pages include mschart, and open the design of the page to make sure the webconfig is changed to use the mschart. 5) now try to run the project. I am getting error message like this one: <IMAGE> Is this a problem with windows azure or am I doing somthing wrong? FYI: This is not my first project on windows azure.
I think I have found the solution. You just need to add the following in your web.config inside system.webserver section: ''' <validation validateIntegratedModeConfiguration="false"/> ''' The final system.webserver looks like as below: ''' <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <handlers> <remove name="ChartImageHandler" /> <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </handlers> <validation validateIntegratedModeConfiguration="false"/> </system.webServer> ''' After adding above, I did not see the problem at all.
12,275,182
1
12,275,235
Data or value in '$description' from database is ''' <div><a href="www.google.com">Henry</a></div> ''' My HTML Code ''' <input type="textbox" id="textbox" value=""/> <input type="hidden" id="hidden" value="<?php echo $description; ?>"/> ''' Output : <IMAGE> If the code be ''' <input type="hidden" id="hidden" value='<?php echo $description; ?>'/> ''' Its working fine !..Any one please tell me the issue ?
You are trying to have HTML code inside the value of a hidden input in a form? That doesn't sound right. If you need to keep it as it is, you should at least use <URL> to make it a string: ''' <input type="hidden" id="hidden" value="<?php echo htmlentities($description); ?>"/> ''' An example: ''' <?php $str = "A 'quote' is <b>bold</b>"; // Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt; echo htmlentities($str); // Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt; echo htmlentities($str, ENT_QUOTES); ?> '''
11,040,693
1
11,041,752
I have two cameras setup as shown in following picture: <IMAGE> What I have with this setup: - '(x1,y1)'- '(x2,y2)' How can I trace/identify real world 3D coordinates '(x,y,z)' of this green object via these two cameras (i.e combination of top view image and side view image)? I know how to calibrate single camera using JavaCV/OpenCV but I don't know how perform stereo calibration other stuff using JavaCV/OpenCV. What is the step-by-step procedure for doing such stereo calibration via two cameras? What would be the output (e.g., intrinsic matrix, distortion etc.) of such a stereo calibration process and how can I use that output in order to compute the real world 3D coordinates of this green object?
After looking at the picture,I think you may face problem in implementing stereo algorithms for your a setup. The stereo rectification works well when the cameras are almost fronto-parallel . For your camera setup, you can hardly get any rectified image on which you could find any disparity matching.
23,985,567
1
23,985,776
Lets shy my listbox has 3 names Anna,Sam and Wendy how would I go about writing those in a text file like this. Name #1 is Anna Name #2 is Sam Name #3 is Wendy! An example of how I need my code to look <IMAGE>
You need to iterate through your 'ListBox' collection like this. I am just printing this to the Output Window in Visual Studio. ''' For Each lbi As String In ListBox1.Items Debug.Print(Chr(9) + Chr(9) + "ent = maps\ (" + Chr(34) + lbi.ToString() + Chr(34) + ");" + vbCrLf) Next ''' For writing to a file you could use something like this, I am using 'File.AppendallLines' so that it will not overwrite the existing file you could use 'File.WriteAllLines' which would overwrite it. ''' Dim myList As List(Of String) = New List(Of String) For Each lbi As String In ListBox1.Items myList.Add(Chr(9) + Chr(9) + "ent = maps\ (" + Chr(34) + lbi.ToString() + Chr(34) + ");" + vbCrLf) Next File.AppendAllLines("C: emp\myDataFile.txt", myList) '''
43,708,653
1
43,709,435
I have a view controller with UIImagePickerControllerDelegate and UINavigationControllerDelegate to pick photo. I also want to make the same preview view when I picked photo done like the preview view when I taken photo done. <IMAGE> Have any suggestion? Thx!
You can get the 'UIImagePickerController' to show the preview screen when choosing a photo if you set 'picker.allowsEditing' to true. Be aware though that this will allow users to crop and reposition their photo in both the photo library and camera source types.
14,580,544
1
14,586,353
If you notice in this font family -<URL>, the 'T' almost overlaps with 1/4 of the 'U'. When I have included this font family using @font-face, and I type, the cursor types the T but remains on it only. <IMAGE> This causes the problem that when I copy this text into a span with its width as 'auto', the span does not show the complete 'T' but till the point where the arrow is . Any solution for this?
This is a feature of the font, and it is not uncommon in script fonts. For example, the advance width of the letter "T" is considerably smaller (1,146 units, to be exact) than the width of the glyph, i.e. the width of its bounding box (which is 1,786 units). This is intentional, part of the design that makes the result resemble handwritten text. For inline elements containing text in this font, use some right padding to compensate for the effect. Although the effect of extending to the right of the bounding box is mostly a feature of glyphs for uppercase letters, which normally do not appear at end of word, it also occurs for lowercase letters such as "f". A value of '0.25em' would seem to be suitable, based on the following simple experiment: ''' <span style="font-family: CAC Champagne; font-size: 32pt; border: solid red 1px; padding-left: 0.25em; padding-right: 0.25em;">f</span> '''
17,609,977
1
17,780,480
I used <URL> for Bootstrap modals on mobile devices as a base for some new code: ''' .modal { position: fixed; top: 3%; right: 3%; left: 3%; bottom:3%; width: auto; margin: 0; } .modal-body { height: 60%; } ''' ''' .modal-body { max-height: 350px; padding: 15px; overflow-y: auto; -webkit-overflow-scrolling: touch; } ''' The problem is I'm having is I get extra space at the bottom of the modal. <IMAGE> How can I remove this space? I made a <URL> that demonstrates the issue. Try changing the height of the browser in this <URL> but the height of '.modal' overlaps the height of the screen and its not responsive
You could check to see if the orientation is landscape - and minimize the size of the modal-body accordingly <URL> ''' @media only screen and (orientation : landscape) { .modal-body { height: 160px; } } ''' --- Oh and by the way: In the fiddle I fixed up the rounded corners of the model as well by adding the class: ''' .modal-footer { border-radius: 0 0 4px 4px; } '''
26,563,177
1
26,565,628
I'm new in Java and Hibernate as well. I'm following this tutorial @ <URL> I managed to compile the code and understood the concept as well. But the problem is that I don't know how to execute the code to debug some stuff. When I start app as java application in eclipse. I have a long list to of option. But I don't see my actual test class to run. So How to run it and debug this app? Also I tried this @ <URL>. Same is issue. No idea how to run. Please check the screen shoot of eclipse list while:- <IMAGE>
There is a 'main()' method in 'TestHibernate.java'. Use it.
29,910,356
1
29,942,501
Not sure if the is achievable using the Core Plot framework, wondering if anyone has an idea on this? What I want is to have a bar chart with the X-axis having different labels to give additional info as the image below! <IMAGE>
Core Plot can display attributed strings in titles and labels. Create custom axis labels and set the 'attributedText' on the label text layer.
15,798,422
1
15,804,919
In what seems to be a very odd turn, I am trying to create a Sql Database project in Visual Studio 2012, and am getting this nutty error: <IMAGE> And clicking on either link leads to a Page Not Found at Microsoft.com, which is odd in itself. From the bare text of the error message, which is (for search purposes): > This version of SQL Server Data Tools is not compatible with the database runtime components installed on this computer. Considering that I have Sql Server 2012 Developer Edition installed on the workstation, this seems incredible. I can open or create a database project in VS2008 with Sql Server 2012 DE installed, so why not VS 2012?
I Installed SQL Server 2012 Service pack 1 yesterday and then I started getting the problem you describe in Visual Studio 2012. Not only with database projects; I could not use the SQL Server Object Explorer, not open sql-scripts and lots of other weird database related errors. Always with the same message: "This version of SQL Server Data Tools is not compatible with ... bla, bla, bla ..." This solution helped me: <URL> Hope this can help you too With the it seems you have to also update the SQL Server Data Tools available <URL> for more details.
25,227,370
1
25,227,417
I have an element with a background image. On the top and bottom of the element, I want a translucent bar with the image showing underneath. Here is an image of the problem: <IMAGE> --- Here is my markup: ''' <div class="section-header art"> <h1>Art</h1> </div> ''' Here is my styling (SASS, old syntax) ''' .section-header.art background-image: url(../../img/interpretations__art.bmp) background-size: cover background-repeat: none padding: 5em 0 box-sizing: border-box border-top: 5em solid rgba(255,255,255,0.2) border-bottom: 5em solid rgba(255,255,255,0.2) h1 font-size: 4em font-family: $type__head font-weight: bold text-transform: uppercase letter-spacing: .4em text-align: center color: rgba(255,255,255,0.5) ''' --- Just in case you didn't quite notice the issue, the image is repeating in the upper-border, which is not the desired effect. Thanks in advance for any help you can provide!
'background-repeat: none' it isn't a valid value for background-repeat you should change it to 'background-repeat: no-repeat'. UPDATE: You could resolve this issue by adding a 'background-position: 0 -5em;' see an example here: <URL>
17,255,506
1
17,255,947
I have problem on my website. If I open my website with HTTPS protocol, chrome shows an empty area at the bottom of page. You can reproduce this if follows this steps: 1. Open new separate incognito tab using the lastest chrome version on windows 2. Go to this page. It will show a message that certificate is invalid. Ignore it. 3. At the bottom of page should appear unused area. Why chrome shows this empty area on my page? It will disappear if I resize window. I also tried to disable all plugins, but it didn't help. <IMAGE>
Depending on which version of Chrome that you are using, there is a reported issue of this grey area displaying only when the "Show bookmarks" (ctrl-shift B) is selected. Here is a link to the bug report: <URL> The issue purports to be fixed in the current version of Chrome.
20,329,970
1
20,332,123
I have a viewmodel like ''' AppViewModel = { agent : ko.observableArray([ { name : 'test', age : '23' }]) }; ''' My json data comes like ''' {"agent":[{"name":"john","age":"23"},{"name":"conor","age":"23"}]} ''' for ajaxcall every 3 sec I could able to replace the observable array like <URL> ''' success : function(responseData) { var data = ko.toJS(responseData); AppViewModel.agent(data.agent); } ''' Some times the json data comes like ''' {"agent":[{"name":"john"}]} ''' without age, in this case the incomplete data stays with the observable array and getting script error as ''age' is undefined' in databinding even after new response arrives like '{"agent":[{"name":"john","age":"23"}]}' I want whole obsevable array to replaced with new data. Thanks <IMAGE> DataBinding: ''' <!-- ko foreach: agent--> <tr> <td style="font-weight:bold;" data-bind="text: name"></td> <td style="font-weight:bold;" data-bind="text: age"></td> </tr> <!-- /ko --> '''
If you prefix your property with the '$data' special <URL> property then KO won't complain if the given property does not exists. So if you write '$data.age' then you don't get an error if the server sends an object without the 'age' property: ''' <tr> <td style="font-weight:bold;" data-bind="text: $data.name"></td> <td style="font-weight:bold;" data-bind="text: $data.age"></td> </tr> ''' Demo <URL>.
16,356,838
1
16,358,197
I have attached a sample image with explains the requirement. I have a 16x16 matrix or random values (1-1000) generated by 'randi(1000, 16, 16)' Now I add a 4x4 matrix of same number (eg. 80) somewhere in the 16x16 matrix. How to I make the large numbers (1-1000) to deviate to my new block of 80s so that the values near 4x4 bock have values closer to 80? <IMAGE>
You can apply a weighted average. - 'x''80'- '80''1''x''0'- '80''x'
28,837,500
1
28,837,622
In c# I can apply this property on RadioButton <IMAGE> So the RadioButton is displayed like a PushButton but it's still a radio button. Is there a way to do that with Qt in c++ ? maybe programmaticaly.
Use 'QPushButton' and 'setCheckable( true )'. This will get you the same behaviour as a 'QRadioButton'.
36,201,863
1
36,201,955
I've seen the way to set this element's width to the width of another element, but I haven't seen the way to do this for the height. Could someone explain how to do this with only the height? <IMAGE>
> You need to use 'position'ing here: ''' .parent {position: relative; margin: 100px; border: 2px solid #333; text-align: center; height: 150px;} .parent .child {position: absolute; border: 2px solid #999; height: 250px; top: -50px; left: -2px;} ''' ''' <div class="parent"> Parent Div <div class="child">Child Div</div> </div> ''' <IMAGE> I would like to give full credits for <URL> for attempting something awesome like this, using values. ''' body { background: #aaa; } .parent { width: 80vw; height: 20vw; background: #fff; margin: 15vw auto; box-shadow: 0 0 2em 0 rgba(0,0,0,0.2); position: relative; } .child { position: absolute; width: 25%; top: -50%; height: 200%; background: rgba(255,0,0,0.2); } ''' ''' <div class="parent"> <div class="child"></div> </div> ''' I would really wanna appreciate the colour combinations. ':)' <IMAGE>
30,038,023
1
30,038,207
I have two container views as seen in the attached image. I am trying to click a button which is inside the top container which will change the content of the UIImage which is in the bottom container. <IMAGE> I have a method which handles the change in the class of the bottomviewcontroller: ''' func changeImage() { myImage.image = UIImage(named: "02.jpg") } ''' But I do not know how to execute/call it from the TopViewController. I have also attached the project : <URL> Thanks, Koray Birand
Sounds like a job for NSNotification. Have the top controller handle the button by posting a notification. Have the bottom controller listen for that notification and make the image change as a result. (Otherwise, you would need to have the inner controller talk to the container, which would then have to talk to the other inner controller...messy.)
14,919,998
1
14,920,013
I'm a new bie to CPP. I'm trying to use 'pointer' and 'cin' combination which is giving strange result. ''' int *array; int numOfElem = 0; cout << " Enter number of elements in array : "; cin >> numOfElem; array = new (nothrow)int[numOfElem]; if(array != 0) { for(int index = 0; index < numOfElem; index++) { cout << " Enter " << index << " value"; cin >> *array++; } cout << " values are : " ; for(int index = 0; index < numOfElem; index++) { cout << *(array+index) << ","; } }else { cout << "Memory cant be allocated :("; } ''' The out put is <IMAGE> What the problem with my code ? Regards, Sha
You are advancing the pointer, 'array', in the first loop: ''' for(int index = 0; index < numOfElem; index++) { cout << " Enter " << index << " value"; cin >> *array++; } ''' And then you pretend you are using the original, unmodified pointer in the second loop: ''' cout << " values are : " ; for(int index = 0; index < numOfElem; index++) { cout << *(array+index) << ","; } '''
24,388,592
1
24,388,881
I have 4 '<div>''s having different height which i want to be vertically center aligned inside their parent (with black background.) As shown in the picture below <IMAGE> HTML ''' <div style=" background-color:black; height:500px;width:500px;"> <div style="display:inline-block; background-color:red; height:400px;width:50px;"> </div> <div style="display:inline-block; background-color:blue; height:300px;width:50px;"></div> <div style="display:inline-block; background-color:green; height:200px;width:50px;"></div> <div style="display:inline-block; background-color:yellow; height:100px;width:50px;"></div> </div> ''' Here is the <URL>
If you understood correctly, you can make use of <URL>. ''' #container{ display:flex; align-items:center; } ''' ## Demo '#container''id''<div>'
17,639,592
1
17,639,639
This is what i am trying to do; <IMAGE> Is this even possible?
Do you mean something like this? <URL> ''' .wrap { height: 400px; border: 1px solid red; } .left { height: 400px; width: 120px; float: left; border: 1px solid green; } .max { height: 400px; margin-left: 130px; border:1px solid red; } ''' Explanation: 'float: left;' your first 'div' and move other element to the right using 'margin-left: fixed-div-width + some extra space' and than encapsulate both elements in a wrapper. Just a side note, don't forget to clear your floating elements
9,729,823
1
9,730,344
I'm working on an application which list movies from a database. Except for general information (title, year etc) I list genres (one dropdown list per genre, which the user can choose genre from). The thing is that I don't want the user to be able to delete a genre if only one exists (ie. a move should always have at least one genre), and here's where I need some help. In the datasource I've created an event for Deleting, where I hope I could accomplish what I want. So, my idea is to find out if it only exists one dropdown list (ie. one genre), and if so, stop the event (deletion) from happening. I would really appreciate some help here. Thanks in advance! ''' protected void MovieGenreDataSource_Deleting(object sender, ObjectDataSourceMethodEventArgs e) { DropDownList ddl = FindControl("GenreDropDownList") as DropDownList; if (// Number of genres = 1) { e.Cancel = true; } } ''' Here's a screenshot from my app (in swedish), where "Redigera" = edit, "Ta bort" = Delete and "Lagg till" = "Add". I hope it makes my problem more clear. <IMAGE>
Is this what you need? ''' if (ddl.Items.Count <= 1) { e.Cancel = true; } '''
17,676,596
1
21,795,260
Using 'UISearchDisplayController', I am showing a 'UIView' in bottom so causes hiding the filtered data while scrolling the table. I used 'contentInset' property to show data in bottom. My problem is that 'NSStringFromUIEdgeInsets(self.searchDisplayController.searchResultsTableView.contentInset)' is showing the 'bottom' value as '216' even if I reset the UIEdgeInsetsZero. When I do multiple search the more data is not visible after scrolling: <IMAGE>
if you want to set self.searchDisplayController.searchResultsTableView.contentInset, you should do in the delegate: ''' - (void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView { controller.searchResultsTableView.contentInset = UIEdgeInsetsMake(0.0f, 0.f, 30.f, 0.f); } '''
25,928,938
1
25,930,439
Is it possible to support 'arm64' using Xcode 6? > Update with answer (the option is visible when 'All' is selected):<IMAGE>
You go to the Navigator Inspector and select your project. Then you select your Target and Build Settings. Search for "Valid Architectures and remove arm64. That will be enough.
12,540,152
1
12,540,379
The iPhone version of my app supports 'UIDeviceOrientationPortraitUpsideDown' and 'UIDeviceOrientationPortrait', but the iPad version supports all Orientations. In my view controller I have this: ''' -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } ''' and my Info.plist file has this: <IMAGE> The problem is that when I build the app to my iPod, the app won't turn upside down. The iPad will support all Orientations. I've tried removing the 'shouldAutorotateToInterfaceOrientation' all together and I've tried this code: ''' -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation = UIDeviceOrientationLandscapeLeft) && (interfaceOrientation = UIDeviceOrientationLandscapeRight) && (interfaceOrientation = UIDeviceOrientationPortraitUpsideDown) && (interfaceOrientation = UIDeviceOrientationPortrait); } ''' But for some reason, the upside down just won't work! Are there any other solutions for this?
Figured it out, the iOS6 SDK uses 'shouldAutorotate' so here is my new code: ''' -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } '''
21,297,236
1
21,337,401
I have hours stuck on this, I dont know why I lose my json, with lose I mean it has the 'structure' but not the values. I am trying to return a JArray with JObjects of the Newtonsoft .Json library. this is a simple example, I am trying to do this with Linq, but get the same results. I am using asp mvc, I took <URL> example My controller: ''' JArray jsonTest = new JArray( new JObject { {"Title", "hello"}, { "Author", new JObject { {"Name", "hello"}, {"Twitter", "hello"} } }, {"Date", "hello"}, {"BodyHtml", "hello"}, }, new JObject { {"Title", "hello"}, { "Author", new JObject { {"Name", "hello"}, {"Twitter", "hello"} } }, {"Date", "hello"}, {"BodyHtml", "hello"}, } ); return Json(jsonTest,JsonRequestBehavior.AllowGet); ''' and I get: <IMAGE> as you can see my structure is there(2 objects, second object is an array with 2 elements), but i have no data in it. I tried jsonTest.tostring() but I get an array of each char in my string. What am I missing?
Add the two JObjects into an Jarray like
12,934,256
1
12,982,670
Is there a way to publish a chart with a Google spreadsheet script? I dynamically create charts, but need a way to also dynamically publish these charts. I am referring to the process of publishing a chart from the hidden menu at the top right of a chart. See below. <IMAGE>
Unfortunately this functionality doesn't exist in Apps Script, but you can file a feature request on our <URL>.
13,646,513
1
13,646,569
I even don't know, what to write in title bar. I want my app to implement this feature: <IMAGE> For those, who don't understand what I'm talking about: I have a 'LitsView'. I want to load some more data, if the user pulls the 'ListView' "out of it boundaries". Maybe there's some tutorial for this?
Have a look at <URL>. It's the best pull-to-refresh library on Android.
25,445,301
1
25,483,219
I recently got into Win32 programming and I bumped into a bug I couldn't seem to find anywhere on the net yet. I have an Edit Control that behaves a bit odd. I have a maximum of 3 characters set for the control. When I enter a number ('ES_NUMBER' is set) it keeps adding it to the control - if it weren't for the limit. Image of when I enter a 0: <IMAGE> It does the same for Delete and Backspace - the entire control is cleared instantly. I have the feeling that window procedure messages that are sent to the edit control's default window procedure might not be cleared from the message queue. Is there any way to find out if this is the case? Has anyone ever experienced this kind of behavior? I don't manually process any of the messages for the Edit Control.
This seems to have been a problem with PeekMessage/GetMessage. Message intended for Dialog Windows (while my window was not a dialog) were not being removed by PeekMessage until a new message appeared in queue, even though PM_REMOVE was specified. Replacing the line with GetMessage fixed the issue.
26,401,965
1
26,402,061
I'm new to Xcode I have lots of constraints on the object, How to remove it on XCODE? Thanks <IMAGE>
To remove a single constraint just select it and hit delete. To remove constraints for a single view you select the view and hit the triangle button in the bottom right hand corner... <IMAGE> And hit "Clear Constraints" under the "Selected Views" part. To clear constraints for an entire View Controller do the same but hit "Clear Constraints" under the "All Views in ..." part. To clear all constraints in the Storyboard you'd be best to disable Auto Layout and then re-enable it for the Storyboard.
60,605,189
1
62,550,039
I'm trying to use Google Data Studio (GDS) to display a dashboard with a map. I want to show 2 metrics on the tooltip - and . But GDS lets me select only one metric at a time as the default and makes everything else optional. Is there a way to show both metrics ? I'm able to show both metrics on the map using Tableau Public. However, I would prefer staying within the Google ecosystem, if possible. For reference, I've attached a screenshot below - comparing the two visualizations. <IMAGE>
<URL>. However, as alluded to, <URL> would allow viewers to choose a single metric from a range of different metrics. <URL> and a GIF to demonstrate: <URL>
8,545,605
1
8,545,636
The Android search dialog below is displaying suggestions I supply using my own content provider (aardvark, another, apple). Below that list is a second list (about, all, ...) which I do not want. What is the technical term for that second list, and why is it shown? How can I suppress it? <IMAGE>
The second list is an auto-completion feature which has nothing to do with your search dialog. It is a keyboard feature which suggests common words from a dictionary. It can be enabled or disabled in the keyboard preferences but the choice is up to the user. Generally it is disabled by default but on the emulator the default settings are sometimes different (because it emulates a development device, not a production device). It can also change between languages. If you are sure that these suggested words are useless then you can disable this feature by adding <URL> to your '<searchable>' tag.
21,023,394
1
21,023,444
<IMAGE> The placeholder text in the third box appears in the middle while i want to be at the top. ''' <div id="message"> <ul> <li><h1>Send us a message</h1></li> <li><input type="text" placeholder="Name"></li> <li><input type="text" placeholder="Email"></li> <li><input type="text" style="height:150px;" placeholder="Message"></li> <li><a href="#">Send</a></li> </ul> </div> ''' Here is <URL>
If you're wanting a multi-line input field you should use the 'textarea' element. ''' <li> <textarea placeholder="Message"></textarea> </li> ''' You can then style this however you like using the 'textarea' selector: ''' #message input, #message textarea { width: 250px; height: 40px; padding: 10px; } #message li input[type=text], #message li textarea { border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border: none; } #message li textarea { height: 150px; resize: none; } ''' <URL>.
20,119,646
1
20,119,727
I'm totally new in this area please tell me how to fix my problem. when I write this query "'SELECT * FROM places'" in my database everything is okay. However when I change it to "'SELECT * FROM places WHERE eventId=2'", I get error. Please look at this image. <IMAGE> as you can see, 'eventId' column is exist. Why my query throws error?
You've almost certainly added the column names in a case-sensitive environment. (PgAdmin comes to mind.) Lowercase them in that same environment to avoid the need to quote fields. Or change your query to: ''' select * from places where "eventId" = 2 '''
7,111,260
1
7,118,692
How can I make the total paramater appear only on the last page of a report with lots of concepts. The report repeats istelf until the list of concepts is displayed in two or more pages. The total appears in all of them because the parameter (received as $PTotal) is on the footer of the page. I need this to be displayed only in the footer of the last page. It doesnt matter if I leave that space as blank, I just need the parameter to be displayed only at the last page. This is not a report composed of varios pages, it generates multiple pages until the list fits. Just to clarify. <IMAGE> How can I fix that parameter tag with a printWhenExpression tag?
Copy your footer band and rename it to a lastPageFooter band. Keep the original footer intact, but delete the textField for $P{total} from it. The lastPageFooter band, including your total, will only be printed on the last page of the report.
24,634,263
1
24,634,378
Ever since Delphi XE2 (or even before) the build dialog appears in the bottom right corner of the screen. Because I'm a curious fellow I'd like to see what's going on. But that's hard when it's way there in a corner. <IMAGE> If I move the dialog to the centered position the IDE does not register/remember this and keeps on putting in in the corner every time it compiles.
You have enabled background compilation: . <IMAGE> The designers presumed that you did that because you did not want the compilation progress to disturb you, and stop you being able to see the editor window. The whole point of background compilation is for you to be able to carry on working in the IDE whilst compilation progresses. If the dialog was shown in the middle of the IDE window then you would not be able to see what you were working on. If you disable background compilation then the dialog will appear in the centre of the monitor.
15,506,492
1
32,909,489
I've created the following graphviz graph, represented a linked list with cycles: ''' igraph foo { rankdir=LR; node [shape=record]; a [label="{ <data> 12 | <ref> }", width=1.2] b [label="{ <data> 99 | <ref> }"]; c [label="{ <data> 37 | <ref> }"]; a:ref:c -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false, arrowsize=1.2]; b:ref:c -> c:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; c:ref:c -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; } ''' Unfortunately, the arrow from 'c:ref' to 'b:data' crosses node 'c': <IMAGE> How do I force the edge to go around the nodes without crossing them?
I can't find a simple and fully satisfying answer, but changing the compass point may help. ''' digraph foo { rankdir=LR; node [shape=record]; a [label="{ <data> 12 | <ref> }", width=1.2] b [label="{ <data> 99 | <ref> }"]; c [label="{ <data> 37 | <ref> }"]; a:ref:c -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false, arrowsize=1.2]; b:ref:c -> c:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; c:ref:s -> b:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; } ''' <URL>
16,830,397
1
16,830,471
I have to send 301 response code.Below is the code I am using : ''' resp.setContentType("text/html"); PrintWriter out = resp.getWriter(); out.println(origReqBody); resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); resp.setHeader("Location", homeSiteRedirUrl); ''' here i have observed that if "origReqBody" is blank then it is sending 301 and if it "origReqBody" is having some string then code is sending 302.In case of 302 i can see that Location Header is visible in the response 4 times. Need to understand this behavior. I need to send body in 301.Is it possible. Edit : After making setHeader and setStatus above println... <IMAGE> message 7 and 11 : If "origReqBody" is blank message 27, 31 : If "origReqBody" is not blank Same behaviour...i was expecting 301 instead of 302
'PrintWriter' actually writes to output stream if there's content, which requires it to go ahead and serialize the headers and status code, since they come first in the response. So it's just ignoring subsequent calls to 'setStatus' and 'setHeader'. Just move those calls above the 'println' and I bet it'll work as you expect.
1,347,386
1
1,347,436
I can't pull up my tables so I can use them in my stored procedure. Any reason why they aren't showing? <IMAGE>
Have you just created them? Intellisense data used by it is cached. Try to refresh it > Edit -> IntelliSense -> Refresh Local Cache
40,997,267
1
40,997,600
I use online note taking editors to take notes. One of them I'm using is called dynalist.io. I run stylebot (chrome plugin) to apply specific CSS sheets to those pages Normally when i put a URL link inside of my documents, I put two types: - - I'd like to apply CSS styles on those '<a href>' tags seperately, however the program defaults the same class for all domain links so I cannot use CSS classes to achieve this unless (to my knowledge) use javascript to target '<a href>' and make seperate classes for different domain links. Then apply CSS rules Reference image: <IMAGE> How would I go about doing this? edit: would I have to use greasemonkey to inject javascript?
You can add the following rules at your css file (this is not efficient): ''' a[href^="http://i.imgur.com"] { color: red !important; } ''' It is like a regexp, and it is not efficient for a standard css, but in your case... will be good. EDIT: The '!important' is just to make sure you will overwrite other css rules. The regexp is not efficient (for big pages) because the css need to check all the '<a>' tag and make a control. If you need to change the color of other links, you need to create the same rule but with another link.
13,508,836
1
13,509,230
<IMAGE> I need to implement the concept of 'dropdown' in Xcode. For that purpose, I'm using a 'UIPickerview'. This pickerView loads when a textfield is tapped (on textFieldDidBeginEditing:)event. Is there a way, that I can add a image to 'TextField'? The image is like an arrow mark by which user can understand that a 'dropdown' appears when 'textfield' is tapped .How can I make it?
UITextField has a 'rightView' property, if you have image like this- <IMAGE> then You can easly set ImageView object to rightView: ''' UITextField *myTextField = [[UITextField alloc] init]; myTextField.rightViewMode = UITextFieldViewModeAlways; myTextField.rightView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"downArrow.png"]]; '''
22,455,278
1
22,456,556
I have a chart set up like this: ''' Dim chart1 as new chart() Dim yValues As Double() = {a1, a2, a3, a4} Dim xValues As String() = {level1, level2, level3, level4} chart1.Series.Add("Chart_1") chart1.Series("Chart_1").ChartType = SeriesChartType.Pie chart1.Series("Chart_1").Points.DataBindXY(xValues, yValues) chart1.Series("Chart_1").Points(0).Color = Color.FromArgb(255, 0, 158, 43) chart1.Series("Chart_1").Points(1).Color = Color.FromArgb(255, 255, 185, 59) chart1.Series("Chart_1").Points(2).Color = Color.FromArgb(255, 171, 0, 0) chart1.Series("Chart_1").Points(3).Color = Color.FromArgb(255, 175, 175, 175) ''' This works fine, but the default color for the x values that show up on top of the colors in the pie chart is black. I need to set the colors for each individual piece of the pie chart since black is too dark for some pieces and white is too light for others. How do I change the color of the text that represents the values of the pie pieces? Thanks. <IMAGE>
Try using the LabelForeColor property: ''' chart1.Series("Chart_1").Points(0).LabelForeColor = Color.Yellow '''
26,848,545
1
26,848,964
I'm creating <URL> and I need to use Keep-Alive connection header for my requests. I have the code ''' using (var client = new System.Net.Http.HttpClient()) { client.DefaultRequestHeaders.Add("connection", "Keep-Alive"); var str = await client.GetStringAsync(uri); return str; } ''' but I catch exception Please somebody show me where is my mistake and how I can set header to I've added screenshot from Wireshark where you can see header value by default (if remove ) <IMAGE>
'Windows.Web.Http.HttpClient' requests are 'Keepp-Alive' by default.
12,440,381
1
12,442,998
I'm just wondering if there is any simple/efficient way to check if square falls inside a triangle. or at least one corner falls inside or some overlaps. e.g. considering the figure below, I should be able to tell that the 3 squares fall inside. i.e. square 1 is obviously inside, one corner of square 2 is inside, and 3 overlaps. <IMAGE>
I'm checking out this nice <URL>. It explains how to test if a point is inside a triangle using various techniques. It seems it would help when a square corner falls inside. And I liked the Barycentric technique, here I re-implemented it for matlab: ''' function d = isinside(p,a,b,c) % Test if a point p(x,y) is inside a triangle % with vertices a(x,y), b(x,y) and c(x,y) v0 = c - a; v1 = b - a; v2 = p - a; A = [dot(v0,v0) dot(v1,v0);dot(v0,v1) dot(v1,v1)]; b = [dot(v2,v0); dot(v2,v1)]; x = A; % Check if point is in triangle if (x(1) > 0) && (x(2) > 0) && (sum(x) < 1) d = true; else d = false; end ''' Then I would test each vertex of the square, and if it happens one of them falls inside I would return. Quite lot of computation but it worths a try. For an overlap, I would test for intersections, as discussed in this <URL>, for every combination of lines from both a triangle and a square.
20,369,343
1
20,369,398
I got the "Bad receiver type 'void' " error in Xcode 5. I am using the following code, Method definition : ''' - (BOOL)allItemsSelectedFrom:(NSSet *)original selectedItems:(NSMutableArray *)selecteds{ NSLog(@"original = %@", original); for (id object in original) if([[object display] intValue]==1) if (![selecteds containsObject:[object name]]) return NO; int k=0; for (id object in original) { if([[object display] intValue]==1) k++; } //if(k==[selecteds count] && ([selecteds count]!=0)) if(k==[selecteds count]) return YES; else return NO; } ''' Method call : ''' BOOL allItemsSelected = [self allItemsSelectedFrom:profile.chemotherapies selectedItems:chemotherapies]; ''' <IMAGE>
it doesn't have anything to do with xcode. it haas to do with the base sdk headers the compiler doesn't know what method display to use as there are many add a cast from ID to the object you are working with so that it uses the right display method
27,038,559
1
27,038,633
I am trying to generate shadow for a UIButton. Below is what I am using. ''' myButton.layer.shadowColor = [UIColor blackColor].CGColor; myButton.layer.shadowOpacity = 0.5; myButton.layer.shadowRadius = 1; myButton.layer.shadowOffset = CGSizeMake(4, 4); myButton.layer.masksToBounds = NO; ''' But its generating shadow on right and bottom. Is there way where I can have shadow on all 4 sides? As an another solution, I am do this by putting image with shadow behind the button, but I don't want to go that way. Is there any way to get this done programmatically? Something like below. <IMAGE>
Since you offset the shadow by '{4, 4}' the shadow appears on the bottom-right side of the button. You could set a zero offset : ''' myButton.layer.shadowOffset = CGSizeZero ''' and by tweaking the 'shadowRadius' you might achieve what you want. Here is how a shadow is built: (1st row) start from your button's shape (2nd row) draw a black shape underneath your button and translate it by the amount specified in 'shadowOffset' : 10px on the left, 0px on the right. On the right one you can't see the black rectangle as it's directly underneath the button (3rd row) blur the black rectangle by the amount specified in 'blurRadius'. Zero means no blur and the black rectangle would stay sharp, so if you don't offset and don't blur, you'll see nothing. <IMAGE>
31,038,034
1
31,043,161
I'm trying out the Atom editor from Github and I really like it. I would like to create a simple (just to learn) plugin. I used the online resources to create the figgle example successfully. Now I would like to create something with an UI. I would like to add an input field to my UI, but how can I get it to be styled to same way Atom does. I see in the documentation that I have to create an element with 'atom-text-editor' tag. However this creates an text area with line numbers etc. I just want a single lined input field. So concrete, my question is: 'How can I create an input field which looks the same as the atom one.' <IMAGE>
Found the answer through atom slack chat. ''' var elem = document.createElement 'atom-text-editor' element.setAttribute 'mini', '' element.setAttribute 'placeholder-text', 'Search' ''' Which gives: <IMAGE>
12,758,824
1
12,758,925
<IMAGE> In the screenshot above I have manually selected the cells by clicking them but I want all the cells to be selected for editing by default.
You can use this code.... ''' for(int i=0; i<[array count]; i++) { NSIndexPath *indexP = [NSIndexPath indexPathForRow:i inSection:0]; [tblView selectRowAtIndexPath:indexP animated:NO scrollPosition:UITableViewScrollPositionNone]; [self tableView:tblView didSelectRowAtIndexPath:indexP]; } ''' Where 'tblView' is your 'tableView'.
74,545,704
1
74,546,179
I have added DSN for ODBC driver by using below pwoershell script ''' Add-OdbcDsn -Name "My_Connew" -DriverName "Simba ODBC Driver for Google BigQuery" -DsnType "System" -Platform "64-bit" -SetPropertyValue @("Email=246384378418-compute@developer.gserviceaccount.com", "Key File Path=C:ocus-sandpit-dfa36ce40776.json") ''' Everything wroking well but it can't able to add the file path. <IMAGE> Wondering how i can add file path through -SetPropertyValue ?
The labels used by the UI might not correspond 1-to-1 with the actual key names in the configuration schema - for example, the real key name for 'Key File Path' is just 'KeyFilePath' To figure out what to use, simply consult <URL> and find the appropriate key name for a given configuration option in the UI, then use those, e.g.: ''' Set-OdbcDsn -Name "My_Connew" -SetPropertyValue @( "Email=246384378418-compute@developer.gserviceaccount.com", "KeyFilePath=C:ocus-sandpit-dfa36ce40776.json", "Catalog=vocus-sandpitvocus-sandpit", "DefaultDataset=vocus_rawnew" ) '''
57,732,287
1
57,732,824
The image shows what I am trying to print,not sure how it can be achieved with a loop. <IMAGE> This is what I've been trying to solve the problem, what am I doing wrong? ''' Sub x() Dim i As Long Dim y As Long For i = 1 To 5 For y = 5 To 1 Step -1 Cells(y, i).Value = "x" Next y Next i End Sub '''
Here's one way you can do this with a loop: ''' Sub x() Dim i As Long For i = 1 To 5 Cells(6 - i, i).Value = "x" Next i End Sub '''
22,458,877
1
22,562,702
Wordpress have hotkeys which can be very useful when editing a page/post. example: <IMAGE> However, when i try to use a hotkey (Alt-Shift-m) to insert image on a OSX, or any other hotkey for that matter, it returns a symbol instead of applying the hotkey. any clue how to fix that ?
Found the answer... if you experiencing such behaviour, try checking if one of your chrome extensions is overwriting the hotkeys or conflict them. in my case it was
29,034,391
1
29,036,288
I need to install Ubuntu 64-bit on Windows 7 64-bit using Oracle VM Virtual Box. I downloaded Ubuntu Desktop iso file, opened the settings of VM and selected the disk image of Ubuntu. After this the following error message appears. How to solve this issue? UPDATE: I tried both 34-bit and 64-bit Ubunto. Both fail. <IMAGE>
Either your ISO is broken or you selected the wrong OS when creating the virtual machine. Try to redownload the file from the Ubuntu home page and mount it again. You can follow the steps from <URL>. Eventhough its for Ubuntu 14.04, the steps will not change.
71,092,427
1
71,187,307
I was working on a covid application which shows covid mortality rate during all the three waves, particularly for my country , but here the issue is while I'm trying to use leaflet package, its showing an error ''' import React from "react"; import { Map as LeafletMap, TileLayer } from "react-leaflet"; import "./Map.css"; import { showDataOnMap } from "./util"; function Map({ countries, casesType, center, zoom }) { return ( <div className="map"> <LeafletMap center={center} zoom={zoom}> <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' /> {showDataOnMap(countries, casesType)} </LeafletMap> </div> ); } export default Map; ''' this package name: Map.js even I had run the cmd in the terminal which imports the leaflet: 'npm i react-leaflet', but it is still showing error, please help anyone This is localhost error which it is showing <IMAGE>
You can use below code snippet to import Map. It will surely work: ''' import { MapContainer as LeafletMap, TileLayer } from "react-leaflet" ''' We need to import the content as it is from the dependencies. So, when the dependencies are updated this problem can occur, so you need to check what you have imported.
31,242,018
1
31,247,314
What do the red and green dots in the lower left of the symbol indicate? <IMAGE> The <URL> / Android Studio does not mention their meaning.
Green = getter, red = setter. If I have ''' private boolean mBacon = false; public boolean getBacon() { return mBacon; } public void setBacon(boolean b) { mBacon = b; } ''' I get <IMAGE>
19,232,070
1
21,898,647
I can't understand this at all. What is the problem here? I've tried typing '1.0', '1.0f', '(CGFloat) 1.0' and '(CGFloat)(2.0 - 1.0)'. Every time the same error. <IMAGE>
I would recommend using 'FLT_EPSILON' for this: 'XCTAssertEqualWithAccuracy(mov.lastDelta, 0.0f, FLT_EPSILON, @"");' Unless you have some reason to require a larger epsilon.
17,987,548
1
17,987,803
I have a multi-line 'TextBox', I want that the text which I select from 'TextBox' via mouse should get added to a 'List' once the mouse left click is released. The list is defined as ''' public List<string> PtagName = new List<string>(); ''' I attached picture in reference to this question <IMAGE> As shown in the image, whatever I select from 'TextBox' via mouse left click, it should get added to list
There you go: Hope it helps. ''' using System; using System.Collections.Generic; using System.Windows.Forms; namespace TextBoxLines { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public List<string> PtagName = new List<string>(); private void textBox1_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (textBox1.SelectedText.Length > 0) { string[] lines = textBox1.SelectedText.Split(' '); foreach (var line in lines) { PtagName.Add(line); } } foreach (var line in PtagName) MessageBox.Show(line); PtagName.Clear(); } } } } '''
10,055,535
1
10,055,843
Is it possible to place an image inside an image with OpenCv (JavaCv). For example i have a 1000x1000 image and a 100x100 image. And at position 600x600 i would like to place the smaller image inside the larger image. lets say the blue box is the 1000x1000 IplImage and the red one is the 100x100 IplImage. Is it possible to put the red box in the blue box. Preferably computational rather efficient because it has to work in real time. <IMAGE> Thx in advance
This is in Python, but conversion to Java is going to be real easy. Use 'GetSubRect()', and 'Copy()'. 'GetSubRect()' returns a rectangular subarray of interest (specify top left point of interest, and the width and height). Then just copy over the image using 'Copy()'. ''' import cv blue = cv.LoadImage("blue.jpg") red = cv.LoadImage("red.jpg") sub = cv.GetSubRect(blue, (100, 100, 50, 50)) cv.Copy(red,sub) cv.ShowImage('blue_red', blue) cv.WaitKey(0) ''' Alternatively, as karlphillip suggests you could specify the 'region of interest' using 'SetImageROI()', and do much the same thing: ''' cv.SetImageROI(blue,(100,100,50,50)) cv.Copy(red, blue) cv.ResetImageROI(blue) ''' Its very important to reset the ROI, 'ResetImageROI', otherwise you will only display/save the ROI, and not the whole image. Demo output: blue: <IMAGE>
29,506,648
1
30,247,028
Initially, I wanted to install the updated MinGW packages using the MinGW-get GUI, but it crashes when I choose "Mark All Upgrades" from the 'Installation' drop-down menu (whether I update the catalogue or not). Now, I want to figure out why 'guimain.exe' is crashing. <IMAGE> How can I diagnose and debug this persistent problem? I am vaguely familiar with GDB, but I've never used it. I am not committed to using the Visual Studio debugger. I assume I need to use some ancillary binaries or debug libraries in the latest MinGW installer branch here: <URL> Can anyone please guide me? Any assistance or suggested reading is appreciated.
I happen to have the same issue. The GDB way to debug this: 'gdb mingw-get.exe' 'r upgrade' (run with argument upgrade) GDB will automatically stop at a SIGSEGV (Segmentation fault) signal, that's what happens for me. 'bt' (get a backtrace) For me this resulted in a huge backtrace, filled with calls to: '#5013 0x6f9cdda4 in mingw-get-0!_ZN14pkgXmlDocument19ResolveDependenciesEP10pkgXmlNodeP13pkgActionItem () from c:\MinGW\libexec\mingw-get\mingw-get-0.dll' It looks like a recursion problem that quickly filled up the call stack. Note that function name is mangled, and we don't know the line number. This is the best you can do without debugging symbols. If you have the debugging symbols, GDBs output becomes more useful. For most Linux-style packages, you can get the debugging symbols in a -dbg package named similiarly to the stripped binary package. However I don't see a debug package for mingw32-mingw-get in the listing.
2,204,383
1
2,216,656
I was able to implement real-time mouse tracing as follow : <IMAGE> The source code is as follow : <URL> <URL> However, I unable to obtained the correct y screen coordinate, when an subplot being added. <URL> I suspect I didn't get the correct screen data area. When there is only one plot in the screen, I get a screen data area with height 300++ When a sub plot added to the bottom, I expect screen data area height will be reduced, due to the height occupied by the newly added subplot. However, I have no idea how to obtain the correct screen data area for the first plot. ''' final XYPlot plot = (XYPlot) cplot.getSubplots().get(0); // Shall I get _plotArea represents screen for getSubplots().get(0)? // How? // I try // // chartPanel.getScreenDataArea(0, 0); // chartPanel.getScreenDataArea(0, 1); // chartPanel.getScreenDataArea(1, 0); // chartPanel.getScreenDataArea(1, 1); // // All returned null // OK. I suspect this is causing me unable to get the correct screen y coordinate // I always get the same _plotArea, although a new sub plot had been added. final Rectangle2D _plotArea = chartPanel.getScreenDataArea(); final RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge(); final double yJava2D = rangeAxis.valueToJava2D(yValue, _plotArea, rangeAxisEdge); '''
Here is the code snippet to obtained the correct rectangle after dive into JFreeChart source code. ''' /* Try to get correct main chart area. */ final Rectangle2D _plotArea = chartPanel.getChartRenderingInfo().getPlotInfo().getSubplotInfo(0).getDataArea(); '''
11,526,552
1
11,529,392
I am using Visual Studio Express 2012. Where is the location of the log file? I have searched in the folder where my solution and projects are stored, but cannot find any .log file. This is the configuration for logging: <IMAGE>
You just have to work with See this similar thread: <URL> And in case you happen to do this for a C++ project, <URL>: > ... build log in the intermediate files directory ... The path and name of the build log is represented by the MSBuild macro expression, '$(IntDir)\$(MSBuildProjectName).log'.
8,057,463
1
8,057,898
I need two DIV to be put side by side and aligned vertically at their bottom. - - - <IMAGE>
<URL> I've used 'display: inline-block' combined with 'vertical-align: bottom'. ''' <div id="container"> <div id="left"> left<br />left<br />left<br />left<br />left<br />left<br /> leftleftleftleftleftleft </div> <div id="right"></div> </div> ''' ''' #container { border: 1px solid red; float: left; } #left, #right { border: 2px solid red; background: #ccc; vertical-align: bottom; display: inline-block; /* ie6/7 */ *display: inline; zoom: 1; } #right { margin: 20px 20px 0 20px; padding: 20px; width: 100px; } '''
29,100,590
1
29,103,777
I would like to display a different background for each different device (i.e. iPhone 4S, iPhone 5, iPhone6, iPhone 6Plus etc.). I am not talking about launch images but app's backgrounds that will be displayed while using the app. I have added the following code in my ViewController: ''' var bgImage = UIImage(named: "main_bg"); var imageView = UIImageView(frame: self.view.bounds); imageView.image = bgImage self.view.addSubview(imageView) self.view.sendSubviewToBack(imageView) ''' And I am ready to add the assets into the Images.xcassets catalog. This is what I see when I create a new "Image set" <IMAGE> Therefore, I am trying to match the assets with each different device. Thanks to this question: <URL> I now know that these devices will access the following images: > iPhone 3 -> 1x (image size: 320x480px)iPhone 4/4S/6 -> 2x (image size: 640x960px)iPhone 5/5c/5s/iPod Touch -> Retina 4 2x (image size: 640x1336)iPhone 6 Plus -> 3x (image size: 1242 x 2208) My question is, how can iPhones 4/4s and 6 access the same image if, clearly, it's not in the right size for both devices? Thank you
Try to check this answer: <URL> You can use this code to configure a different image as well: ''' NSNumber *screenWidth = @([UIScreen mainScreen].bounds.size.width); NSString *imageName = [NSString stringWithFormat:@"name-%@w", screenWidth]; UIImage *image = [UIImage imageNamed:imageName]; '''
13,603,438
1
13,603,601
I have a database where I want to display 2 records in a nicely formatted ASP.NET with HTML Each record would look like this on the web page <IMAGE> The layout would be layers. The data is in a SQL Server 2008 r2 database. Now whats the best way to get data to populate each record. Repeater? Or another method? Regards Tea
The repeater control is an easy control to use to make sure that your data is displayed the same for all entries in a given data source. <URL>
37,756,148
1
37,817,634
I'm using an ODBC connection to retrieve data on a Windows Server. After upgrading PHP from 5.4 to 5.6 (as well as on 5.5) all varchar fields seem to be returning random uninitialized memory, although the string length does match that of the field being queried. For example, a query returning the string "Test.txt" in 5.4 returns the following in 5.5+: <IMAGE> I've compared my 'php.ini' settings between the two versions and they seem to be identical in terms of what's being specific related to charsets and ODBC settings. I can run both versions side by side on the same ODBC resource at the same time and get these results. Non-varchar fields like dates and integers are printing correctly. I'm simply running the x86 thread safe 'php.exe' executable downloaded from <URL> for 5.4, 5.5, and 5.6. What else can I configure to try and resolve this? I'm using the Unified ODBC functions like so: ''' $o = odbc_connect("Driver=MMODBC;Server=localhost;Database=odbc_mapping;", [user], [pass]); $r = odbc_exec($o, "SELECT * FROM Table"); while (odbc_fetch_row($r)) { print odbc_result($r, 1); } '''
There are a handful of bugs at <URL> versions of php. That appears to be what's happening in this case, or some variant therein.
48,119,812
1
48,119,843
I'm very beginner in Git. I learned how to use in terminal but now I use SourceTree. Everything was perfectly fine but time for first checkout has come. After checkout I moved forward with my task and now I have this two branches and I don't know how to push later changes to remote. On remote I only see that one I checked out. Should I set 'master' to 'HEAD'? I can type in terminal, I don't care about SourceTree. <IMAGE> Thank you for answers!
Go in your HEAD, open the console: ''' // (You are currently working on a detached HEAD and not in a proper branch) git checkout -b harvestFile // Checkout your detached HEAD to a new branch Properly git checkout master // Go back to your master branch git merge harvestFile // Merge HarvestFile into master git push origin // Push master to your remote. ''' Go in your HEAD, open the console: : ''' // (You are currently working on a detached HEAD and not in a proper branch) git checkout -b harvestFile // Checkout your detached HEAD to a new branch Properly git checkout master // Go back to your master branch git merge -s ours harvestFile // Merge HarvestFile into master only keep harvestFile branch commits git push origin // Push master to your remote. ''' Go in your HEAD, open the console: : ''' // (You are currently working on a detached HEAD and not in a proper branch) git checkout -b <branchname> // Checkout your detached HEAD to a new branch Properly git push -u origin <branchname> // Push and create <branchname> on your remote. '''
29,704,364
1
29,704,443
How can I change the background color only to those rows that clicked, in the below code it does not clear the previous row clicked background color. ''' var tr = $('#webgrid_id').find('tr'); tr.bind('click', function (event) { $("tr").click(function () { $(this).css('background', 'yellow'); }); }); ''' <IMAGE>
<URL> You could simplify it by using class ''' .yellow{ background: yellow; } ''' '<style>' --- ''' $('#webgrid_id').on('click','tr',function () { $('tr.yellow').removeClass('yellow'); $(this).addClass('yellow'); }); ''' OR as suggests refer this (more optimized and improved): <URL> Also, I see a 'click' event inside bind - there is no need to nesting these events.