[Solved] How can i simplify this java Statement

Where do You set color for the selected item? is it possible to set all colors to white and then use switch to set only the selected one to desired color? It would make it at least more pleasant to look at. nav_news_bg.setBackground(color); nav_feed_bg.setBackground(color); nav_profile_bg.setBackground(color); nav_chat_bg.setBackground(color); nav_books_bg.setBackground(color); switch(v.getId()){ case R.id.nav_news: nav_news_bg.setBackground(desiredColor); break; case R.id.nav_feed: . … Read more

[Solved] I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. Can you help me solve this error? [duplicate]

I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. Can you help me solve this error? [duplicate] solved I am searching for a long time on net. But no use. Please help or try to give some ideas how to … Read more

[Solved] Const Auto/Identifier Errors [closed]

This is C++17 syntax. As this standard is not yet the default option for most compilers you have to tell the compiler that you are using it via the -std=c++17 switch. PS: you didn’t say which compiler you are using, so maybe it will not support that switch or not even support C++17 at all. … Read more

[Solved] list of random codes like this : (XXXXX-XXXXX-XXXXX) on python

from random import choice from string import ascii_uppercase, digits CHAR_SET = ascii_uppercase + digits def get_integer(msg): while True: try: return int(input(msg)) except ValueError: pass def get_random_code(chunks=3, delim=’-‘): def get_random_str(length=5): return ”.join(choice(CHAR_SET) for _ in range(length)) return delim.join(get_random_str() for _ in range(chunks)) if __name__ == ‘__main__’: total_combos = get_integer(‘Enter # of combos to generate: ‘) for … Read more

[Solved] Pull out replaceable fields from a string [closed]

static void Main(string[] args) { String str = “{dog} and the {cat}”; String[] ret = ExtractTagValue(str); } public static String[] ExtractTagValue(String input) { List<String> retLst = new List<string>(); String pattern = “(\\{.*?\\})”; System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(pattern); System.Text.RegularExpressions.MatchCollection matches = regex.Matches(input); if (matches.Count > 0) { foreach (Match match in matches) { retLst.Add(match.Value); } } … Read more

[Solved] How to put a div in the middle of the page [duplicate]

With html5 this is pretty easy using flexbox: This article discribes how to do it http://coding.smashingmagazine.com/2013/05/22/centering-elements-with-flexbox/ and here is the demo (also from the article) http://jsfiddle.net/pnNqd/ HTML: <h1>OMG, I’m centered</h1> CSS: html { height: 100%; } body { display: -webkit-box; /* OLD: Safari, iOS, Android browser, older WebKit browsers. */ display: -moz-box; /* OLD: Firefox … Read more

[Solved] Arrays In loops by C# [closed]

IMO, best will be to use a Dictionary<string,int[][]>. During creation you will place a new array (which you just created) and assosiate it to the key “a” + i. To get this array, just get the value attached to the relevant key. Something like (C#-like pseudo code): var map = new Dictionary<string,int[][]>(); for(int i=1;i<10;i++) { … Read more

[Solved] Type mismatch: cannot convert from Cursor to String[] error [closed]

I don’t know what you try to do there exactly but my best guess is the following: public String fetchThePassword(long paramLong) throws SQLException { SQLiteDatabase localSQLiteDatabase = this.db; String[] columns = new String[] { “pass” }; Cursor cursor = localSQLiteDatabase.query(true, “register”, columns, “id=” + paramLong, null, null, null, null, null); String result = null; if … Read more

[Solved] Parse error: syntax error, unexpected end of file in C:\Program Files\EasyPHP-12.1\www\Sitedeteste\upload.php on line 37 [closed]

Wooble is correct, you are missing a closing bracket on one of your if statements. The following code should do the trick <?php //Funcao que vai abrir o arquivo php que faz conexao com o servidor require_once (“sistemadelogin.php”); $descricao = $_POST[descimagem]; $nomeFOTOG = $_FILES[‘fotoimagem’][‘name’]; $nomeFOTOP = $_FILES[‘miniImagem’][‘name’]; $tmpFOTOG = $_FILES[‘fotoimagem’][‘tmp_name’]; $tmpFOTOP = $_FILES[‘miniImagem’][‘tmp_name’]; $destinoG = … Read more

[Solved] Swap Characters, first and last [closed]

public static String swap (String entry){ char[] characters = entry.toCharArray(); if (entry.length() < 6){ return null; // cannot swap if length is under 6! } char tempchar; tempchar = characters[0]; characters[0] = characters[characters.length-1]; characters[characters.length-1] = tempchar; tempchar = characters[1]; characters[1] = characters[characters.length-2]; characters[characters.length-2] = tempchar; tempchar = characters[2]; characters[2] = characters[characters.length-3]; characters[characters.length-3] = tempchar; return … Read more

[Solved] Hotmail and yahoo html newsletter mail issue [closed]

HTML and CSS in email design is a pain, basically – every email client renders differently, with Outlook in particular being frustrating due to using Word as its rendering engine. Campaign Monitor post a very useful summary of all the CSS that will or won’t work in which of the email clients: http://www.campaignmonitor.com/css/ solved Hotmail … Read more

[Solved] Upload an excel File to Database

Hi here i am using this to import from Excel File.Try this.Works 100%… Here you should have a folder inside your application named as “Files” where after uploading your excel file,it will be stored and your program will read from the excel file available inside “Files” Folder. protected void btnImport_Click(object sender, EventArgs e) { ArrayList … Read more

[Solved] I need to work it like but using javascriptIs there any javascript function to forward to another page? [closed]

Java practices site sums it up nicely: Forward a forward is performed internally by the servlet the browser is completely unaware that it has taken place, so its original URL remains intact any browser reload of the resulting page will simple repeat the original request, with the original URL Redirect a redirect is a two … Read more

[Solved] Properties in C# advantage [duplicate]

From personal experience: You would generally have Private data member when you do not want it to be accessed externally through another class that calls the class containing the Private data member. Public data members are those that you can access by other classes to obtain its contents. My opinion is that it is simply … Read more