Posts

Showing posts from July, 2013

c# - Not able to convert JSON to Java class (call WebApi from Android app) -

im working on school project , im new in android programming have programming experiance in c# , .net. this code: public class proizvodiapi { public class proizvodivm implements serializable { public integer proizvodid; public string naziv; public string sifra; public bigdecimal cijena; public byte[] slikathumb; public string jedinicamjere; public string vrstaproizvoda; } public class proizvodilista implements serializable { public list<proizvodivm> proizvodi; } public static void getallproizvode(final myrunnable<proizvodilista> onsuccess) { requestqueue queue = volley.newrequestqueue(myapp.getcontext()); string url = "proizvodi/getproizvodivm"; // request string response provided url. stringrequest stringrequest = new stringrequest(request.method.get, config.urlapi + url, new response.listener&

Android: Unable to start service with null: java.lang.NullPointerException -

before begin, want make clear have read previous answers similar topics (mainly this one ) , answer given in comments didn't work me (adding intent != null before intent.getaction() didn't work). i'm trying make foreground service mayan horoscope. purpose of service read horoscope symbols , prediction sqlite database , whenever recieves text message following: "maya dd/mm/yyyy" (the dob), service obtain info , send text message automatically. have gotten work background service without error, want give notification user can see if service running or not. i have followed other tutorials ( tutorial 1 , tutorial 2 ) make foreground service , works fine without error. my problem whenever start service, stop service , clear ram (killing app) nullpointer exception time on service's line 57 (no matter code have it's line 57). on phone gives me message "unfortunately horoscopomaya has stopped working." twice! manifest.xml <?xml version=

mysql - Insert the mysqli_insert_id inside separate table using PHP -

i'd submit new registered user auto_increment id inside table1 , @ same time insert mysqli_insert_id or last_insert_id ever want call inside table2. can echo id out, need inside table2. how can accomplish that? please help! here code reference: <?php if(isset($_post['submit'])) { require 'connect.php'; $sql = "insert table1 (username, password) values ('".$_post["username"]."','".$_post["password"]."')"; if (mysqli_query($con, $sql)) { $last_id = mysqli_insert_id($con); echo "new record created successfully. last inserted id is: " . $last_id; } else { echo "error: " . $sql . "<br>" . mysqli_error($con); } mysqli_close($con); } ?> use variable last inserted id (successful) query insert other table. this rough sketch don't know db schema second table , quite unclear, need (fill in) rest. if (mysqli_query($con, $sql

javascript newbie: what's the right way to apply the same behavior to multiple elements? -

i'm taking first adventure javascript, , totally without bearings. i'd show thumbnail opens modal larger view of picture (and front end fanciness i'll need, i'm trying keep simple). i've copied this code w3schools, uses getelementbyid. works great first image on page clicking subsequent images doesn't pop up. reading around on stack overflow sounds that's because i'm matching on id, each element on page will/should have different id (which makes sense). i saw post here person made ids unique appending element's id. that, (a) wanted check if that's kosher , (b) id no longer match, there different attribute tack on match html styles? must common problem- what's right way apply same behavior multiple elements on page? example can give them thanks! update : based on everyone's feedback below i've modified code use getelementbyclassname instead of getelementbyid- see gist here: https://gist.github.com/dianekaplan/1602a7c0a1

wpf - Is MVVM pattern a symbiote of MVC + PAC patterns? -

i've surfed wikipedia , have found such article: http://en.wikipedia.org/wiki/mvc4wpf a part link upper: mvc4wpf open-source, extensible, automated code pattern developed @ information control corporation windows presentation foundation (wpf) development based on model-view-controller (mvc) , presentation-abstraction-control (pac) patterns... i know, wpf/silverlight use mvvm pattern: model-view-viewmodel. so mvc4wpf first version of mvvm? i don't know history of wpf/silverlight development well, mvvm has remind me sort of mvc. and if it's true, mvvm = mvc + pac ? whenever see questions this, think dr. wpf's design pattern . it doesn't matter want call separate concerns. hear lot of wpf people talk mvvm, boils down trying keep code separate. in mvvm, have: model data classes. knows nothing anything. view gotta show data. knows models, not how them. "knows" viewmodel through bindings. depending on how wire them together, ma

audio - C++ OpenAL will not play WAV file -

so have written method meant accept file path .wav file, go through creation of buffers , sources, , play sound. apparently, no sound play when run program. none of error checks trigger, there's nothing wrong file. have scoured google past few hours , have come empty handed, wanted ask here. here code: file* fp = null; fp = fopen("audiofile.wav", "rb"); char type[4]; dword size, chunksize; short formattype, channels; dword samplerate, avgbytespersec; short bytespersample, bitspersample; dword datasize; fread(type, sizeof(char), 4, fp); if (type[0] != 'r' || type[1] != 'i' || type[2] != 'f' || type[3] != 'f') fatalerror("openal error: no riff"); fread(&size, sizeof(dword), 1, fp); fread(type, sizeof(char), 4, fp); if (type[0] != 'w' || type[1] != 'a' || type[2] != 'v' || type[3] != 'e') fatalerror("openal error: not wave file"); fread(type, sizeof(char), 4,

java - Creating a new file each time and reading from it -

so i'm trying store new book user enters external text file includes title of book, author, , isbn. i have achieved making file. however, each time rerun program create new book, says file exists. how can make program add existing file? or should make make new file each time? thanks in advance. public class testmylibrary { //declare global var //create file in documents static file myfile=new file("/users/adambunch/documents/library.rtf"); //create library object static library lib=new library ("400 main st."); //scanner read file static scanner input=new scanner(system.in); static int choice; //user inputs choice keyboard //main method public static void main(string[] args) throws filenotfoundexception { //3 ways create books , add them library //first way book book1=new book("the lord of rings", "sally smith", 12345); lib.addbook(b

twitter - "error setting certificate" issue in R -

i can't figure out how fix error keep getting in r: error setting certificate verify locations:\n cafile: \n capath: none\n error in twinterfaceobj$doapicall(cmd, params, "get", ...) : error: error setting certificate verify locations: cafile: capath: none i'm trying use twitter package gather tweets below function. working fine yesterday, can't find way fix certificate issue. tweetframe <- function(searchterm, maxtweets) { twtlist<-searchtwitter(searchterm,n=maxtweets) #twtlist involved in “variable” scoping exists within function # searchterm needs string use "#hashtag" twttempframe<- do.call("rbind", lapply(twtlist,as.data.frame)) # as.data.frame() coerces each list element row # lapply() applies of elements in twtlist # rbind() takes rows , puts them # do.call() gives rbind() rows individual elements return(twttempframe[order(as.integer(twttempframe$created)),

Deploying a custom build of Datalab to Google Cloud platform -

for project trying expand google cloud datalab , deploy modified version google cloud platform. understand it, deploying process consists of following steps: build docker image push container registry use container parameter google cloud deployer specify correct docker image, explained here . since default container registry, i.e. gcr.io/cloud_datalab/datalab:<tag> off-limits non-datalab contributors, pushed docker image our own container registry, i.e. gcr.io/<project_id>/datalab:<tag> . however, google cloud deployer pulls directly gcr.io/cloud_datalab/datalab:<tag> (with tag specified container parameter) , not seem allow specification of source container registry. deployer not appear open-source, leaving no way deploy our image google cloud. we have looked creating custom deployment similar example listed here never starts datalab, suspect start script more complicated. question : how can deploy datalab image our own container registry

How do you start a MySQL server on linux? -

pretty simple question here. want sql database on version of kali linux can practice sql. i opened command line , entered tried start mysql , error. > mysql -u root error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' i made sure installed using apt-get. what steps need take able make database tables , data can query? i don't know kali, on ubuntu be $ sudo service mysql start once command returns, mysqld service has started, can use mysql client connect it. of course, have make sure have mysql-server package installed, not mysql-client , mysql-common , , you've initialized database instance. complete post-installation instructions can found in the official documentation , short version is make sure installer has created mysql user account. account "own" server process once starts. change data directory. (i used installer's default of /var/lib/mysql ; can change editing

debugging - R:Implementing variable selection in panel data model -

i doing panel data analysis 17 variables in r using package "plm". have eliminate these variables while retaining significant of them. looking @ adjusted r-square set of variables best explain dependent variable. since have 17 variables, repeating , observing again and, again has become cumbersome. following code: attach(pdf) pdata <-plm.data(pdf,index=c("country","day")) y <- cbind(dep_var) var_list <- pdf[c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q")] between_models= list() r_sqrt=c() for(i in 1:17){ x<-cbind(var_list[,1:i]) between_models[i]=plm(y~ x, data=pdata, model= "between") r_sqrt[i]=coef(between_models[i])["adj. r-squared"] } print(paste("least adj. r-squared is",which.max(r_sqrt)) pri

javascript - ionic 2 local storage unable to set retrieved value to variable -

Image
i trying set value retrieved .get function variable declared outside unable so. var dt; //retrieve this.local.get('didtutorial').then((value) => { alert(value); dt = value; }) console.log("local storage value: "+dt); i'm able "true" alert, getting "undefined" console.log printing outside of function. one workaround can put remaining codes ".then function" , messy. update(solution): as per ionic api ( http://ionicframework.com/docs/v2/api/platform/storage/localstorage/ ) , use .get retrieve values. since using promises has it's own limitations, using following: constructor(navcontroller) { this.navcontroller = navcontroller; this.local = new storage(localstorage); } and getitem function, localstorage.getitem('didtutorial') you able retrieve without having put callback method. reading localstorage wrapper in case asynchronous, means callback passed this.local.get gets

c# - How Do I make a Dynamically Compiled Class emit to a DLL -

i have data uses create program. purposes of example generated code: using system; namespace mynamespace { public class builtprogram{ public bool eval(int x, int y, int z, out int ret) { console.writeline("test"); ret = x + y + z; return true; } } } the code use generate following: var factory = new programfactory(tree); var newprogram = factory.getcompiledprogram(); // program parsing code... syntaxtree programsyntaxtree = syntaxtree.parsetext(newprogram); var outputfile = "compiled.dll"; var compilation = compilation.create(outputfile, options: new compilationoptions(outputkind.dynamicallylinkedlibrary), syntaxtrees: new[] { programsyntaxtree } ); filestream file; using (file = new filestream(outputfile, filemode.create)) { emitresult result = compilation.emit(file); } // code breaks: assembly assembly = assembly.loadfile(file.name); type type = assembly.gettype("builtp

How to make execution update reverse query mysql by id? -

i have 5 rows id: 1,2,3,4,5. then made query try change id to: 2,3,4,5,6 update table set `id` = `id` + 1 then get: duplicate entry '2' key 'primary'. i understand query executed id 1 first , cause primary 2 existed. so question how make query has been executed id 5 1. created table num_sample numbers 1 100. defined primary key on column num. , wrote update update num_sample set num = num + 1 order num desc limit 100; worked absolutely fine in mysql.

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

Image
i getting same error when python manage.py runserver. there no such error when have ubuntu 15.10. got started when upgraded ubuntu 16.04. question might duplicate have tried solution provided question have applied command dpkg --configure -a, have done apt-get update,upgrade,dist-upgrade, clean, -f install. have reinstalled python2.7 , python3 no success though. here screenshot while trying run django application i got after re-installing python please me? bashrc file # ~/.bashrc: executed bash(1) non-login shells. # see /usr/share/doc/bash/examples/startup-files (in package bash-doc) # examples # if not running interactively, don't case $- in *i*) ;; *) return;; esac export pythonhome="/usr/bin/python" echo $virtualenvwrapper_python echo 'tushant' # don't put duplicate lines or lines starting space in history. # see bash(1) more options histcontrol=ignoreboth # append history file, don't overwrite shopt -s histappend # setting h

javascript - ng-model not registering upon form submission -

i playing around ng-if in form. want user able select color (which triggers function ng-change), wants switch colors, selects different color (which triggers different function), , depending on whether switch happens, choose different resulting dropdown menus. html <form name = "myform" ng-submit = "submit()"> <label> select color </label> <select ng-model="mycolor" ng-change = "setcolorselection()" class="form-control" ng-options = "color color color in colors" required> </select> <br> <label> switch colors? </label> <br> <label class="radio-inline"> <input type="radio" ng-model="switchcolors" value = "yes" >yes</input> </label> <label class="radio-inline"> <input type= "radio" ng-model = "switchcolors" va

java - How can I use substring string function in MVEL expressions -

i using studio , have need use mvel expressions. can please tell me how can extract characters in field after underscore character.i reading these values xml file.please see below example. action: new_3456 new_cw234789 so, want mvel expresion extract values after underscore. so, result above expression should 3456 , cw234789 respectively. here using : declare variable navigate , pick action field value. lets variable declared props['applicant.status1'] the value of variable : props['applicant.status1'] = parts[0].xpath('/row/action/normalize-space(substring(text(),5,8))') the output 3456 , cw23 fine. now here issue, in order extract value aftre underscore used below expression , not getting deired value. props['applicant.status1'] = parts[0].xpath('/row/action/normalize-space(substring-after(text(),5))') can please tell me if above expresion correct. there other way can value desiring. thanks! "

How to configure active directory in windows 7? -

i installed remote server administrative tools (rsat) on windows 7, , turned features on mentioned in installation guide. administrative tools have been installed , listed in all programs list of start menu. i want set local network. want create users/passwords, , give them access shared drives permissions, etc. my questions is: how configure active directory in windows 7 first time? rsat remotely manage active directory environment. it's not creating ad environment. if want create ad environment, need windows server (2003/2008/2012) , install 'active directory domain services' or 'active directory lightweight directory services' role. there instructions online on how that.

c++ - Drawing a circle in directx 9 -

i'm having hard time figuring out how draw circle in directx. i'm able draw triangle, imagined might able draw 1 rotating triangle in circle. however, i'm absolutely stumped. i've been scouring net hours no luck. can me out? here's code: main.cpp #include "engine.h" #include "box2d.h" #include "triangle2d.h" class myapp : public engine { public: box2d box2d; triangle2d triangle2d; void onstartup() override { box2d.new(10.0f, 10.0f, 100.0f, 100.0f, d3dcolor_argb(0xff, 0x00, 0x00, 0xff)); triangle2d.new(150.0f, 10.0f, 100.0f, 100.0f, d3dcolor_argb(0xff, 0xff, 0x00, 0x00)); } void onshutdown() override { box2d.delete(); triangle2d.delete(); } void ondraw() override { box2d.draw(); triangle2d.draw(); } void onmousedown(int x, int y) { debug("%d %d\n", x, y); } }; int winapi winmain(hinstance hinstance, hinstance hprevin

php - Mysqli statement returning warnings -

this question has answer here: mysqli_real_escape_string() expects 2 parameters, 1 given fatal error 1 answer here code: include "db_conx.php"; $sql = mysqli_query("insert table(column) values('" . mysqli_real_escape_string($var) . "')"); if ($sql) {echo "connection successful"; } else { echo "failure"; } it returns these errors: warning: mysqli_real_escape_string() expects 2 parameters, 1 given warning: mysqli_query() expects @ least 2 parameters, 1 given i tried using pdo didn't work either... first parameter mysql connection link identifier, , second string more details, can visit link : http://in2.php.net/manual/en/mysqli.real-escape-string.php . include "db_conx.php"; $sql = mysqli_query(pass_your_connection_identifier_here ,"insert table(column) values('" .

R gputools: gcc: error: unrecognized command line option ‘-Wp’ -

i had error when install gputools in r, , cannot find solution google. use command install.packages("gputools") /usr/local/cuda/bin/nvcc -c -xcompiler "-fpic -i/usr/local/include -o2 -g -pipe -wall -wp,-d_fortify_source=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic" -i. -i"/usr/local/cuda/include" -i"/usr/lib64/r/include" rinterface.cu -o rinterface.o gcc: error: unrecognized command line option ‘-wp’ make: *** [rinterface.o] error 1 error: compilation failed package ‘gputools’ can me here? gpu cards given by 01:00.0 vga compatible controller: nvidia corporation gm107gl [quadro k620] (rev a2) ok, got working couple hacks. centos 7. first issue solved looking @ mailing list. https://github.com/nullsatz/gputools/issues/12 edit makefile, , modify line 'cflags : put '\' after 'wp' & before ',' cflags = -o2 -g -pipe -wall -werror

Error While using MATCH() AGAINST() in php mysql -

i'm new in php. trying search mysql dayabase using match against rather using like. using script, <?php if (isset($_get['q'])){ error_reporting(-1); $query = $_get['q']; $dbh = new mysqli($host, $user, $password, $database); if ($dbh->connect_error) { echo 'unable connect database '. $dbh->connect_error; } else { if ($stmt = $dbh->prepare("select index, sura, aya, text bn_bengali match(sura,text) against(?) ")) { $stmt->bind_param("s", $query); $stmt->execute(); $stmt->bind_result($index, $sura, $aya, $text); $stmt->store_result(); printf("number of rows: %d.\n", $stmt->num_rows); while ($stmt->fetch()) { echo $sura.'-'.$aya; echo $text;

c++ - When I use std::map to read values from a file, the value takes "," with it because the keys and values are separated by commas -

i have tried best on code not desired job done. please me read map without "," file. how traverse output map again. if there multiple keys how value of first key e.g key = 90, value == "hello" & key = 90, value = world. need output of first key. this i've got far: #include <fstream> #include <map> #include <utility> #include <vector> #include <iostream> #include <string> using namespace std; int main() { std::map<int, std::string> mymap; std::map<int, std::string>::iterator it; fstream textfile; textfile.open("map.txt"); // opening file if (!textfile) { cout << " error, not open file. " << endl; } int key; string value; while (textfile >> key >> value) { mymap[key] = value; } // traverse map = mymap.find(90); if (it != mymap.end()) { cout << " va

javascript - hide and show div with jquery not working -

i trying hide div show user click on drop downlist not working jquery <div class="form-group"> <label>select course</label> <select name="timepass" class="custom-select"> <option>select</option> <option id="cour">php developer</option> <option>asp.net</option> <option>python</option> </select> </div> <div class="mj_tabcontent mj_bottompadder80" id="std-list"> <table class="table table-striped"> <tr> <td> <h4><a href="requirement_detail.html">mudassir abbas</a></h4> </td> </td> <td> <div class="col-xs-2"> <input type="text" placeholder="grade" class="grad

java - Android Application Login with Facebook is not working with Facebook App installed -

this code working when uninstalled facebook app didn't work facebook app installed. i'm using facebook sdk 4.0. this code package com.example.nhp04.gqfood; import com.facebook.accesstoken; import com.facebook.accesstokentracker; import com.facebook.callbackmanager; import com.facebook.facebookcallback; import com.facebook.facebookexception; import com.facebook.facebooksdk; import com.facebook.profile; import com.facebook.login.loginresult; import com.facebook.login.widget.loginbutton; public class login extends appcompatactivity implements animation.animationlistener { private string info = ""; private loginbutton loginbutton; private callbackmanager callbackmanager; private accesstokentracker tracker; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); facebooksdk.sdkinitialize(getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); setcontentview(r.layout.act

batch file - Cmd for opening folders with unknown name -

i writing batch script works follows: goto location (for example c:/temp/1) open first 5 sub-directories of 1 (for example if 1 contains directories called 10,20,30, open 10. open 10 , if 10 contains 10,20,30 open 10 well, , goes on till --> 1/10/10/10/10/10) list item copy of contents of current folder(10) c:/temp go c:/temp , delete first folder's files (1) now, encounter problem don't know how open directories inside 1, since don't know names. sure there way of opening first folder, since saw close example here thanks guys!

Is using google maps for android SDK in China working? Any Solution for android? -

is using google maps android sdk in china working? i've been trying vpn , it's not working. is there sdk setting i'm missing? javascript api allows change url http://maps.google.cn/ if not, can give me suggestion? i've been trying skobbler osm maps, speed of randomly loading when loading world wide map area slow. does works using webview (google map javascript api) ? our app need show global countries map, including china area. many thanks you can change google maps gaode (amap). first because google maps need googles services, not available on chinese phones. then because if there way javascript chinese google map ( see following link: developers.google.com/maps/faq?hl=en#china_ws_access ), android java still not reliable.

optimization - R - nolptr - Find the 50 better solutions, not only the best one -

i'm using nerldermead() function of nolptr package , find, instance, 50 solutions. in example : opti= function(x){x-12} x0=c(0) lower=c(0) upper=c(100) solution=neldermead(x0,opti,lower,upper,control=list(maxeval = 1000,stopval = -inf)) i obtain solution=12 , obtain best solution , 49 other around. there way extract information of nerldermead() function ? thanks lot ! the simplex local algorithm won't allow find different local optima, 1 optimum value (being global or local). can iterate simplex optimisation multi-level single linkage algorithm find different starting points simplex, depending on results of previous simplex. here example function: require(nloptr) table <- null opti <- function(x){ res <- x-12 table <<- rbind(table, c(x, res)) res } lower <- c(0) upper <- c(100) local_opts <- list( "algorithm" = "nlopt_ln_neldermead", maxeval=15,

javascript - $.getJSON to a php with include_once fails but it did the work -

i've php webservice , when call $.getjson goes .fail callback. the problem appears when include_once @ php. if copy/paste included file main php works fine. the responsetext expected (a json data asked) , status 200, inside .fail callback. it's strange. knows if there's problems using include_once? then piece of php code is: $bcarregat = include_once("sql/". $sconsulta .".php"); and if replace with: $ssqlbase = "select usuari, nom, moduls"; $ssqlbase .= " www_usuari"; $ssqlbase .= " 1=1"; if (isset($arestr['usuari']) , $arestr['usuari'] != "") { $ssqlbase .= " , usuari = '". str_replace("'", "''", $arestr['usuari']) ."'"; } it works. i solved problem saving secondary php file (the included) in utf-8 without bom . i didn't know existence of different utf-8 formats, little beginning char @ respon

jquery - Magnificpopup detect dom source of picture -

does know way dom element of shown picture? i'd have db counter number of views of picture, when opening pictures in gallery mode can not find way html element indicates image , holds attribute id. i have like <a href="lightbox.jpg" data-id="1234"><img src="thumb.jpg"></a> is there possibility data-id event, if gallery open , user navigated arrows?

objective c - Passing NSData Multiplayer GAme -

i want pass array 1 player player: this how create it: nsdata *packet = [nsdata datawithbytes:&_spielescreenshots length:sizeof(_spielescreenshots)]; nsdata. _spielescreenshots array. how can array in didreceivedata method? possible? (void)match:(gkmatch *)match didreceivedata:(nsdata *)data fromplayer:(nsstring *)playerid {} i use create data: nsdata* data = [nskeyedarchiver archiveddatawithrootobject: self.spielescreenshots]; and in didrecievedata method: nsmutablearray *array = [nskeyedunarchiver unarchiveobjectwithdata:data]; now error: * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[nskeyedunarchiver initforreadingwithdata:]:

javascript - how to fill hexagon with background image in d3js? -

i have been trying follow different d3.js tutorials create own hexagon mesh. i have come this need replace random colors images, read need this: var imagepatterns = svg.selectall('pattern').data(data). enter().append('pattern') .attr('x',50) .attr('y',50) .attr('width',1) .attr('height',1) .append('image').attr("xlink:href", function(d,i){ return data[i].img; }) .attr("x", function(d,i){ return i+100; }) .attr("y", function(d,i){ return i+200; }) .attr("width", 230) .attr("height", 230) .attr("id", function(d,i){ return 'fillimage'+i }); i have data array 40 images, number of hexagon of radius 120 f

How to FTP an Image using C# in .NET -

i have image in memory , convert stream can ftp. have done using memorystream , ftpwebrequest. however, result file cannot opened. a scenario work when first save image physical file. use filestream open physical file , send stream ftp. i don't want have physically save first various reasons - possible without saving it? without seeing code, hard workout problem is. works when open new stream, i.e. file, best guess problem related way handling stream. make sure when you've finished writing stream set position start, using either seek method or position property.

java - Creating a custom DynamoDBMarshaller in Scala -

i using aws dynamodb in scala project. i'd write custom dynamodbmapper (also in scala). seems custom mapper has equivalent of java's static public class . however if implement scala object; adding mapping annotation via: @dynamodbmarshalling(marshallerclass = classof[mydynamodbconverter]) results in error: not found: type mydynamodbconverter @dynamodbmarshalling(marshallerclass = mydynamodbconverter.getclass) results in error: annotation argument needs constant; found: mydynamodbconverter.getclass() @dynamodbmarshalling(marshallerclass = classof[mydynamodbconverter.type]) results in error: class type required mydynamodbconverter.type found implementing mapper class results in runtime exception: cannot marshall type class mycaseclass without custom marshaler or @dynamodbdocument annotation. com.amazonaws.services.dynamodbv2.datamodeling.dynamodbmappingexception: cannot marshall type class mycaseclass without custom marshaler or @dynamodbdocument annotatio

How to run site on laravel -

Image
i have installed wamp, installed composer. in cmd writed command: composer global require laravel/installer laravel installer installed. go folder c:/wamp/www cmd , writed command: laravel new blog has appeared folder blog these content: , open main page of site in browser? point wamp web server public folder of laravel project. find httpd.conf , change folders this: documentroot "c:/wamp/www/public" <directory "c:/wamp/www/public"> restart apache , run localhost in browser. if ok, you'll see laravel start page.

php - Yii Model Post Form wrong Form Data name generated -

in yii app i'm unable post action in sitecontroller have: public function actioncustom() { if(isset($_post['customform'])) { ... not reached later here's discovered in browser network logs when posting custom form: customform[name]: instead of supposed customform but default yii app generated login action form it's normal: loginform[username]: when inspecting chromium logs... missing? copied login code, supposed same?

sql - PHP delete function -

i have delete script on dashboard working before moving domains. ( not sure if relevant ) the code 'deletejob.php' below. <?php error_reporting(0); $host = 'localhost'; $port = 3306; $database = 'database'; $username = 'username'; $password = 'password'; $uid = $_post["id"]; // connect database $dsn = "mysql:host=$host;port=$port;dbname=$database"; $db = new pdo($dsn, $username, $password); // connect $query = "delete joblist id='$uid'"; // query thingy whatever called $statement = $db->prepare($query); $statement->execute(); while ($result = $statement->fetchobject()) {} ?> the script functions if working , gives me alert ( id has been deleted. ) does have idea why script return false positive? you must find row want delete, using select statement, this: $stmt= $conn->query("select * users id='".$_request['ids']."'")

scala - How to determine parameter ranges of MLlib algorithms? -

i'm developing spark project in scala. want create mllib models linear regression, naive bayes, gradient boosting regression etc. here want try generating these models different combinations using parameters. example gradient boosting regression takes num_iters, maxdepth, learning_rate , maxbins parameter. specified parameter ranges algorithm: num_iters -> list.range(3,10) maxdepth -> list.range(5,20) maxbins -> list.range(25,50) learning_rate -> list(0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1) i searched lots of sources didn't find solution. what want know how can specify these parameter's ranges logically.

javascript - Best format of localStorage -

i have array of object tree var tree = [{ "id": "1", "name": "one", "child": [], }, { "id": "2", "name": "two", "child": [{ "id": "21", "name": "twentyone", "child": [], },{ "id": "22", "name": "twentytwo", "child": [], }], }, {{ "id": "3", "name": "three", "child": [], }, }]. which 1 best way store array of objects in localstorage ? better use format? there several methods: getitem getallitem removeitem saveitem but there child arrays of objects. means use recursive search find necessary object. save data in localstorage array, or array of simple objects, try keep dry (don't repeat yourself). exam