|
|
does any body know any opensource mvc discussion forum/board to include in existing mvc project?
|
|
|
|
|
|
I'm not sure why you were downvoted since this is an area to discuss topics. Upvoted to counter.
And no, I don't know of any.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I want to use Google Translate in a new website I am developing. I have created the code I want on the Goggle site and it works very well when I run it in the website.
The only problem I have is that it won't position itself where I want it. I am trying to place it at the bottom right hand corner of my site alongside the Copyright notice under the site footer.
I am using W3.CSS to provide me responsiveness and have created the following code.
<div class="w3-display-container w3-row">
<div class="w3-col">
</div>
<div class="w3-col w3-center w3-small">
Copyright statement appears here
</div>
<div class="w3-col w3-right w3-top">
<p>Translate this page:</p>
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element');}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
</div>
</div>
I've tried recoding this a number of different ways and it hasn't yet appeared where I want it. It has appeared above the header area, in the header area and under the header area on both the right and left of the webpage.
Any help would be most welcome.
Oh, by the way, Bing Translate behaves in a similar way.
|
|
|
|
|
The div with id "google_translate_element" is the one which shows the translator button. So style that only. Keep it on the footer of your site the add the style like this -
#google_translate_element
{
float:right:
}
|
|
|
|
|
Thanks for your reply
It does indeed float the element to the right but it is still positioned at the top of the Header area when I open the web page. When I scroll the page, the element doesn't move its position on the screen. It just scrolls down the webpage maintaining a fixed position relative to the monitor not the web page. I just don't understand this at all ???
|
|
|
|
|
I think postion:fixed is getting applied to the div.Since you don't want it change it to absolute one by by replacing the html code by this:
<div class="w3-col w3-right w3-top" style="position:relative">
<p>Translate this page:</p>
<div id="google_translate_element" style="positon:absolute;top:10px;left:10px"></div>
<!--
</div>
</div>
By using the above code the translator div will be place 10 pixels from the top and 10pixels from the left of its parent which is the div with class "w3-col w3-right w3-top".
You can change the top and left values to adjust it more.

|
|
|
|
|
I have finally got it to a position I can live with. It is on the left hand side of the web page in the area I want it rather than the right hand side of that area. The code I have used is as follows:
<div class="w3-col" style="position:absolute; top:10px; left:10px" id="google_translate_element">
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({ pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false }, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
I really don't know what part of the code made it work this way, but hey, who cares - it works. The only problem is that this is a fixed position and therefore is not responsive on mobiles.
Many thanks for your help.
|
|
|
|
|
I've tried code this below but it gives me one record and it repeats 7 times. Wrong output. Can anyone has a good heart to figure it out please. Please see my complete code below. I'm just a newbie in programming. Sorry. Thank you.
===================================
OUTPUT: 1111111
===================================
_conn=new PDO("mysql:host=$this->_hostdb;dbname=$this->_namedb",$this->_userdb,$this-_passdb);
$this->_conn- >setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
if($this->_conn){
echo "Connected Successfully! ";
}
} catch (Exception $ex) {
echo ("Connection Failed!")." ".$ex->getMessage();
}
}
public static function getInstance(){
if(!isset(self::$_instance))
{
return self::$_instance=new DB();
}
}
public function processQuery($sql){
try{
$q=$this->_conn->prepare($sql);
$q->execute();
$q->setFetchMode(PDO::FETCH_ASSOC);
return $this->rowResult=$q->fetch();
} catch (Exception $ex) {
return ("Failed!")." ".$ex->getMessage();
}
}
public function getResultSet(){
return $this->rowResult;
}
//MAIN PROGRAM
$dbUser=DB::getInstance();
$user=$dbUser->processQuery("SELECT * FROM users");
for($i=0;$i<count($dbuser->rowResult);$i++){
echo $user['id'];
}
?>
modified 17-Jan-17 23:17pm.
|
|
|
|
|
I can see your for-loop influencing $user object
for($i=0;$i<count($dbUser->rowResult);$i++){
echo $user['id'];
}
Ashwin Shetty
|
|
|
|
|
Can you help me please what is the proper way. Thanks.
|
|
|
|
|
if you need to read data (forward only), you can write code like
$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"];
}
} else {
echo "0 results";
}
$conn->close();
you can look at the sample available here
Ashwin Shetty
|
|
|
|
|
Thanks Ashwin for giving me ideas. I really appreciate it. I have managed to fix it.Please see my code below for main program.
=====================================
$dbUser=DB::getInstance();
$dbUser->processQuery("SELECT * FROM users");
echo count($dbUser->getResultSet());
foreach($dbUser->getResultSet() as $rows){
echo $rows['username'];
}
|
|
|
|
|
You are using fetch() which will not return anything but the first row.
Try return $this->rowResult=$q->fetchAll();
That will then return an array of the rows into $users which I think is what you were expecting.
|
|
|
|
|
Buenas el caso es este:
[IMG]https:
code:[url]http:
[code]package practica;
public class adivinar2 {
public static void main(String[] args) {
int numeroAdivinar;
int numeroComparar;
short contador;
int cifrasAdivinar= 0;
int bandera=0;
int nDesAdivinar;
int nDesComparar;
int digitoAdivinar;
int digitoComparar;
System.out.println("Introduzca el primer numero");
numeroAdivinar=Leer.datoInt();
for ( contador=1 ; contador<=10; contador++){
System.out.println("Introduzca el segundo numero");
numeroComparar=Leer.datoInt();
if(numeroAdivinar==numeroComparar){
contador=10;
bandera=1;
}else{
nDesAdivinar=numeroAdivinar;
nDesComparar=numeroComparar;
while( nDesAdivinar!=0){
nDesAdivinar = nDesAdivinar/10;
digitoAdivinar= nDesAdivinar%10;
nDesComparar = nDesComparar/10;
digitoComparar=nDesComparar%10;
if(digitoAdivinar==digitoComparar){
cifrasAdivinar=cifrasAdivinar+1;
}
}cifrasAdivinar=cifrasAdivinar-1;
System.out.println("Has introducido un total de: "+cifrasAdivinar+" dígitos");
}
}
if(bandera==1){
System.out.println("Has acertado todas las cifras");
}else{
System.out.println("Se te acabaron las oportunidades");
}
}
}
[/code]
prblema:[spoiler][code]Introduzca el primer numero123
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
223
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
555
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
123
Has acertado todas las cifras
[/code][/spoiler]
Parece que cuando vuelve a partir de la segunda vez, ya se desloquece
[spoiler][code]
Introduzca el primer numero
123456789
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123466669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero[/code][/spoiler]
|
|
|
|
|
All you have to do is put a breakpoint and watch and see what is happening. You'll have it fixed in no time.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Buenas el caso es este:
[IMG]https:
code:[url]http:
[code]package practica;
public class adivinar2 {
public static void main(String[] args) {
int numeroAdivinar;
int numeroComparar;
short contador;
int cifrasAdivinar= 0;
int bandera=0;
int nDesAdivinar;
int nDesComparar;
int digitoAdivinar;
int digitoComparar;
System.out.println("Introduzca el primer numero");
numeroAdivinar=Leer.datoInt();
for ( contador=1 ; contador<=10; contador++){
System.out.println("Introduzca el segundo numero");
numeroComparar=Leer.datoInt();
if(numeroAdivinar==numeroComparar){
contador=10;
bandera=1;
}else{
nDesAdivinar=numeroAdivinar;
nDesComparar=numeroComparar;
while( nDesAdivinar!=0){
nDesAdivinar = nDesAdivinar/10;
digitoAdivinar= nDesAdivinar%10;
nDesComparar = nDesComparar/10;
digitoComparar=nDesComparar%10;
if(digitoAdivinar==digitoComparar){
cifrasAdivinar=cifrasAdivinar+1;
}
}cifrasAdivinar=cifrasAdivinar-1;
System.out.println("Has introducido un total de: "+cifrasAdivinar+" dígitos");
}
}
if(bandera==1){
System.out.println("Has acertado todas las cifras");
}else{
System.out.println("Se te acabaron las oportunidades");
}
}
}
[/code]
prblema:[spoiler][code]Introduzca el primer numero123
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
223
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
555
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
123
Has acertado todas las cifras
[/code][/spoiler]
Parece que cuando vuelve a partir de la segunda vez, ya se desloquece
[spoiler][code]
Introduzca el primer numero
123456789
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123466669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero[/code][/spoiler]
|
|
|
|
|
All you have to do is put a breakpoint and watch and see what is happening. You'll have it fixed in no time.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello
i'm trying to make a form to upload an image.
So i combined two events in one just to click only once an upload the file.
But when i click and choose the file, the tmp file is not uploaded.
here's my code, do you have an idea of why? Thank you in advance.
<form target='_self' action='upload.php' method='post' enctype='multipart/form-data'>
<div class = 'testocentrato'>
<input style='display:none' type='file' accept='.jpg' name='file' id='file'/>
<input style='display:none' type='submit' id='caricaimmagine' name='caricaimmagine' />
<input class='inputfile' type='button' value='Scegli file da PC' onclick='document.getElementById('file').click(); document.getElementById('caricaimmagine').click();' />
<input style='display:none' type='submit' />
<input class='inputfile' type='submit' name='eliminaimmagine' onclick='document.getElementById('eliminaimmagine').click();' value='".$lang['TASTO_ELIMINA_FOTO']."' />
<input type='hidden' name='id_utente' value='".$user['id']."' />
</form></div>
|
|
|
|
|
Well, a lot of it has to do with the fact that you're applying a synchronous methodology to an asynchronous construct. Event handlers do not block the main thread, they run in their own context.
That means that the form is being submit before any file is actually chosen.The better route is to use an event handler.
$('#file').change(function(){
$('#theForm').submit();
});
Then your HTML could look something like:
<form id="theForm" target='_self' action='upload.php' method='post' enctype='multipart/form-data'>
<input style='display:none' type='file' accept='.jpg' name='file' id='file'/>
<input type='hidden' name='id_utente' value='".$user['id']."' /><br />
<input type='button' value='Scegli file da PC' onClick="$('#file').trigger('click');" /><br />
</form>
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
HI, ok i understand the 2 asynchronous construct,
but the code you wrote is not working.
Maybe that i need to raise first event to choose the file and then the second event
(the button "upload image") is raised still before the load of image.
the change event is not working, it seems.
Thank you
|
|
|
|
|
I have a strange problem and i'm looking for solution a few days now.
this is my Tools :
- my own Webservice Configurator : create webservice with certificate on IIS
- my own client (WCF client) which consume this webservice
1.I create the wcf web service with certificate.
2.I run it on browser and show its wsdl (it is ok)
3.I try to open the channel to it but NOT WORKS
Up to now it seems a problem with my WCF Client
BUT no, because when I do the First point (1) on other machine with same tool and try to do the 2 and 3 points , it works fine and the same WCFClient works with the service created on other server (other machine and other iis)
have you an idea about this please ?
Best Regards,
|
|
|
|
|
Permissions, firewalls, User Rights Assignments, missing DLLs....
If it works in one place and not in another, it's generally one of two things: configuration or runtime support
The Event Viewer is your friend. You can also drop some debug lines into your client to find your failure point.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
As I say the same WCF client works with the same webservice in other machine
But with the one created and hosted (which works on browser !!!! ) in my machine it not works and I have the Exception "EndpointNotFoundException"
|
|
|
|