w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to shorten gap if a control is wanted to hide in IOS?
It really depends on how you show these elements. You could just change the frame of the text part below the gallery to be gallery_height pixels taller. CGRect frame = textpart.frame; frame.origin = CGPointMake(frame.origin.x, frame.origin.y - gallery_height); frame.size = CGSizeMake(frame.size.width, frame.size.height + gallery_height); textpart.frame = frame; "textpart" is whatever you call the view below the gallery gallery_height is the height of the small gallery

Categories : IOS

Div positioning (overlays when not wanted)
Make the receiver as absolute position with top just a little more than 30%. it will work as you need. #receiver { position: absolute; width: 98%; top: 35%; border: solid 1px green; } Check this http://jsfiddle.net/8wRte/1/

Categories : CSS

tinymce 4 - set css file only if wanted (else, do nothing)
One solution to get this work is to add a setup function to the init function : tinymce.init({ // include newsletter css file setup: function(editor) { editor.on('PreInit', function(e) { if(typeof mycsspath !== "undefined") { tinyMCE.activeEditor.dom.loadCSS(mycsspath); } }); }, // other config options there // ... });

Categories : Javascript

Android/PC GIS library wanted
Whilst not a full GIS library I have used JTS to write code on both PC and android. The Website is http://www.vividsolutions.com/jts/JTSHome.htm Whilst the documentation is a little on the light side I have found that it isn't to hard to implement. Using standard drawing functions I have been able to set up some basic GIS applications and mapping functions.

Categories : Java

Preg_replace not working as wanted
Move the s2 replacement before the s replacement. Since you are doing the replacement one at a time, you are destroying the s2 before it gets a chance to replace it. 3.20 m/s2 will be transformed like this [m] 3.20 meter/s2 [s] 3.20 meter/second2 [/] 3.20 meterpersecond2 Which results in meterpersecond2 Here is the proper order 'm' => string 'meter' (length=5) 'meters' => string 'meter' (length=5) 's2' => string 'secondsquare' (length=12) 's' => string 'second' (length=6) 'seconds' => string 'second' (length=6) 'n' => string 'newton' (length=6) 'newtons' => string 'newton' (length=6) 'v' => string 'volt' (length=4) 'speed' => string 'velocity' (length=8) '/' => string 'per' (length=3)

Categories : PHP

flexbox example in webkit chrome wanted
I hope this is what you want html, body { margin:0px; height:100%; } #wrapper { display:-webkit-box; display:flexbox; -webkit-box-orient:vertical; -webkit-box-flex:1; -webkit-flex-flow:column nowrap; background-color:#f00; height:100% ; } #body { display:-webkit-box; -webkit-box-orient:vertical; background-color:#ff6a00; flex:1; -webkit-box-flex:1; overflow: hidden; } header { background-color:#4cff00; height:200px } footer { background-color:#4cff00; height:200px; } fiddle

Categories : PHP

Reverse scrolling behaviour wanted
Try comparing document.body.scrollTop with document.body.clientHeight. If it reaches your desired point use the scrollBy() method to go up some pixels. EDIT after your update: You’re mixing up scrollTo (scroll to absolute position on your page) and scrollBy (scroll up or down from the current scroll position). Also, these are no jQuery methods, so use them without the $. EDIT 2: You can’t use offset() for the scroll position. It only gets the position of an element on your page. Here’s a working example: $(document).bind('scroll', function(){ if (document.body.scrollTop > 3000) { scrollBy(0, -800); } });

Categories : Javascript

can't retrieve the wanted data out from database
using(SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=ncpsdbb;Integrated Security=True")) { conn.Open(); SqlCommand sqlcmd = new SqlCommand("SELECT * FROM StudentTransactions WHERE TimeDate BETWEEN @startDate AND @endDate", conn); sqlcmd.Parameters.AddWithValue("startDate" <Your start date>); sqlcmd.Parameters.AddWithValue("endDate" <Your end date>); ... Also notice the error with parantheses in your command string.

Categories : Asp Net

how to select the exactly wanted rows from 2 tables
You just need to use a left join and have the userId requirement as part of the ON clause. SELECT t.*, tu.userid FROM treatments t LEFT JOIN treatmentUsers tu ON t.Id = tu.treatmentId AND tu.userId = 1

Categories : Mysql

Mysql group function error,wanted a second max value
Try this instead: SELECT logtime from sgwebdb.audit_log where logtime < (SELECT MAX(logtime) FROM sgwebdb.audit_log ) AND userid = 'admin' AND activity = 'LOGIN'; Update For the second max value you can do this: SELECT logtime FROM ( SELECT logtime FROM sgwebdb.audit_log WHERE userid = 'admin' AND activity = 'LOGIN' ORDER BY logtime DESC LIMIT 2 ) AS t ORDER BT logtime LIMIT 1;

Categories : Mysql

Comparator for TreeSet doesn't work as wanted
From a TreeSet's perspective, two elements are equal if item1.compareTo(item2) == 0. In your case, Layer.HUB_1 appears twice in your array and both items will be deemed equal so only one will be added.

Categories : Java

EXTJS Toolbar and Buttons Placement help wanted
In your viewport's items config add a panel which in-turn has the tbar config as: items: [ new Ext.Panel({ region: 'north', tbar: ['->', YOUR_TOOL_BAR] }) .... ]

Categories : Extjs

How to redirect to page wanted after successful login?
First, you have to pass something about event (for example, event ID) to the link on the email. Then you can keep this event ID while processing user login and if it's OKAY - do redirect to event page by event ID.

Categories : PHP

Buffered Writer overwriting file when not wanted
You need to use append mode new BufferedWriter(new FileWriter(yourFileName, true)); here, true means that the txt should be appended at the end of file. Check the FileWriter javadoc for more information.

Categories : Java

Why did my VBA array contents disappear when I wanted to reuse them?
Your loops aren't working as the syntax is incorrect For i = 1 To i = masterrows exits immediately without populating the array. You should be using For i = 1 To masterrows For i = 1 To guzikrows etc

Categories : Arrays

how to add picture box control and label control dynamically in list view control
Did you google around? There are lot of links that can help you http://geekswithblogs.net/dotNETvinz/archive/2009/04/24/faq-displaying-image-from-database-to-gridview-control.aspx http://weblogs.asp.net/aghausman/archive/2009/05/26/show-images-on-grid-view-from-file-stream.aspx http://www.codeproject.com/Articles/20782/Displaying-Images-from-a-Database-in-a-GridView http://www.codeproject.com/Articles/20971/Thumbnail-Images-in-GridView-using-C

Categories : Asp Net

How to stop scrapy spider but process all wanted items?
Not sure if this fits your setup, but you can fetch lastseen from MySQL when initializing your spider and stop generating Requests in your callbacks when the response contains the item with postdate < lastseen, hence basically moving the logic to stop crawling directly inside the Spider instead of the pipeline. It can sometimes be simpler to pass an argument to your spider scrapy crawl myspider -a lastseen=20130715 and set property of your Spider to test in your callback (http://doc.scrapy.org/en/latest/topics/spiders.html#spider-arguments) class MySpider(BaseSpider): name = 'myspider' def __init__(self, lastseen=None): self.lastseen = lastseen # ... def parse_new_items(self, reponse): follow_next_page = True # item fetch logic

Categories : Python

R: Subset / index an object by substring of the wanted entries
Something like this? data <- read.table(header=T, text=' ID sex size 0120010 M 7 0120020 F 6 0121031 F 9 0130010 M 11 0130020 M 11 0130030 F 14 0130040 M 11 0150030 F 11 0150110 F 12 0180030 F 9 1150110 F 12 9180030 F 9 ', colClasses =c("character", "factor", "integer")) IDfilter <- c("012", "015", "115") # filter must be character vector data[substr(data[,"ID"], 1,3) %in% IDfilter, ] # ID sex size #1 0120010 M 7 #2 0120020 F 6 #3 0121031 F 9 #8 0150030 F 11 #9 0150110 F 12 #11 1150110 F 12 Note the colClases. In this case, ID is suppose to be character in order to a

Categories : Regex

Active Element doesn't compare to wanted WebElement
From what I can tell via looking around, == is an address comparison. Some discussion here: java == vs equals() confusion I would recommend trying return (focusElement.equals(focusOnOrderNumberWE)); based on discussion here: Selenium: Check if a WebElement has the focus

Categories : Java

If i wanted to make a button, open/switch to another webview how would i go on about that?
You need a OnClickListener for your Button e.g. Developer Guide for Button Button button = (Button) findViewById(R.id.button_send); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Do something in response to button click } }); After this you also need a WebView item on your layout e.g. Developer Guide for WebView <?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> Same as Button for the WebView WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.loadUrl("http://www.example.com"); You have to do your job and read yourself into such th

Categories : Android

Wanted a java library for parse string formula
Expanding on my comment, this is the sort of solution I was envisioning: class HaxlEngine { static boolean isANSI(final char c) { return c <= 0x7F; } public static Set<List<String>> doSum(String formula) { JexlEngine engine = new JexlEngine(); final Map<Character, Character> mappedChars = new HashMap<>(); char ansiCounter = 'A'; for(final char c : formula.toCharArray()) { if(!isANSI(c)) { char newValue; do { newValue = ansiCounter++; } while(formula.contains(String.valueOf(newValue))); mappedChars.put(c, newValue); formula = formula.replace(

Categories : Java

Mockito error : "Wanted but not invoked:.. However, there were other interactions with this mock"
Casting doesn't change the object that a variable refers to. It just makes the compiler not complain when you use the variable in a way that doesn't match its type. So you really are passing null into setStatus following your verify. Of course, if you're asking why setStatus isn't actually called by the code that you're testing, you'd need to post it before anyone can tell you.

Categories : Java

I wanted to enter a command line argument for my string
Here's a command line arguments tutorial for netbeans. Basically, you go: File->Project Properties->Run->Arguments. In your code, you should probably have: try { if (args.length != 0) { datasetFile = args[0]; in = new BufferedReader(new FileReader(datasetFile)); } } catch(FileNotFoundException e) { e.printStackTrace(); } Your question asks how to enter command line arguments, but it looks like the way you did it worked, since you got a FileNotFoundException on abc, so that's your issue.

Categories : Java

I came across 2 ways of inserting an employee's data into my DB below. I just wanted to know the difference
The first example tightly couples data storage code with UI code. This code can't be used elsewhere in the same project (or other projects) without copying/pasting followed by editing of the textbox names. If there is a new required parameter added to sp_userinformation, and this code has been copied in several places (or other projects), then each usage must be found and updated. The compiler can't help with missing parameters. Compare this with the second example which uses an object (sometimes referred to as a data transfer object). The second example doesn't directly refer to user interface objects and therefore can be isolated in a seperate class. This same code could be called from other parts of the application or from another application encouraging code reuse. If a new required

Categories : C#

Save wanted image pixels in different matrix in Matlab?
How about if you just store the index of the element? %% Load a sample image RGB = imread('football.jpg'); b = 1; maybe_red = RGB; red = RGB(:,:,1); % Get the red component % i will represent the index of the matrix for i = 1:length(red(:)) % length(red(:)) = rows*cols if red(i) > 100 red_trace(b) = i; b = b+1; else [r,c] = ind2sub(size(red),i); % Convert the index to rows and cols maybe_red(r,c,:) = 1; end end imshow(maybe_red); but it might just be easier to do red = RGB(:,:,1); % Get the red component of the image [r,c] = find(red>100); coord = [r c];

Categories : Matlab

How do you get values from html and set them in the view for example if you wanted to create a new table row in Django?
I don't fully understand what the objective of your process is, but I think the answer to your question is to create the string of HTML you want in your python code instead of using the template file. In other words, take the tr with all the forloop.counters and recreate it in a string in a python function. Then load that string as a template variable, in effect pasting in each HTML row inside the template. Then inside your logging function, you can call the same python function that creates each row, effectively "importing" it. It is possible to "get the HTML", but that would require some kind of asynchronous request via Javascript that sends the HTML you want as an HTTP request argument. There is a library called dajax which can automate the process of sending asynchronous javascript r

Categories : Python

can't retrieve the wanted data out from database and have error in closing connection
Supposing your session variables are two correct dates then you should not use string concatenation to pass an sql command to your database but you should use a parameterized query string cmdText = "SELECT * FROM StudentTransactions " + "WHERE TimeDate BETWEEN @iniDT AND @endDT" SqlCommand sqlcmd = new SqlCommand(cmdText, conn); sqlCmd.Parameters.AddWithValue("@iniDT", one); sqlCmd.Parameters.AddWithValue("@endDT",two); This approach will leave the duty to pass in the correct format for the dates to the framework code and you avoid parsing problems and close the door to sql injections attacks.

Categories : Asp Net

Bash: How to avoid warning: here-document at line XX delimited by end-of-file (wanted `EOM')
When using a here-document, make sure the delimiter is the only string on the line. In your case, the right parenthesis is taken as part of the word, so the matching delimiter is not found. You can safely move it to the next line: USAGE=$(cat <<EOM Usage:${BASENAME} [-h] [-n] [-q] -h, --help This usage message -n, --dry-run -q, --quiet -d, --Destination EOM )

Categories : Bash

Word addin in C++, IDTExtensibility2, how to write handlers for events? (generic COM help wanted too)
Here is a sample illustrating how to implement event handlers for COM dispinterfaces with ATL's IDispEventImpl/BEGIN_SINK_MAP/SINK_ENTRY_EX/END_SINK_MAP: http://support.microsoft.com/kb/194179. To generate COM definitions for MS Word and Office Object Model, you'd need the following files: MSADDNDR.TLB MSO.DLL MSWORD.OLB VBE6EXT.OLB You should be able to find them somewhere under "C:Program Files (x86)Microsoft Office". The following import code worked for me a while ago with Office 2007, you may need to tweak it for more recent Office versions: #import "TypeLibMSADDNDR.TLB" raw_interfaces_only no_namespace auto_search #import "TypeLibMSWORD.OLB" raw_interfaces_only rename("ExitWindows","MsoExitWindows") rename("FindText","MsoFindText") rename("Do

Categories : C++

How to add an html control inside a div or crate a new control beside another control
var myA=document.createElement("a"); would create an element, you can set it's text by myA.innerHTML and src with myA.src="http://www.google.com" To add it to the page you can do: document.getElmentById("mydiv").appendChild(myA); to remove: var As=document.getElmentById("mydiv").getElementsByTagName("a"); var a = As[As.length-1]; a.parentElement.removeChild(a);

Categories : Javascript

Batch script to delete duplicate lines but wanted to ignore/skip some lines
This might work for you, if you put lines always to print in the %dict% file: @ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION SET "file=file" SET "new=new" SET "dict=dictionary" (FOR /f "tokens=1*delims=:" %%a IN ('findstr /n "^" "%file%"') DO ( SET "nr=%%a" SET "line=%%b" SET "this=" FINDSTR /l "!line!" "%dict%" >NUL 2>&1&& ECHO(!line! || ( FOR /f "tokens=1*delims==" %%x IN ('set "$" 2^>nul') DO IF !line!==%%y SET "this=1" IF "!this!"=="" ( ECHO(!line! SET "$!nr!=!line!" ) ) ))>"%new%" TYPE "%new%" ..shell session: >type file <bookstores> <book id="parent"> <name="it1"/> <name="it1"/> <name="it2"/> </book>

Categories : Windows

inserting elements into array creates nested array where they aren't wanted
You are getting the post meta data and putting them back onto the same array, $voters. You should either assign the $voter_id ahead of time and use it as the key before you use post_meta_data, or use a different variable to store it. If you mean use $voter_id as a key ahead of time, have you tried this: //initialize vote arrays and vars $quarter = substr($date, 1,1); $year = substr($date, 2,4); $votes = $_POST['votes']; $voter_id = $_POST['voter_id']; $voting_array = array(); $current_vote = array(); $voters[$voter_id] = get_post_meta(2165, 'bonus_votesq'. $quarter . $year); parse_str($votes, $voting_array); foreach ($voting_array as $vid => $awarded_points) { $current_vote[sanitize_key($vid)] = sanitize_key($awarded_points); } // push the local array into what will be the gl

Categories : PHP

when adding post in wordpress the post coming on the top of the page not below the content where i wanted
The actual problem of the post coming on the top of the page is published date. The new post comes on the top and old posts below of it, I just changed the published date of old post into new date in posts settings. Its done now, the post(content) which i wanted on the top of the page.

Categories : HTML

Archiving multiple targets on XCode and Building Multiple IPA files in one go (scripts or commands wanted)
I suggest you start looking at Jenkins to get the job done. It can create an ipa for every target you want... Start automating your build via Jenkins For automating the distribution process, i received a mail from Apple last week about meta data delivery with Transporter. It's a command line tool. Sounds interesting...

Categories : IOS

How can I use wildcards or regular expressions to control Path-based authorization / access control for svn?
as of June 2013 it is impossible to do this. So, the solution to the problem is to re-organize the repository so this isn't necessary. When a thing is too difficult it usually leads to a large rethink of the design or approach. At present maven structure leads to this requirement: root/pom.xml root/project1/pom.xml root/project2/pom.xml etc.. We can replace this with /root/pom.xml /project1/pom.xml /project2/pom.xml etc.. We can set the svn perms as follows granting all read access to the top level project and read write to their project. If an continuous integration build server populates an internal maven repo with the root snapshot then the users only need to checkout specific projects. [repo:/root] * = r @releng = rw [repo:/project1] @teamOne = rw [repo:/project2] @teamTwo =

Categories : Svn

Update parent control when the child control is manually removed in the designer
To wrap it up, I found a solution to my problem. Like a TabControl, my ButtonList contains two collections: ControlCollection inherited from the Control class ButtonListItemCollection (TabControl has TabPageCollection) Adding ButtonListItems is done via the collection editor in the properties. Removing can be done either in the collection editor or just by selecting the ButtonListItem in the designer and pressing the DEL button on the keyboard (manual deletion). When using the collection editor, ButtonListItems are added/removed to/from the ButtonListItemCollection and then to/from the ControlCollection. However, when a ButtonListItem is manually deleted it is only deleted from the ControlCollection not from the ButtonListItemCollection. So what needs to be done is to detect when the

Categories : C#

Tap event on dynamically added custom control is handled by another control of same type
I figured out the problem, and I am chocking it up to lack of experience with WPF. When I made my Waypoints I created them like to var newWaypoint = new Waypoint(waypointNumber, latitude, longitude); newWaypoint.Name = "wayPoint" + waypointNumber; newWaypoint.Opacity = 100; double leftMargin = CalculateLeftMargin(longitude); double topMargin = CalculateTopMargin(latitude); newWaypoint.Margin = new Thickness(leftMargin, topMargin, 0, 0); LayoutRoot.Children.Add(newWaypoint); The problem with that was that I was setting the Margin of the control. When I set the Margin it was actually stretching out my Waypoint so I was having Waypoints on top of Waypoints. After some research I came across this article Changing Position of an Element Programmatically in WPF which showed me how to prope

Categories : C#

Button sizes changing on user control when control is added to window
You have don't have your LastChildFill property set to False on your top DockPanel. This is the reason "Ent" is changing size and moving your screen. You also have the HorizontalAlignment on "Del" set to stretch. Try setting that to Left, but might be moot with the LastChildFill correction. The overall resizing is do to HorizontalAlignment set to Stretch set that to Left.

Categories : Wpf

Black lines when adding custom control to a panel with Control's DockStyle set to Top
Finally I found the solution to my problem. I was setting the Comment control's AutoSize property to true. When I set it false, it worked. Thanks @Sayse, your comment gave me hint about it.

Categories : C#

adding Control to form but gap keeps doubling when added at Bottom of previous control
this is more of a hack but it works. sharpUserX.Size = sharpUserSize PnlSharpUsers.Controls.Add(sharpUserX) sharpUserX.Location = pnlAddBtn.Location if i set the size before i add the control, then set the location after it seems to apply the font scaling to the size, but not the location, which works perfectly for me.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.