w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
asp.Net newbie help me
You need to create a new string from the char[]: char[] chars = txtoriginal.Text.ToCharArray(); Array.Reverse(chars); blAnswer.Text = new string(chars); But note that reversing a string isn't the same as reversing a sequence of characters. See: http://msmvps.com/blogs/jon_skeet/archive/2009/11/02/omg-ponies-aka-humanity-epic-fail.aspx

Categories : C#

Newbie needs some assistance
Keep the words in an array, and then use a for loop to prompt the user for each word. var words = new Array(10); alert("Enter " + words.length + " words"); for(var i = 0; i < words.length; i++) { words[i] = prompt("Enter Word " + (i + 1), " "); }

Categories : Javascript

newbie ios - where is the model in MVC?
As always the design is upto you. I would suggest creating a core data model with what ever model objects you require (This will generate the class files for you). Becoming familiar with core data early in your iOS learning is a great way to pick up best practices. This should get you started. Doing it this way will also allow you to easily persist the programs state, is easy to maintain and extend. Good luck with your iOS development.

Categories : IOS

Encapsulation C# newbie
Because it is easier to change the Code if you want to add the checks/tests later on. Especially if you have many inheritance and many classes in your code it is very hard to change the implementation from a public variable to a public Property. Moreover you can add to the get and set within the property different attributes, e.g. if you are using reflection. The get and set of the property are internally different methods. If you have just a public variable /field it is not possible to added different properties to the different access ways.

Categories : C#

MySQL - question marks
Your database table column should be created with proper charset and collation. You can define theit while creating or altering a table: col_name {CHAR | VARCHAR | TEXT} (col_length) [CHARACTER SET charset_name] [COLLATE collation_name] Here is the mysql link to help you learn more about it: http://dev.mysql.com/doc/refman/5.0/en/charset-column.html

Categories : Java

How to match a question mark?
Use quotemeta for the regex pattern. use warnings; use strict; my $search = quotemeta 'http://shorturl.com/detail.cfm?color=blue'; my $replace = 'http://shorturl.com/detaila.aspx?color=red'; my $file = '<a href="http://shorturl.com/detail.cfm?color=blue" class="news">HI</a>'; $file =~ s/$search/$replace/gis; print $file; __END__ <a href="http://shorturl.com/detaila.aspx?color=red" class="news">HI</a>

Categories : Regex

C++ spanish question mark
this character is simply not included in basic ascii. Try using wstring http://www.cplusplus.com/reference/string/wstring/

Categories : C++

Flowplayer question mark
A question mark URL encodes as %3F. But you should use a proper encoder for the whole thing rather than manually encoding a specific character. Depending on the server-side technology you're using to build the Urls, tyhere should be a function like UrlEncode() which should handle all this for you. Failing that, Javascript has encodeUriComponent()

Categories : Misc

If in_array then include - newbie
in_array needs 2 parameters, needle and haystack. Change your if statement to the following: if(in_array($currentpage, $homepage)) For in_array reference, see http://php.net/manual/en/function.in-array.php

Categories : Arrays

SQL Newbie Needs Assistance w/ Query
You can use a window to get a partitioned SUM(): SELECT MasterDept, ABCID, AMT, SUM(AMT) OVER(PARTITION BY MasterDept) FROM #Table1 You can use that to get the percentage for each row to update your second table (this assumes 1 row per MasterDept/ABCID combination): UPDATE A SET A.[AMT%] = B.[AMT%] FROM Table2 A JOIN (SELECT MasterDept , ABCID , AMT , CASE WHEN SUM(AMT) OVER(PARTITION BY MasterDept) = 0 THEN 0 ELSE AMT*1.0/SUM(AMT) OVER(PARTITION BY MasterDept) END 'AMT%' FROM #Table1 ) B ON A.MasterDept = B.MasterDept AND A.ABCID = B.ABCID As you can see in the subquery, a percent of total can be added to your Table1, so perhaps you don't even need Table2 as it's a bit redundant. Update: You can us

Categories : Sql Server

Eloquent ORM query -- newbie
A couple of things you should be aware of: If you have a custom primary key, you need to set the $primaryKey property on your eloquent models to the primary keys you have in the DB. You can't mix and match belongsToMany relationships with anything other than belongsToManys. A belongsToMany is exclusively for the case where you have two tables that are connected by a pivot table. In your case, B belongsTo A, and A hasMany B.

Categories : PHP

Newbie : Execution error
Try doing it this way: javac -d . Test.java java pkg.Test The java command takes a fully qualified class name as its main argument. A fully qualified name in Java includes package declarations (the fully qualified name of your class is pkg.Test). Since java also needs a correct directory structure for packages, you must execute the command from the directory you compiled your source to, which in this case is ..

Categories : Java

Python indentation newbie
if count > 10: break else: return(temperature) if-else conditions need to be indented as well. It should be if count > 10: break else : return temperature Some other notes: return temperature does not need parenthesis like you have. Also, to open a file, read it and the close it, you can just do this: with open("/sys/bus/w1/devices/28-000003086819/w1_slave", "r") as tfile : text = tfile.read() This ensures the file handle is closed even in case of exceptions. Further, I passed a second argument r which specifies that the file should only be opened in read-mode.

Categories : Python

android onClickListener (newbie)
aboutButton is null. You can't initialize it until you have inflated the layout. Change it to @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Switch these two lines View aboutButton = findViewById(R.id.main_about_button); aboutButton.setOnClickListener(this); } Your Views exist within your layout which means they will return null if you try to initialize them before inflating your layout, using a layout inflater or by calling setContentView(), which will give you a NPE when trying to call a function on them or setting a listener

Categories : Android

Why is List.reduce necessary in this newbie example?
Removing the line with List.reduce (>>) changes the type of showRainbow and so you get something that is not a function and so the pipelining operator cannot call it with defaultLabel as an argument. In the original program, the type of showRainbow is a function that turns one CoolLabel into another: val showRainbow : (CoolLabel -> CoolLabel) If you remove the line, you get a list of functions: val showRainbow : (CoolLabel -> CoolLabel) list This example is not using functions in a trivial way, so let me explain a bit what is acutally going on. We start with rainbow which is a list of colors. Next, rainbow |> List.map setLabel turns the list of colors into a list of functions. You can read this as: rainbow |> List.map (fun color -> setLabel color) But, setLa

Categories : F#

Setting A Cookie - Newbie
If you don't mind to use a jQuery plugin - try this [easy to use & way less to code for you] https://github.com/carhartl/jquery-cookie

Categories : Jquery

Regex assistance to a newbie
You should change the +s with .* Also, no need for the i $newTerm = preg_replace('//(.*)//', '', $searchTerm); Tested here: http://regexpfiddle.com/

Categories : PHP

Python Multiprocessing newbie
from multiprocessing import Process def fun1(): RemesherTweenOnce() def fun2(): RemesherOnce() p1 = Process(target=fun1) p2 = Process(target=fun2) # Starts processes. p1.start() p2.start() # If you would like to wait for the results. p1.join() p2.join()

Categories : Python

Unfortunately Appname has stopped, newbie
Please declare this class com.koutymony.webview.WebViewActivity in AndroidManifest.xml inside of <application><application/>as below: <activity android:name="brewedapps.app55.WebViewActivity"/> Edited Full Manifest File: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" android:installLocation="preferExternal" package="brewedapps.app55"> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE

Categories : Android

Newbie in need of searching, JSON
Here is javascript error myArr.push('<input type="text" name=">'+city+"","+state+"/>") Altho i never tried to search per diem, but your code should be myArr.push('<input type="text" name=">'+city+'","'+state+'"/>')

Categories : Jquery

OOP PHP - Newbie exercise on classes
A book is essentially a list of chapters. Each chapter has a title and a text. What about letting the book object handling the responsibility of building an index? <?php class Chapter { public $title; public $text; public function __construct($title, $text) { $this->title = $title; $this->text = $text; } } class Book { private $chapters; public function __construct() { $this->chapters = array(); } public function addChapter(Chapter $chapter) { $this->chapters[] = $chapter; } public function getIndex() { $index = array(); foreach($this->chapters as $chapter) { $index[] = $chapter->title; } return $index; } } // Usage $book = new Bo

Categories : PHP

Python Slicing Newbie
print a I'm not sure what your confusion is. Update: "school" is the part you didn't slice. If "school" is the part you're interested in, you want a = word[-6:] If you want both parts, slice them separately: notschool, school = word[:-6], word[-6:]

Categories : Python

pagerjs newbie - using without node.js?
you do not need node.js to install pager.js (but you can use npm to install it if you like). Download the pager.js-file (https://raw.github.com/finnsson/pagerjs/master/pager.js) directly and include it just as any other js-file (both AMD and non-AMD is supported).

Categories : Javascript

Newbie - relation in database
Use ForeignKeys, see https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey. In your case : class MyBox(models.Model): name = models.CharField(max_length=255) class SecretCode(models.Model): box = models.ForeignKey(MyBox, related_name="secret_codes") code = models.CharField(max_length=64, unique=True) You can reverse the relation by simply using : box = MyBox.objects.get(pk=1) box.secret_codes.all()

Categories : Django

.htaccess rewrite URL with a question mark "?"
RewriteRule ^component/users/?view=registration$ registration.html$ [R=301,L] You need a because ? is part of a regular expression. To Use it as a string u need to escape it with a Linktip: http://ole.michelsen.dk/tools/regex.html

Categories : Htaccess

R - how does the "question mark" function works?
You can make functions and variables with arbitrary names, via use of the backtick `. `~` <- `+` y <- 5 x <- 10 y ~ x # 15 I wouldn't mess with ~ though, unless you don't intend to do any statistical modelling....

Categories : R

How to remove question mark in a JOptionPane?
Use the PLAIN_MESSAGE message type JOptionPane.showConfirmDialog(null, "Help", "Please Enter X and Y Values", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);

Categories : Java

URLRewrite rule for a URL that only contains one value after the question mark
Try this code. Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ^([a-z0-9-]+)$ [NC] RewriteRule ^$ /#!/videos:%1? [L,R=301,NE]

Categories : Htaccess

Check if last character is a question mark
if (substr(rtrim($link), -1) != "?") { // Do stuff } Giving a negative start value to substr() makes it count from the end instead of the beginning.

Categories : PHP

What may cause question marks instead of non-ASCII symbols?
You need to change the character set of the database to UTF-8 or a character set for Cyrillic characters. Latin-1 can't encode Cyrillic characters and that's why they're appearing as question marks in the database. edit: I just saw you're declaring the table with UTF-8 character set, so I'm stumped.

Categories : PHP

What to do with Question Marks in HTAccess Redirects
If it's a single link you want to change you don't need a htaccess rule for that you can just do a redirect. redirect 301 /wordpress/?p=250 http://www.othersite.com/blog If the URL parameter changes you can use this rule. RewriteEngine on RewriteRule ^wordpress/(.*) http://www.othersite.com/blog [R=301,QSA,NC,L] Note that when you use the QSA flag it will append the URL with the query parameter so if that's what you want the resulting URL will be. http://www.othersite.com/blog?p=250 Otherwise if you remove the QSA flag, then it will just redirect to this http://www.othersite.com/blog

Categories : String

mod rewrite question mark and ampersands
I think the issue here is that in your RewriteRule you're trying to match a part of the query string, which isn't possible. If I understand your problem correctly, you want requests to http://example.com/category/general?type=pages&v=1 to be interpreted by the server as http://example.com/category.php?c=general&type=pages&query=1? To match a query string, you need to prefix your rule with a condition. The following should work: RewriteCond %{QUERY_STRING} type=([^&]+) RewriteCond %{QUERY_STRING} v=([^&]+) RewriteRule ^category/([^/]+) /category.php?c=$1&type=%1&query=%2 The first two lines are pre-conditions that state that the requested URL needs to have both type= and v= as part of the query string. The final line rewrites the request. This means that

Categories : PHP

Can't read a file that contains a question mark in name
As long as the file exists, there is no problem opening a file like this: folder_file = './temp directory/file-?.txt' File.open(folder_file, 'r').close This works fine. See Tin Man's suggestion about how to actually open the .tif file. As you can see, I created the following file myster-file_char?.txt $: ls get_listing.rb myster-file_char?.txt You can get this stored in a variable, though I only use Dir.glob here to view it. puts Dir.glob("**.*").inspect Everything is now revealed in what character it is. Though I should be able to use it directly as is to open and edit the file in Ruby. Though like The Tin Man stated, you are asking about a binary file. $: ruby get_listing.rb ["myster-file_charu0016.txt", "get_listing.rb"] The character that is actually there is a CTRL

Categories : Ruby

hr content shows question mark
The probable explanation is that although the HTML document is declared to be UTF-8 encoded, it actually isn’t. It might be windows-1252 encoded, and when the windows-1252 encoded representation of “§” is encountered when processing presumed UTF-8 data, it constitutes a character data error. A common, and recommended, way in which browsers indicate the error is “�” REPLACEMENT CHARACTER. To fix this, make sure the declared and actual character encoding match. It is less relevant which encoding you use, but other things being equal, it is best to use UTF-8. So you would need an editor or other authoring tool that can actually save the data as UTF-8 encoded. If you absolutely cannot fix the encoding issue, replace "§" in CSS by the escape notation "A7". Much less readable, bu

Categories : HTML

Newbie: Fusion Table Legend
Is it possible to choose a text column, like primary style: Victorian, and make it the legend? You could do this with some coding, but the automatic legends only work for marker icons when you use the bucketing approach rather than storing the icon names in a column, Can I add audio files to a fusion table, so I can add stories about the property or the person who build the property, so people can listen to the story? Sure, as long as they are hosted on YouTube or Vimeo. It there a way to turn this map into an app? You can use Tools > Publish to get either an <iframe> that can be embedded in another site, or the HTML and JavaScript to put in your own page. But it there's no automatic way to create a mobile app.

Categories : HTML

Node JS newbie: why do I get a 404? (angular-seed)
Make sure you run the server from your root directory. ~/angular-seed/ In here you do node scripts/web-server.js Then you can visit http://localhost:<PORT>/app/index.html

Categories : Node Js

Drupal - Newbie - Need some help in finding content
Do the pages have content within them? When you are on the Content Overview page just click on edit and see if there is anything in them. From what I can infer you are using Commerce Kickstart and this probably implies that you might need to edit the product instead. Just answering from the top of my head.

Categories : Drupal

Newbie generic parameter qu estion...
Due to type erasure this would not work. A possible (but more verbose way) is to create a factory method that returns a Map based on the passed argument, eg: MapFactory.create(String.class); EDIT: In answer to @millimoose comment about this being not different from direct instantiation (which is true): You could try to implement your own Map or decorate or extend the HashMap implementation so that it retains type information.

Categories : Java

Newbie Python Script - read()
The file was opened for writing (see open(filename, 'w')). Close the file, open it for reading and then call read(): glist.close() glist = open(filename, 'r') print glist.read() Or, you can open file in r+ mode to read and write without reopening (thanks to @sberry's comment). Also, consider using with context manager instead of manually closing the opened file: with open(filename, 'r+'): print "Deleting previous content from %r......" % filename glist.truncate() ... print glist.read() Also see: documentation on open() modes python open built-in function: difference between modes a, a+, w, w+, and r+?

Categories : Python

Jekyll and Github pages newbie
<link rel="stylesheet" href="/css/syntax.css"> <!-- ^ / remove this slash --- --> Example For more info, your problem file is here default.html

Categories : Github



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