Posts

Showing posts from July, 2010

python - List comprehension returning values plus [None, None, None], why? -

this question exact duplicate of: understanding python 3 lists printing none value each element 1 answer im studying comprehensions. print(x) part (i think. prints value of x passes 'in' test) why returning list of none afterward? >>> g ['a', 'x', 'p'] >>> [print(x) x in g] x p [none, none, none] #whats this? you use list comprehension print items in list, , list printed. try assigning list variable instead. >>> g ['a', 'x', 'p'] >>> x = [print(x) x in g] x p # now list in x , isnt printed. list still there... >>> print(x) [none, none, none] >>> x [none, none, none]

asp.net - Problems with GridView and HyperLinkColumn -

when using control datagrid, can use type of column: <asp:hyperlinkcolumn datanavigateurlfield="url_doc" datatextfield="des_doc" headertext="document"> <itemstyle horizontalalign="center"></itemstyle> </asp:hyperlinkcolumn> where "url_doc" come stored procedure value: selet '../documentos/' || res.cod_op || '/' || tdo.des_tipo_doc || '/' || '01' || '/' || res.file_name url_doc mytable url_doc stores path of document file, included in sub folder of asp.net project. when click on hyperlinkcolumn, can open document file. now, if try use gridview, can't find column hyperlinkcolumn. when using gridview, tried use hyperlinkfield like: <asp:hyperlinkfield datanavigateurlfields="url_doc&q

asp.net - How to add a button control dynamically into a GridView cell ? VB.NET -

look, it´s simple. have gridview populated data database. what want put button in each cell contains specific datum. pls, image below. describes want in vb.net, pls! =) example image thanks much! you going need define button control inside of <columns> section of gridview markup, this: <asp:gridview id="customersgridview" runat="server"> <columns> <asp:boundfield datafield="datecolumn" headertext="date"/> <asp:templatefield> <headertemplate> positive </headertemplate> <itemtemplate> <asp:label id="labelpositive" runat="server" text='<%# eval("positivecolumn")%>' /> <br /> <asp:button id="buttonpositive" runat="server" text="show" /> </itemtemplate>

mysqldump - Error 1794 loading mysql 5.6 master dump while configuring replication slave -

e:>mysql -u root < masterdump.db error 1794 (hy000) @ line 22: slave not configured or failed initialize properly. must @ least set --server-id enable either master or slave. additional error messages can found in mysql error log. there no additional messages in error log. in respective my.ini files (yes, i'm on windows) master server-id=1 slave server-id=2 when open dump file , @ line 22 have (x's inserted privacy): change master master_host='1x2.21.42.xxx', master_port=3306, master_user='replicant', master_password='masteaccessxxx', master_log_file='mysql-bin.000004', master_log_pos=335723162; don't have --server-id on line not part of "change master to" command ( http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html ) i started slave said: mysqld --skip-slave-start does have idea missing? thanks, andrew ok figured out. you must @ least set --server-id enab

java - How to update the TextView in the activity by clicking a button in ListView? -

here have listview of products. want update totalbill textview, in activity not in listview, whenever user clicks on add button in listview. problem is, customadapter doesn't allow update textview, in activity class, on button click. how achieve this? tvid = (textview) v.findviewbyid(r.id.itemid); tvname = (textview) v.findviewbyid(r.id.itemname); tvprice = (textview) v.findviewbyid(r.id.itemprice); tvqty = (textview) v.findviewbyid(r.id.quantity); plusbutton = (imagebutton) v.findviewbyid(r.id.addbutton); minusbutton = (imagebutton) v.findviewbyid(r.id.minusbutton); } plusbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { int qty = integer.parseint(tvqty.gettext().tostring()); double itemprice=double.parsedouble(tvprice.gettext().tostring()); tvqty.settext(string.valueof(++qty)); shoppingcart2 cart=new shoppingcart2()

UNIX grep command syntax for lines containing at least 35 characters -

i'm trying print lines contain, let say, @ least 35 characters, file. how can this? grep not best tool job. you write: grep ................................... filename or use 1 of more sophisticated regular expression features mentioned in other answers (if grep supports them). awk : awk 'length >= 35' filename or perl : perl -e 'print if length >= 35' filename would more appropriate.

javascript - how do you get current day's starting time and the most current time in milliseconds -

need curent time , 00:00 in morning in milliseconds? need automatically every day, current starting morning (00:00:00) , current time in milliseconds? has done this? this works : function milliseconddiff(mydate) { var midnightday = mydate.getutcdate(); var midnightmonth = mydate.getutcmonth() + 1; var midnightyear = mydate.getutcfullyear(); var midnightmilliseconds = new date(midnightyear + '/' + midnightmonth + '/' + midnightday).gettime(); return new date().gettime() - midnightmilliseconds; } var millissincemidnight = milliseconddiff(new date()); console.log(millissincemidnight + ' ms'); console.log((millissincemidnight / 1000) + ' s'); console.log((millissincemidnight / (1000 * 60)) + ' min'); console.log((millissincemidnight / (1000 * 60 * 60)) + ' h');

soapui - Soap UI FailedAuthentication : The security token cannot be authenticated, WCF Client Could not establish trust relationship for the SSL/TLS s -

i connecting external webservice using wcf. have no control on external webservice. using soap ui test connection. request working fine till yesterday , security token cannot authenticated exception. per service wsdl, request needs username, pwd authentication why seeing error on soap ui. service url. https://orserviceb2btest.oracleoutsourcing.com:443/soa-infra/services/default/mmissoaprequestreceiver!1.0*soa_d48cf4e0-5e7b-43ad-b430-727180d48841/routeeditransactions_ep this how soap ui request looks <soapenv:envelope xmlns:cor="http://www.caqh.org/soap/wsdl/corerule2.2.0.xsd" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:header> <wsse:security soapenv:mustunderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:u

c++ - Blank Screen in OpenGL and Glut -

when attempting draw cube, get, instead, blank screen. screen background of glclearcolor . my code in many files can't post here, i've placed on github . you'll want @ it. it's visual studio 2012 file source there ide. though incomplete, here snippets: edit: able see me shapes, lightless. when use made normals in glutsolidteapot, looks flat. also, though specify far cutting plane 1000, shapes disappear far before that. i've updated code more recent. codeindigo.cpp // entry point! // code indigo 3d mystery game. readme more information. #include "codeindigo.h" #include <iostream> void box_update (const int& frame, const object& self) { return; } void update (int frame) { if (indigo::keys ['w']) { indigo::current_world.camera.move (0.05); } if (indigo::keys ['s']) { indigo::current_world.camera.move (-0.05); } if (indigo::keys ['a']) { indigo::cu

oracle10g - Connection refused error in oracle 10g -

i beginner in oracle 10g. have tried connect oracle 10g database. here code: package com.lara; import java.sql.*; class x1{ public static void main(string args[])throws exception{ class.forname("oracle.jdbc.driver.oracledriver"); connection con=drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:xe","scott","tiger1"); statement stmt=con.createstatement(); string sql="create table emp(sno int,name varchar(90),age int)"; stmt.execute(sql); } } but getting error: exception in thread "main" java.sql.sqlexception: io exception: connection refused(description=(tmp=)(vsnnum=169870080)(err=12505)(error_stack=(error=(code=12505)(emfi=4)))) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:134) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:179) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:333) @ oracle.jdbc.driver.oracleconnection.<init>(oracleconne

c# - How can I compare and update the first occurrence in an array overlap? -

say have following 2 arrays... string[] = ["word1", "word2", "word3"]; string[] b = ["word0", "word1", "word2", "word3", "word4", "word5", "word6", "word1", "word2", "word3"]; if want compare b , remove first occurrence in b looks this... string[] b = ["word0", " ", " ", " ", "word4", "word5", "word6", "word1", "word2", "word3"]; how go this? a straightforward way use array.indexof find first occurrence of each word a in b : foreach (var word in a) { var index = array.indexof(b, word); if (index >= 0) { b[index] = " "; // or whatever other value } } note might not work expected if replacement value present inside a -- if possible should specify want happen. update: looks want find , replace subseq

php - Any way to combine results from fulltext query -

i've got fulltext mysql query works -- except fact end duplicate results in cases. i've got several types of data i'm trying search: buildings, suites, assets, etc., each in own table. each type of data can have user-defined custom fields, data stored in different table. here structure. create table `buildings` ( `bid` int(11) not null auto_increment, `name` varchar(250) collate utf8_unicode_ci not null, `status` enum('active','inactive') collate utf8_unicode_ci not null, `source` enum('feed','manual') collate utf8_unicode_ci not null, primary key (`bid`), fulltext key `textsearch` (`name`) ) create table `customfields` ( `cfid` int(11) not null auto_increment, `name` varchar(250) collate utf8_unicode_ci not null, `datatype` enum('integer','date','smtext','lgtext','numeric','enum','linked') collate utf8_unicode_ci not null, `options` longtext collate utf8_unicode_ci,

javascript - Issue With JSON Data -

Image
i'm having weird issue json data. { "title" : "counties", "data": [ { "name": "baker", "latlng": [ "44.65488,-118.42475", "44.64548,-118.38275", "44.62488,-118.34425", "0,0", "1,0" ] } ] } when use .getjson file data getting syntax error if take out last 2 entries latlng array work correctly. i put json though linter @ jsonlint.com , says it's valid json chrome , firefox can't parse reason. the code getting json file: $(function() { $.getjson("json/counties.json", function(data){ console.log(data); }); $(document).ajaxerror(function(event, jqxhr, settings, exception){ console.log(exception); }); }); the exception logged chrome syntaxerror {} and exception logged

Passing arguments in anonymous functions in JavaScript -

sometimes see javascript written argument provided has set value or object methods. take jquery example instance: $(".selector").children().each(function(i) { console.log(i); }); when logging i , value of whatever i in iteration when looking @ selectors children in jquery each method. take node.js example: http.createserver(function(request, response) { response.writehead(200, {"content-type": "text/plain"}); response.write("hello world"); response.end(); }).listen(8888); you can see here request , response being passed , contain own methods can acted on. to me, looks passing function createserver function 2 arguments have methods attached them. my question multipart one: where these arguments come from? if these anon functions, how receive arguments can acted on other functions? how create functions can take own arguments this?? does use power of closures?? to me, looks passing functio

php - Laravel 4 RESTful Api with content negotiation -

i'm working in restful api laravel, , want use content negotiation in project, don't know how accomplish that. have controllers separted api version, , want distinguish between api versions , use correct controllerdepending on version. my api router is: route::group(array('prefix' => 'api'), function() { route::resource('users', 'api\v1\userscontroller'); }); should create api.type filter use in route group or should in route group clousure or maybe, in each controller? don't afraid branch out application logic library classes. don't have fit inside of laravel's given folder structure. in fact, adding in own namespaced group of classes can have big benefit. can see setup on creating own application library here . once have set up, can create class responsibility decide content type return. might based on accept header, url parameter or whatever define (that's you, api creator). perhaps class take

Android Share Image from Phone Gallery to Facebook using Facebook API -

i trying have android application share uri image facebook. when using picture parameter, forces use url of picture. since trying share phones gallery, wondering if there way have uri read url, or other way this. suggestions? update: have updated adding code attempting use. understand not using newly rolled out api of facebook. want able post picture phone gallery facebook, , not picture url. thank you! private string[] arrpath; int id = viewit.getid(); if(facebook.issessionvalid()) { bundle params = new bundle(); params.putstring("name", "androidapp"); params.putstring("caption", "application android"); params.putstring("description", "this description"); params.putstring("link", "http://www.google.co

c# - Mono WinForms TableLayoutPanel cell locked in place relative to the form -

i have form tablelayoutpanel on it, controls in cells. 1 of controls misbehaving, though, when run program in mono. when resize form, control sits is, instead of moving keep rest of controls in tablelayoutpanel ! doesn't happen when run program in .net. have clue cause control stuck this? if 1 of controls misbehaving first guess anchor or dock properties of control isn't others. might control behaving should , expected different behavior.

html - jquery file upload plugin- selected file name not being displayed -

i using jquery file upload plugin(basic) upload single file @ time. plugin works fine , can see files dumped in correct directory, good! when select file, name(chrome)/path(ie) of selected file not displayed, instead displays "no file chosen". how can change display name of selected file? code: script : $(function () { $('#fileupload').fileupload({ datatype: 'json', url: '@url.action("index", "home")', add: function (e, data) { data.submit(); }, progress: function (e, data) { var progress = parseint(data.loaded / data.total * 100, 10); $('#progress .bar').css('width', progress + '%'); }, done: function (e, data) { $('<p/>').text(data.files[0].name).appendto(document.body);

SQL Server Date insert -

i have text data import sql server , dates formatted: 'jul 14 2005 12:00:00:000am' is there way sql server import these directly or need write code translate data number "m/d/y" format ? if using standard import features, tweak import mapping, import data holding tables "as-is" , copy end table performing conversion @ time. this works well select convert(datetime,'jul 14 2005 12:00:00:000am')

php - Not being able to get next textarea working -

i have textarea after div , i'm using rangyinputs insert text in area, surrounding etc. if use following code works: window.surround5 = function surround5(text2,text3){ $("#textarea5").surroundselectedtext(text2, text3); } being textarea5 class name, didnt wanted use class name tried with: window.surroundtest = function surroundtest(text2,text3){ var c = $(this).next('textarea'); c.surroundselectedtext(text2, text3); } but keeps getting me error nodes on rangyinputs doesnt show in other way. if alert shows "object object" finding textarea right? the implementation like: <div> <div onclick="surroundtest('[center]', '[/center]');">center</div> </div> <textarea ....> edited div making call. jsfiddle: http://jsfiddle.net/qmpy8/ remember, in jquery, if want select element class, by $('.elementclass') //select 1 or more element class the # selector id's, not

android - Force EditText to lose focus when back pressed -

i'm trying force edittext control lose focus when user presses button hide keyboard. there many questions similar already, after several hours, haven't been able make work. first, little bit of context. have listview custom items. each item has several textviews , 1 edittext. have aftertextchanged() method saving edited values. have style set highlight field if has focus. unfortunately, more obvious edittext doesn't lose focus when hide (soft) keyboard, , think it's confusing. edittext not focused if there's no keyboard. the solution seemed reasonable override onbackpressed() in activity described here . unfortunately, doesn't appear method being called. i.e. field still focused, , breakpoint in function doesn't fire. similarly, onkeyup() listener on activity doesn't fire, , xamarin doesn't appear support onkeyup handler edittext control. i'm not trying suppress keyboard on creation, or anything, using of invisible control tricks don

c++ - Compiling GLFW with Visual Studio 2012 -

Image
the issue as apparently many people (including here on stackoverflow), have run trouble compiling, , linking, c++ opengl code glfw library on visual studio (i using v11.0 aka 2012 ultimate). here error list: error 1 error lnk2019: unresolved external symbol __imp__glfwinit referenced in function _main c:\users\dennis\myopengl\opengl1\opengl1\main.obj opengl1 error 2 error lnk2019: unresolved external symbol __imp__glfwterminate referenced in function _main c:\users\dennis\myopengl\opengl1\opengl1\main.obj opengl1 error 3 error lnk2019: unresolved external symbol __imp__glfwcreatewindow referenced in function _main c:\users\dennis\myopengl\opengl1\opengl1\main.obj opengl1 error 4 error lnk2019: unresolved external symbol __imp__glfwwindowshouldclose referenced in function _main c:\users\dennis\myopengl\opengl1\opengl1\main.obj opengl1 error 5 error lnk2019: unresolved external symbol __imp__glfwpollevents referenced in function _main c:\users\d

filter paragraphs from a XML using PHP and HTMLPurifier, SimpleXmlElement or DOM -

i'm trying remove social media buttons, leaving paragraphs, description field of xml here (it's big post here). edit: since of couldn't access xml, follow part of 1 of description tags: <description> <!-- twitter https://twitter.com/about/resources/buttons#tweet --> <script> document.write('<a href="https://www.twitter.com/tst_oficial" class="twitter-follow-button" data-show-count="false" data-lang="pt">seguir</a>'); !function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0];if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs");</script> <!-- curtir site facebook (enviar) --> <iframe class="fb_ltr" src="http://www.facebook.com/plugins/like.php?href=https://www.facebook.com/tstjus&layout=button_count&s

Windows Phone 8 Control Orientation -

i'm working on custom control windows phone 8. control includes videobrush need rotate keep consistent outside page page rotates. assumed control class have onorientationchanged event phoneapplicationpage does, doesn't. is there anyway of detecting orientation of containing page? add method control allow rotating video feed. developer using control able update control's orientation on page's orientationchanged event seems clunky. you can subscribe orientationchanged event of phoneapplicationframe, available via app.rootframe. if need page, can navigate visualtree find containing page visualtreehelper.getparent, , hook orientation changed event yourself.

ruby on rails - Using Apotomo gem to build a user-driven widget page -

i trying use apotomo setting widgets in app , have been running few issues. i've tried researching, haven't found useful yet. hopefully, might have experience here. here setup: i have users model (set via devise), can each create custom pages (pages model). each page can have number of widgets. pagescontroller#show view used display published version of page or preview page user. pagescontroller#edit view used display page in "edit" mode w/ forms each widget, allowing user update them needed. i have widgets model serialized "data" field holds values each widget. (things such title , url , etc). the issue running displaying each user's customized widget. for sake of question, let's assume have single widget "pictureswidget". i've added widget pagescontroller so: class pagescontroller < applicationcontroller has_widgets |root| root << widget(:pictures) end ... end i have 2 views in pages co

ejb - Hibernate vs. Entity Beans -

whats advantage of using hibernate vs entity beans , vice versa ? i can see advantages of hibernate vs jdbc clearly, stumbled when asked in interview. from ejb3, there no concept of entity bean , has been redefined jpa. jpa spec , can use of orm frameworks underlying persisting mechanism hibernate,openjpa, toplink. after jpa specification , orm framwork should adhere jpa spec. includes hibernate too. hibernate or jpa can used in standalone application i.e. doesnt require container deployed. can accessed in standalone environment. thanks

java - Powermock error mock object injected using spring when mocking static object -

i using powermock easy mock mock static method of class. have 2 test cases written, if run independently run fine, give me error while running simultaneously. cartest: @runwith(powermockrunner.class) @preparefortest({ servicecaller.class }) public class cartest { servicecaller mockservicecallerobjecttoreturn; public cartest() { powermock.mockstaticpartial(servicecaller.class, "getinstance"); mockservicecallerobjecttoreturn = powermock.createmock(servicecaller.class); easymock.expect(servicecaller.getinstance()).andreturn(mockservicecallerobjecttoreturn); } @test public void test1() throws ioexception { powermock.reset(mockservicecallerobjecttoreturn); powermock.reset(servicecaller.class); easymock.expect(servicecaller.getinstance()).andreturn(mockservicecallerobjecttoreturn); easymock.expect(mockservicecallerobjecttoreturn.checkvalidity("testdriver")).andreturn(false); powermock.replay(mockservicecall

osx - Made a restricted user account for SSH login, I have some security questions -

i made restricted account on osx machine when i'm away home (in school, library, parents place etc.) can login , work on coding via vim. i figuring out how set ssh key, kind of makes inconvenient me use keys login because logging in different computers , it's annoying step have configure each time. i reading online leaving ssh port (22) open isn't advisable unless it's super secured because bots/people may try brute force (i know can change default port, though doesn't whole lot security). so, i'm wondering, ok set user account long, complex password , forgo ssh key? or stupid thing do. edit: also, how @ logs see if have had unauthorized connection attempts? changing port 22 else idea. since port 22 common try crack, if change port, bots have scan open ports. if have port scan detection software installed, can block ip addresses before far. using password authentication not "stupid" thing if have nice long password lots of entrop

neo4j - Why are there so much nodes, relationships and properties in the dashboard? -

i'm new neo4j. installed few hours ago , started following tutorial described in guide. @ most, created 7 or 8 nodes, , 1 type of relationship (knows). i've reaopened neo4j , dashboard tells me there 1870 nodes, 1546 properties, , 2326 relationships. when go data browser, can see node 1870. still confuses me, after having seen posts: neo4j overview dashboard returns wrong node/relationship/property counts? or other one: why neo4j webadmin reporting incorrect node/relationship/property counts? what i understood them dasboard doesn't show real quantity of nodes, relationships, etc. then, why can see node 1870? doesn't afect whatever graph i'm trying create? imagine affect it, , have delete .db dile start again? in advance the dashboard should highest id in use nodes, rels , props - , not exact counts. id's requested in chunks that's why seeing difference. for exact node count do: start n=node(*) return count(n)

Updating an iOS app Deletes the content of Documents Folder -

i have folder structures inside documents folder of ios app. creating folder each date , storing data related date inside particular folder. released new version , got feed user saying when updated app datas lost. storing png files inside folders. there way when user updates app these document folder structure remains same ?

mysql - how to get sum with table and minus with other table? -

i have 2 tables: budget id | project_name | total_budget 1 | test | 5000 2 | try | 200 expense id| project_name |paper|ballpen|total 1 | test |100 |200 | 300 2 | test |50 |50 |100 3 | try |20 |0 |20 so total of test project_name 400 5000 - 400 = 4600 try 200 -20 = 180 want 1 result sorry im newbie cant one this simple join aggregation: select b.project_name, b.total_budget, e.total total_expense, b.total_budget - e.total diff budget b left join (select project_name, sum(total) total expense e group project_name ) e on b.project_name = e.project_name; if want 1 project_name, add where clause: where b.project_name = 'test'

c++ - LNK2019 error but Intellisense works fine -

i have native c++ unit test project throwing lnk2019 error every function call in project under test. surprisingly though, intellisense works fine! the project under test static library (.lib) comprised of single public static function (type , member names have been changed protect innocent): type.h #pragma once #include <string> using namespace std; namespace n { enum class resultcode { undefined, a, b, c}; class mytype { public: static void getresult(string id, string metadata, resultcode result); }; } type.cpp #include "pch.h" #include "type.h" namespace n { void mytype::getresult(string id, string metadata, n::resultcode result) { // implementation } } my unit test project (a .dll) not use header file tests. i'm using google test framework. here source: test.cpp #include <pch.h> #include <gtest/gtest.h> #include <gtesthelpers/gtesthelpers.h> #include <mytype

functor - Is it possible to make a function pointer with parameters in C++ -

i'm trying capture function pointer hand functor , don't understand why can't. functor class: template <class c> class myfunctor : public basefunctor { public: typedef long (c::*t_callback)(const long, const char *); myfunctor (void) : basefunctor(), obj(null), callback(null) {} virtual long operator() (const long a, const char *b) { if ( obj && callback ) { (obj->*callback)(a,b); } } c *obj; t_callback callback; }; elsewhere in code: the function signature long c::func (const long, const char *) myfunctor funky; funky.obj = this; funky.callback = func; then error: ... function call missing argument list; ... why not work? edit: in working through suggestions below, came across simple solution make particular implementation work. funky.callback = &c::func; i'm not 100% sure trying code 2 c++ features easier use function pointers std::function , std::mem_fn he

ios - Performance issues with AFIncrementalStore -

i'm experimenting afincrementalstore, awesome, i'm noticing having performance issues. specifically, i'm using bring down bunch of facebook friends info facebook graph api, , i'm seeing pretty slow clocktimes save operations. context, i'm loading in 900 records. instruments telling me problem line this: nsmanagedobjectid *backingobjectid = [self objectidforbackingobjectforentity:entity withresourceidentifier:resourceidentifier]; which in turn calls this [backingcontext performblockandwait:^{ backingobjectid = [[backingcontext executefetchrequest:fetchrequest error:&error] lastobject]; }]; has had experience using afincremental store larger data sets? somethign else don't quite understand why action happening on main thread when getting kicked off using performblockandwait operation context privatequeueconcurrencytype. appreciated! just partial answer: performblockandwait: execute block on private queue, calling threa

sql server 2008 r2 - Load testing of a web page and generating data in SQL Database -

i have page,and @ time more 1000 of entries form has made. ex: multiple users accessing form entering data in single form different locations.so,this scenario has generated test load of same form. manually generating data in database tedious,so there query enter data in database using sql server 2008r2. apache jmeter. apache jmeter apache project can used load testing tool analyzing , measuring performance of variety of services, focus on web applications. https://jmeter.apache.org/

symfony - Installing Javascript in symfony2 -

hi stackoverflow people. im trying use javascript graph in test twig view. view: <h1>test</h1> {% javascripts '@acmefoobundle/resources/public/js/*' %} <script src="{{ asset_url }}" type="text/javascript"> window.onload = function () { var chart = new canvasjs.chart("chartcontainer", { title:{ text: "fruits" }, data: [//array of dataseries { //dataseries object /*** change type "column" "bar", "area", "line" or "pie"***/ type: "column", datapoints: [ { label: "banana", y: 18 }, { label: "orange", y: 29 }, { label: "apple", y: 40 }, { label: "mango", y: 34 }, { label: "grape", y: 24 } ] } ] }); chart.render(); } </script> <script type=&quo

cql - TTL field for a set of columns in CQL3 - Cassandra -

consider following insert statement. insert nerdmovies (movie, director, main_actor, year) values ('serenity', 'joss whedon', 'nathan fillion', 2005) using ttl 86400; does ttl field specify time live whole set of columns particular primary key or 1 particular column. because want specify ttl whole set of columns should deleted after ttl expires. ok, figured out self. sets ttl whole set of columns. so, columns particular primary key deleted once ttl expires.

setting extent using setExtent in blackberry -

i want make use of setextent() method in blackberry. every time use setextent() , allocates space zero, 0 coordinate custom field paint extending field class. i want when draw custom field (100,100), should allocate space (100,100) , not (0,0). my code looks like: protected void layout(int width,int height) { setextent(100,100); } please me out solutions. what appear trying doesn't sound idea. 100 pixels useful measure on 1 device, 100 pixels on 9300 on 1/3 of height of screen, on 9800 no near that. recommend not use fixed pixel sizes blackberry development. that said, if want field start @ position 100,100, should use setpositionchild field in field's manager. before start leaping off attempting this, recommend review following: http://supportforums.blackberry.com/t5/java-development/how-to-extend-manager/ta-p/446749 , http://supportforums.blackberry.com/t5/java-development/create-a-custom-layout-manager-for-a-screen/ta-p/442990 but pe

html - PHP replacing blank images with a default one -

having 1 of brain fade moments morning. have following php: $imgset = $result->fields[6]; if ($imgset = '') { $imgset = 'logo'; } else { $imgset = $result->fields[6]; } echo '<img id="imgdisp" src="/img/'.$imgset.'.jpg" />'; $imgset = ''; where looks see if result database blank , if so, should put in logo.jpg instead of whatever result is. reason though, not want work , being blind, cannot see why not. still blank images in html , filenames of "/img/.jpg" though $imgset still passing through blank. values not null in sql either, blank entries inputted inputbox using _post in form elsewhere. cheers help ben this: if ($imgset = '') { is setting $imgset empty. use comparison instead: if ($imgset == '') { your else not needed since in case $imgset set $result->fields[6]; .