Posts

Showing posts from August, 2012

asp.net - How to get the value of a RadGrid selected row during PostBack -

i'm working radgrid programmatically defined , populated @ runtime. elsewhere on page (within same radajaxpanel) control has data populated id passed radgrid. when row in radgrid selected, passes id control. problem grid_selectedindexchanged event doesn't occur until after postback completed, , control needs id data during postback. related issue (i'm sure have same problem @ core) issue i'm having deleting records. have button when clicked, marks record deleted in database. since needs id of selected row(s) radgrid, fails work. any solutions? i've been scouring web solutions week no results. this project convoluted, here's of relevant code: private sub page_load(byval sender object, byval e system.eventargs) handles me.load definegrid() _grid.datasource = buildmaindataset() _grid.databind() if _grid isnot nothing andalso _grid.selecteditems.count > 0 dim selectedrow griddataitem selectedrow = _grid.selecteditems(0

hour - C# Get Only Date from DateTimePicker -

i topic ( how date value windows forms datetimepicker control? ) dont fix problem; i send date field sql code; baglanti.cmd.parameters.add("@odemetarihi", dtodemetarih.value.toshortdatestring()); and try it; baglanti.cmd.parameters.add("@odemetarihi", dtodemetarih.value.tostring(dd-mm-yyyy)); but send pdf datagrid values using itextsharp saw pdf file date field "10.07.2013 00:00:00". want report without hour. do? just try this.first need retrieve date datetimepicker , use toshortdatestring() baglanti.cmd.parameters.add("@odemetarihi", dtodemetarih.date.toshortdatestring());

contacts - Determine iOS sort order for ABContactsHelper -

for iphone project i'm using abcontactshelper erica sadun. show contacts wan't use same sort order ios uses in e.g. adressbook.app. there possibility information? i tried: + (bool) firstnamesorting; + (bool) lastnamesorting; from abcontactshelper class these give me first name sorting. if set lastname,firstname in contact setting. in advance. chris abpersongetsortordering() should work. abpersonsortordering sortorder = abpersongetsortordering(); if (sortorder == kabpersonsortbyfirstname) { // sort firstname } else { // sort lastname } if @ ericas code you'll see not return sort order. returns display format. from abcontactshelper.m: // sorting + (bool) firstnamesorting { return (abpersongetcompositenameformat() == kabpersoncompositenameformatfirstnamefirst); } that's wrong. maybe want skip 4 year old, unmaintained code , write yourself. addressbook framework not hard understand.

C++ Function, take in enum and return a typedef class type to be used in template? -

is possible write (inline?) c++ function, accept enum input , returns class type can used in template declaration? my intuition since there finite number of enum types, should possible? enum myenumtype { a, b, c }; class myclassa { }; class myclassb { }; class myclassb { }; template class<t> class atemplatedclass { // ... }; notsurewhatreturntype convertenumtoclasstype(myenumtype type) { switch (type) { case a: return myclassa; case b: return myclassb; case c: return myclassc: default: throw; } } myenumtype type = gottensomewhere(); auto class_type = convertenumtoclasstype(type); atemplatedclass<class_type> is_this_possible; functions cannot return types. need metafunction : template <myenumtype> struct convertenumtoclasstype; template <> struct convertenumtoclasstype<a> { typedef myclassa type; }; template <> struct convertenumtoclasstype<b> { typedef myclassb type; }; // … etc. ty

Why do my switch cases sometime need braces in Objective-C? -

this question has answer here: why can't variables declared in switch statement? 23 answers sometimes xcode show error " expected expression " on line after case. example, xcode pointing usercontentviewcontroller red arrow: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { switch (indexpath.row) { case indexvideo: usercontentviewcontroller* detailviewcontroller = [[usercontentviewcontroller alloc] initwithuser:self.user]; [self.navigationcontroller pushviewcontroller:detailviewcontroller animated:yes]; break; } } if put braces around case, error gone. firstly, want know problem not using braces. i've never used braces in cases in other language. secondly, why xcode complain cases on rare occasions? can't quite discern type of code triggers erro

sql server - Remove an orphaned sys.service_queue -

i have orphaned entry in sys.service_queues table. when do select * sys.service_queues name '%sqlquerynotificationservice-%' select * sys.objects name '%sqlquerynotificationservice-%' i see matching results: sqlquerynotificationservice-1d50f684-cb16-4feb-a2e1-d53872cd1e23 627637429 null 6 0 sq service_queue 2013-07-10 14:11:14.520 2013-07-10 14:11:14.520 0 0 0 1 [cqs_web].[sqlquerynotificationstoredprocedure-1d50f684-cb16-4feb-a2e1-d53872cd1e23] -2 1 1 1 0 1 sqlquerynotificationservice-1d50f684-cb16-4feb-a2e1-d53872cd1e23 627637429 null 6 0 sq service_queue 2013-07-10 14:11:14.520 2013-07-10 14:11:14.520 0 0 0 so i'm trying remove orphans with: declare @objname nvarchar(max) declare @msg nvarchar(max) select @objname = name sys.objects name 'sqlquerynotificationservice%' if (@objname 'sqlquerynotificationservice-%') begin print 'found orphan ' + @objname + ', ch

php - Signature Pad: Capturing more than one signature -

i using thomas j bradley's signature pad , need able accept (and regenerate) 2 (or more) signatures @ time. , unfortunately, right now, can first canvas widget accept signature - second canvas widget unresponsive. maybe i'm doing wrong in javascript section? what need change make accept 2 signatures in 1 form? <form method="post" action="" class="sigpad"> <b>signature 1:</b> <br /> <ul class="signav"> <li class="clearbutton"><a href="#clear">clear signature</a></li> </ul> <div class="sig sigwrapper"> <div class="typed"></div> <canvas class="pad_1" width="490" height="130"></canvas> <input type="hidden" name="signature_pad_output_1" class="output_1"> </div> <br> typed name: <input type="text"

javascript - Use facebook as (alternate user account) causing like button to disappear -

i noticed today if logged in facebook, , have selected 1 of alternate business profiles (under *, use facebook as) tries put original profile picture , red box says "switch" on pages have button included using javascript sdk, in place of normal button. here example of page on happens: http://www.infolists.com/arts/painting/000000000128.php because leave enough space button, blows page layout. in layer falls behind layer next line. unfortunately, have logged in facebook , using alternate profile (such business or fan page) see issue. admit rare , reason never noticed before. but there has got workaround this. i've tried searching couldn't find else same problem. any appreciated. as far aware, fan pages can objects within facebook. button on websites meant personal profiles only. your option maintain same layout fix div container of iframe fixed height. overflow hidden should (already set).

python - How to efficiently serialize a scikit-learn classifier -

what's efficient way serialize scikit-learn classifier? i'm using python's standard pickle module serialize text classifier , results in monstrously large pickle. serialized object can 100mb or more, seems excessive , takes while generate , store. i've done similar work weka, , equivalent serialized classifier couple of mbs. is scikit-learn possibly caching training data, or other extraneous info, in pickle? if so, how can speed , reduce size of serialized scikit-learn classifiers? classifier = pipeline([ ('vectorizer', countvectorizer(ngram_range=(1,4))), ('tfidf', tfidftransformer()), ('clf', onevsrestclassifier(linearsvc())), ]) for large text datasets, use hashing trick: replace tfidfvectorizer hashingvectorizer (potentially stacked tfidftransformer in pipeline): faster pickle won't have store vocabulary dict more discussed in question: how can reduce memory usage of scikit-learn vectorizers?

javascript - Copy value from one form field into another without checkbox -

i'd enter number form field , have field next automatically update 2x number. can't figure out how without checkbox. i have this: var val = document.form1.field1.value if (/^\s*$/.test(val)) { } else { document.form1.field2.value = val * 2 } what thought check if field1 has value (otherwise i'd fields show placeholder), , if have value make field2 = field1 * 2 my goal have field2 update type numbers in field1. thank help! add keyup handler, , parse value number (it's string) , multiply 2 : <form id="form1"> <input id="field1" onkeyup="fn(this)" /> <input id="field2" /> </form> <script type="text/javascript"> function fn(elem) { var val = parsefloat(elem.value) * 2 || ''; document.getelementbyid('field2').value = val; } </script> fiddle

jQuery/javascript slideshow on page background -

this trivial question , i've searched last 2 hours , have got lot of results. problem i've create slideshow background images. unfortunately none of them worked 100% me. last piece of code trying is, <script type="text/javascript"> var images=new array('images/home.png','images/home02.png','images/home03.png'); var nextimage=0; doslideshow(); function doslideshow() { if(jquery('.slideshowimage').length!=0){ jquery('.slideshowimage').fadeout(500,function(){slideshowfadein();jquery(this).remove()}); } else{ slideshowfadein(); } } function slideshowfadein(){ jquery('body').prepend(jquery('<img class="slideshowimage" src="'+images[nextimage++]+'" style="display:none;z-index:-1">').fadein(500,function(){settimeout(doslideshow,3000);})); if(nextimage>=images.length) nextimage=0; }

ios - preserve object in memory while deleting from disk -

i send nsarray of managed objects uiviewcontroller , in view controller can select 1 of objects , expand info user can see. meanwhile database of objects updated in background, creating new objects , deleting old ones. the problem when object in nsarray erased background, user becomes unable check it. ¿how can maintain objects in nsarray while exist in uiviewcontroller? you on right track creating dicts objects, don't on main thread. you'll create new nsmanagedobjectcontext , set it's parent property 1 associated w main queue. use it's performbock method create dictionaries (i prefer objects, that's call). when have completed assembling array use dispatch_async pass main thread

python - OpenCV cv2.fillPoly vs. cv2.fillConvexPoly: expected data type for array of polygon vertices? -

i have following code: import cv2 import numpy ar = numpy.zeros((10,10)) triangle = numpy.array([ [1,3], [4,8], [1,9] ], numpy.int32) if use cv2.fillconvexpoly so: cv2.fillconvexpoly(ar, triangle, 1) then results expected. if, however, try: cv2.fillpoly(ar, triangle, 1) then failed assertion. seems identical assertion fails if use numpy array cv2.fillconvexpoly not have dtype numpy.int32 . cv2.fillpoly , cv2.fillconvexpoly expect different data types second argument? if so, should using cv2.fillpoly ? cv2.fillpoly , cv2.fillconvexpoly use different data types point arrays, because fillconvexpoly draws 1 polygon , fillpoly draws (python) list of them. thus, cv2.fillconvexpoly(ar, triangle, 1) cv2.fillpoly(ar, [triangle], 1) are correct ways call these 2 methods. if had square , hexagon point arrays, use cv2.fillpoly(ar, [triangle, square, hexagon], 1) to draw three.

java - How to display some text in TextView for a specified amount of time? -

i have developed android application extracts single line text messages server. once button clicked, makes function call gets next message server. of messages time based, i.e messages have displayed in textview particular amount of time , after time elapsed, should automatically make function call next message server(i.e without button being clicked). could please me out in achieving this. i tried using while loop follows: while(!presenttime.equals(expirytime)){ calculatepresenttym(); //this method calculates presenttime value display.settext(the received instruction); } if(presenttime.equals(expirytime)) (make function call) if this, nothing being displayed till presenttime , expirytime equal. once equal, next instruction automatically fetched function call , displayed in textview. use a handler handler m_handler; runnable m_handlertask ; m_handler = new handler(); @override public void run() { // m_handle

html - How do I make this menu black and remove underline? -

i'm creating website future clothing company. don't have experience coding, bear me if it's bit sloppy. want full black line go across page , make horizontal menu black , remove underline. how do this? <img border="0" src="http://www.miacreative.com/esw/images/white-box-mid.png" alt="vealed" width="280" height="81"> <li><a href="#"> <li><a href="#">men</a></li> <img border="0" src="http://www.miacreative.com/esw/images/white-box-mid.png" alt="vealed" width="30" height="81"> <li><a href="#">women</a></li> <img border="0" src="http://www.miacreative.com/esw/images/white-box-mid.png" alt="vealed" width="30" height="81"> <li><a href="#">photography/art</a></l

Mysql Unique constraint issue and liquibase 3.0 when table name is "status" -

i have table named status : | field | type | null | key | default | | +----------+------------------+------+-----+---------+----------------+ | id | int(11) unsigned | no | pri | null | auto_increment | | db_table | varchar(255) | no | | | | | name | varchar(255) | no | | | | | rank | varchar(6) | yes | | null | | | style_id | int(11) unsigned | no | | null | | +----------+------------------+------+-----+---------+----------------+ with create statement create table `status` ( `id` int(11) unsigned not null auto_increment, `db_table` varchar(255) not null default '', `name` varchar(255) not null default '', `rank` varchar(6) default null, `style_id` int(11) unsigned not null, primary key (`id`) ) engine=myisam auto_increment=8 default charset=utf8 luqibase generatechangelog command liq

ado.net - what are side effects Connection Pooling with SQL Server -

in asp.net c# project , sql server 2008r2 , ado.net added , increase maxpoolsize attribute in connection string , time out issue hass been fixed read msdn article there no reference side effect increasing. for compare these situation increase , decrease max pool size testing query stored procedure sql server . if there open , usable connection, connection pool provides can use them again. increases performance. use sql stored procedure database process. best way performance , security! don't forget close connection =)

mysql - Insert new row with id 1 -

is there possibility delete entire data in table , insert new rows id starts 1 delete command helps remove data table when trying insert new row id last inserted row id+1(if last inserted id 5 new id should 6) want store id 1 any suggestions other truncate command, in advance after deleteing records do alter table tablename auto_increment = 1 note from mysql docs : link you cannot reset counter value less or equal have been used. myisam, if value less or equal maximum value in auto_increment column, value reset current maximum plus one. innodb, if value less current maximum value in column, no error occurs , current sequence value not changed.

c# - Get ShockWaveFlash Memory use -

i have shockwave flash object on form , wont see how memory using other information regarding performance. you need add such imports project: import flash.system.capabilities; import flash.system.system; and go trough capabilities , system class properties , methods different system info (for example system.freememory ). won't because of different flash restrictions.

three.js - converting script shader to js shader -

got uniforms in e.g uniforms: { "time": { type: "f", value: 0.0 } }, where e.g. attribute float customfrequency; attribute vec3 customcolor; go? tia (just added code trying convert) <script type="x-shader/x-vertex" id="vertexshader"> uniform float time; attribute float customfrequency; attribute vec3 customcolor; varying vec3 vcolor; void main() { vcolor = customcolor; vec4 mvposition = modelviewmatrix * vec4( position, 1.0 ); gl_pointsize = size; gl_position = projectionmatrix * mvposition; } </script> <script type="x-shader/x-fragment" id="fragmentshader"> varying vec3 vcolor; void main() { gl_fragcolor = vec4( vcolor, 1.0 ); gl_fragcolor = gl_fragcolor * texture2d( texture, gl_pointcoord ); } </script> apologies not formulating question - want create threejs shader above script in form of three.basicshader = { uniforms: {}, vertexshader: [ &

DB:seed file for Laravel 4 working fine on local host, not working on Mediatemple gridserver? -

i have laravel 4 db:seed file trying use on mediatemple gridserver. able run migration artisan fine (php artisan migrate), , make tables, not able seed tables. database seeding worked fine on local host. on live server experiencing issues it. here seed file: artiststableseeder.php: class artiststableseeder extends seeder { public function run() { // uncomment below wipe table clean before populating // db::table('artists')->delete(); $artists = array( ); $artists = [ ['stage_name' => 'blah', 'city' => 'blah', 'state' => 'blah', 'video_path' => 'youtube.com', 'image_path' => 'filepickerimage', 'soundcloud_profile' => 'https://soundcloud.com/', 'description' => '', 'created_at' => new datetime, 'updated_at' => new datetime] ]; // un

mysql - Add 28 to last 2 digit of date and replace the order -

i have number such : 840106 i need following : change number date add - , flip number : 06-01-84 add 28 last 2 digit date : 06-01-12 84 + 16 = 00 + 12 = 12 number changing cab 850617 , format same add - , add 28 last 2 digit. any ideas how me here ? here sqlite solution: create table t( c text); insert t (c) values(990831); insert t (c) values(840106); insert t (c) values(800315); insert t (c) values(750527); insert t (c) values(700923); insert t (c) values(620308); select c, substr(c,5,2) || '-' || substr(c,3,2) || '-' || case when (substr(c,1,2) + 28) < 100 (substr(c,1,2) + 28) else case when ((substr(c,1,2) + 28) - 100) < 10 '0' || ((substr(c,1,2) + 28) - 100) else ((substr(c,1,2) + 28) - 100) end end t;

Integration Tests on Geb / Spock + Selenium Grid do not run in parallel -

i have following set-up: integration tests project has suite of tests written in groovy/geb + spock, running both using selenium webdriver , selenium grid (remotewebdriver). the problem no matter how try tweak "system", can't tests run in parallel (i.e. although have 3 slaves [nodes] registered hub, 1 of slaves receives requests). i've enforced maxsession=1 selenium nodes , tried different combinations of parallel=classes|methods, threadcount , fork settings in failsafe plugin configuration (pom.xml file). i have feeling problem lies somewhere between maven configuration , selenium grid, in relation geb/spock config. does of have insight on issue? ps: suggested running tests in parallel using geb / spock not possible - because reason ?geb? locks junitrunner (not sure means). you can run sure, point have put them(your testes) in threads. here link.

jsf 2 - How can i store database information in JSF2 -

in managed bean need access mysql database. far used code this: class.forname("com.mysql.jdbc.driver"); string url = "jdbc:mysql://localhost:3306/test"; string username = "user"; string password = "1234"; connection connection = null; try { connection = drivermanager.getconnection(url, username, password); now have in more 1 bean, if need change database credentials, have fiddle around in 10 files. is there a way store databaseconnection a way define variables whole web project thanks in advance it idea store these kind of values in .properties file. can accessed via java.util.properties ( http://docs.oracle.com/javase/7/docs/api/java/util/properties.html ) here tutorial describing how access these files , values, suggest start this: http://www.mkyong.com/java/java-properties-file-examples/ (more information: http://en.wikipedia.org/wiki/.properties ) in ide, create new source packa

java - Extracting a pattern from String -

i have random string need match pattern , parse out. my string- {"sid":"zw9cmv1pzybexi","parentid":null,"time":1373271966311,"color":"#e94d57", "userid":"255863" ,"st":"comment","type":"section","ctype":"parent"},{},null,null,null,null,{"sid":"zwldv1lx4f7ovx","parentid":"zw9cmv1pzybexi","time":1373347545798,"color":"#774697", "userid":"5216907" ,"st":"comment","type":"section","ctype":"child"},{},null,null,null,null,null,{"sid":"zw76w68c91mhbs","parentid":"zw9cmv1pzybexi","time":1373356224065,"color":"#774697", "userid":"5216907" ,"st":"comment","type":"section",

java - How to Check if seek API is available on your Android Device? -

do know how check if android device secure element evaluation kit api available through code in android? in advance. you can connect using adb , check existence of file org.simalliance.openmobileapi.jar in system/framework if file exist that's mean have lib seek in android device. hope it's

mysql - How to get single result after grouping? -

i have table this type amount purc 100 sale 120 sale 80 purc 150 sale 50 sale 70 sale 120 purc 60 when run query "select type, sum(amount) amount mytable group type" can 2 result set like type amount purc 310 sale 440 but want single result in 1 query sale , purc like sale purc profit 440 310 130 what single query? try this: select sum(if(`type` = 'purc', `amount`, 0)) `purc`, sum(if(`type` = 'sale', `amount`, 0)) `sale` `mytable` this should perform so-called pivoting on table. using case instead of if : select sum(case `type` when 'purc' `amount` else 0 end) `purc`, sum(case `type` when 'sale' `amount` else 0 end) `sale` `mytable`

Jquery addClass() using vertical-align css property -

i have input box, pretty twitter (i using bootstrap). when pressing it, want expand, does. problem placeholder , input text start in middle. have tried several ways change without success: $(this).css({"height":"80px","vertical-align":"top"}); addclass method can me find solution? thanks in advance! vertical-align doesn't work text inputs.. try setting padding instead. don't need set height either, use bottom padding force text top. if want multiple lines consider using textarea instead. $(this).css({"padding-bottom":"60px"}); demo on bootply

javascript - Position some text behind a div -

i needed position text centered horizontally , vertically relative 'dropzone' (a div). works solution: inject text above div centered horizontally , vertically the jsfiddle: http://jsfiddle.net/upyyh/4/ var $span = $('<span/>').text('hello, world'); $('body').append($span); $span.position({ of: $('.dropzone') }); now need have text behind dropzone. (and i'll set dropzone opacity of .5 example). don't know if possible didn't found way it. why doing it? have text ('drop files here') showed behind dropzone area not interfere dropzone. any idea? thanks. try with: .dropzone { background: silver; height: 300px; padding: 5px; border: 2px solid rgb(255, 165, 0); opacity: 0.8; } and $span.css('z-index', -1); or add css rule bright : .bright{ z-index: -1; } demo

objective c - colorRadialShading: nil value for argument -

i'm creating painting app on cimicropaint sample code. , right i'm getting error /sourcecache/coreimage/coreimage-8.4.0/api/cifilter.mm:588: ciradialgradient apply:: caught exception: ciradialgradient: colorradialshading: nil value argument #2 (c0) when try draw on cimicropaintview 1 can explain error why i'm getting ? error mean view don't color draw with?

android - Google Play Game Services; Invitation system -

in android game, want players able invite friends game match take place @ later date , time. player created match chooses date , time. want these invitations able pending, meaning users don't have accept invitation right away, rather have them in pending list can accept them anytime, long before date , time game take place. game real-time based game. i thought using google play game services accomplish , other things in game, achievements etc, , believe work actual game. fact works cross platform big plus. problem how invitations handled game services. google developer documentation: https://developers.google.com/games/services/common/concepts/realtimemultiplayer room : virtual meeting space games take place. players can invited join rooms, or automatically matched them. players connected same room can exchange game data each other. participant : players can participate in game. local player can send invitations other players circles join room, or request

Adding custom icon in font awesome -

i tried adding custom icon converting .svg format. added converted .svg icon importing http://icomoon.io/app/ , downloaded .png image. not original image.it simple black box. missing here?? i doing now. check out tutorial! uses utility called font custom, sounds of might not need, maybe tutorial on track. create own font awesome icons

cordova - Phonegap plugins with emberjs -

i'm new both phonegap , emberjs. have app working emberjs i'm trying add plugins. use commandline phonegap add plugin ... the plugins install don't work when app compiled. for instace org.apache.cordova.statusbar, supposed prevent statusbar overlaping in ios7. the plugin should work following code: `<script type="text/javascript"> function onload(){ document.addeventlistener('deviceready', ondeviceready); } function ondeviceready(){ statusbar.overlayswebview(false); } </script>` however when build (locally) , deploy statusbar continues overlay. should using cordova rather phonegap i'm building locally? possible use of ember issue? thanks in advance

c# - Post value from javascript to Controller -

in our mvc project using following javascript function , have ensured working function without errors. function getselecteditems() { var newitemids = []; $("#selectitems tbody").find('tr').each( function () { var id = $(this).find('#hfid').val(); var isadd = $(this).hasclass('k-state-selected'); if (isadd == true) { newitemids.push(id); } }); jquery.ajaxsettings.traditional = true $.post("/form8invoice/additemtocart", { newitemids: newitemids }); however when posting array values controller, seems values not getting passed. controller action method given below quick reference. [httppost] public actionresult additemtocart(string[] newitemids, [datasourcerequest] datasourcerequest request) { if (newitemids != null) { float grandtotal = 0; string curr

extjs4 - Component as grid emptyText in ExtJS? -

Image
i want display component emptytext grid, extjs documentation states html can shown. for example button pop-ups create window, shown below: is there workaround use component in grid, or perhaps config i'm missing? of course can that, have debug lot in order see how that. that's why have alternative: add hidden docked toolbar "create new employee" button. add listener load store event, , when no records available, show toolbar, otherwise hide toolbar.

php - MySQL Return Type Variance - NULL, EMPTY, FALSE -

why mysql -> php via pdo either return null , empty (array), or false when select query (and possibly other types) returns zero-result set? i can't quite seem figure out in cases each different type returned... , hope not written somewhere on front cover of manual; although did bit. edit 1: so seems pdo thing, not mysql. pdo->fetchall() return empty array if result-set zero, , false on error. null ? and no column values requesting not null in case silly thought came head. in detail important function using. in generally, "false" means error occured. check out php.net more details.

c# - Can I add some comment while debugging my application? -

is there way in visual studio add comment code while executing debugging? if try visual studio tells me changes not allowed . searching on google found many people ask feature can't find real solution insert comment code (only bookmarks). is impossible or there way accomplish operation? i know in java (using eclipse) can , comfortable if have enabled edit , continue (e&c), should able edit code while program in break mode, e.g. you've hit break point. should enabled default, if reason isn't, can read how enable e&c here . 64-bit applications, support e&c added .net 4.5.1.

CSS/HTML alignment of items in an item grid not displaying correctly -

i have problem css of section of site. products being shown in product grid, not come in order if screen small. for example, if go site: http://pcsg.asia/shop-by-category/exfoliants.html?limit=9 , view site on screen larger 30", have no problem seeing items in order , next each other. use grid mode. however, if access site on screen smaller 24" or so, see products not displaying in correct multiples(i.e. 2 in 1 row, 1 in 1 row, 2 again) how align such display of products fit nicely each other, , not have irregular rows? thanks! i using magento go, , can check out css using browser's development tool. thanks! this code align items 4 in row, mess image when screen size increases , reduces .products-grid li.item{ width: 225px; // remove line , add below style width:24%; } .products-grid .product-image{ width: 225px; // remove line , add below style width:100%; } or can use this to change column count 4 3 in category page, add be

css - Positioning two horizontal divs in a dynamic way -

i have 2 divs inside container: <div id="outer"> <div id="a"> test<br/> test<br/> test<br/> test<br/> test<br/> test<br/>test<br/>test<br/>test<br/>test<br/>test<br/>test<br/>test<br/> </div> <div id="b"></div> </div> what need 'b' stays @ bottom , has fixed size (200px). 'a' should stay @ top , fill rest of space available. when resize parent element 'b' should stay @ 200px , 'a' should shrink. i wasn't able working pure css prefer have in css only. i've made fiddle containing solution jquery want avoid javascript layouting whenever it's possible. http://jsfiddle.net/t6b2e/ you can use display:flex; keep jquery fallback ... or css fallback. whatever here basic example : body {background:black;color:white;} #

node.js - Enforce inlining of functions in CoffeeScript or JavaScript -

i'm trying structure code in many short functions, readable without many comments, due flow of functions , variable. last year implementing high performance application in c structured same way, avoid function calls, annotated virtually every function inline. now i'm writing nodejs application in coffeescript , have structured part of code in tens of small functions called loops. aggregate few hundred - few thousand function calls - depending on size of data-structure. since functions merged 1 bigger one, calls avoided, degrade quality of code. i've found on reference extreme javascript performance , presentation 2009 , shows huge performance improvement when inlining functions on firefox , ie, noticeable improvement chrome , safari. 5 years ago , js-engines improving time, question is: is possible enforce inlining of functions when coffeescript creates js or in js parser, specific keyword or parameter? or should wait v8 engine realise , handle automatically (or

php - How to get value from mysqli_query -

i using mysqli_query select count( statid ) device_realtime_stats in statement, in db returns value ex:3 i want integer in php. giving this $rows_count = mysqli_query($con, " select count( statid ) device_realtime_stats "); but not returns integer, how convert. want integer value in php you can count // return mysqli statement not integer $rows_count = mysqli_query($con, " select count( statid ) count device_realtime_stats "); $count = mysqli_fetch_object($rows_count)->count; // return count want

jmeter - using another function variable with matchNr variable -

i have implemented regular expression extractor negative match no. want use variable variable, e.g.: ${story_matchnr_${__counter(true,)}} using inside loop controller , hence want every matchnr value in single request. i tried using eval function or user-defined variable well, seems cant use variable of functions variable. is there simpler method this? there @ least 2 ways done: using __v() functon allows combining 2 variables using beanshell pre processor gives more options of variables concatenation , control links above contain examples , sample use cases.

Creating javascript object from simple object -

suppose have object var io={"name":"battery alarm panel","code":"power max","own":"onm"} which can access below io['name'] or io['code'] etc. but if want create object how can access obj below code not working error uncaught syntaxerror: unexpected token [ detailobj= { io['name']: { io['code']: { io['own']:"12" } } } what changes need made in io object create detailobj you can't declare object that, using variables inside of object declaration property names. you'll have create object this: detailobj = {}; detailobj[io['name']] = {}; detailobj[io['name']][io['code']] = {}; detailobj[io['name']][io['code']][io['own']] = "12";

c - Is this the correct way of splitting a large file? -

i need split large image or text file multiple chunks of 10 bytes. these chunks sent via udp server. problem is: 1. im unsure code. way of splitting files? 2. programs memory usage pretty high. 400 kb function. int nchunks = 0; char chunk[10]; file *filetoread; filetoread = fopen(default_filename, "rb"); while (fgets(chunk, sizeof(chunk), filetoread)) { char *data = malloc(sizeof(chunk)); strcpy(data, chunk); packet *packet = malloc(sizeof(packet)); packet->header = malloc(sizeof(packetheader)); packet->header->acked = 0; packet->header->id = ++nchunks; packet->header->last = 0; packet->header->timestamp = 0; packet->header->windowsize = 10; packet->data = data; list_append(packages, packet); } typedef struct packetheader{ ... }packetheader; typedef struct packet{ packetheader *header; void *data; }packet; is way of splitting files? when file consists of t

sql - Parsing MYSQL Insert statement -

i'm writing java tool parse sql queries in order table , columns details. parse select statement use mysql jdbc resultsetmetadata. : string query = "select * vendors"; preparedstatement pstmt = con.preparestatement(query); resultsetmetadata meta = pstmt.getmetadata(); system.out.println(meta); but doesn't work insert/update statement. does have solution that? i tried various other solutions without success. thanks you can column name of table using resultssetmetadata this, resultsetmetadata rsmd=res.getmetadata(); int columncount=rsmd.getcolumncount(); (int = 1; i<= columncount; i++) { columnheading=columnheading+"\t"+rsmd.getcolumnname(i); system.out.println(columnheading);

javascript - This is showing 1-24 hours i need to 1-12 hours show how i can do this? -

this showing 1-24 hours need 1-12 hours show how can ? function onbodyload (){ var = new date(); var hr = now.gethours(); var min = now.getminutes(); var sec = now.getseconds(); document.getelementbyid('clockdisplay').innerhtml = "time " + hr + ":" + min + ":" + sec; settimeout('onbodyload()', 500); } gethours() returns 0-23…here how convert 1-12: var hr = time.gethours(); if (hr > 12) { hr -= 12; } else if (hr=== 0) { hr = 12; }

Files is not been written c# -

can point me what's wrong code? trying write file, nothing gets written file. sorry stupid question.. file gets created nothing written on it. public static void main(string[] args) { streamwriter writer = new streamwriter(@"c:\file\test.txt"); writer.writeline("fun times!"); console.writeline("finally !"); console.readline(); } you're not closing file. 1 way wrap writer in using statement: using(streamwriter writer = new streamwriter(@"c:\file\test.txt")) { writer.writeline("fun times!"); } console.writeline("finally !"); console.readline();

node.js - Concrete Operational Transformation Algorithm of Etherpad(-Lite)? -

can me provide hint or source concrete ot-algorithm used in etherpad or etherpad lite? base on academical paper? hint or link part of source code transformation-part welcome. the etherpad wiki has docs on changesets , etherpad operational transforms documentation , review code want source code changeset library . it's worth noting etherpad uses same javascript code server , client side operational transforms. should have further questions perhaps ask them on etherpad developers mailing list hit correct audience . disclaimer , posterity: i'm founder of etherpad foundation , not profit goal of supporting etherpad software , community.

Android - Uploading Image that sits at the public folders -

i'm trying upload image not sits under app folder @ public folder. in order upload image, i'm using next code - private string dopicupload(string path1){ file file1 = new file(path1); string urlstring = "http://87.182.1.15/upload_pic.php"; try { httpclient client = new defaulthttpclient(); httppost post = new httppost(urlstring); filebody bin1 = new filebody(file1); multipartentity reqentity = new multipartentity(); reqentity.addpart("uploadedfile1", bin1); post.setentity(reqentity); httpresponse response = client.execute(post); resentity = response.getentity(); final string response_str = entityutils.tostring(resentity); return response_str; } catch (exception ex){ log.e("debug", "error: " + ex.getmessage(), ex); string expction = "0"; return expction; } } now, when debug code seems stops @ line - httpresponse re

sql - Update Inner Join Operation must be updateable query -

trying update purchase order information in case of purchase order revisions. update tblpo inner join qrypoln_update_info on tblpo.poln = qrypoln_update_info.poln set tblpo.[line quantity] = [qrypoln_update_info].[line quantity] (((qrypoln_update_info.poln)=[tblpo].[poln])); getting "operation must updateable query" error. ideas how fix? got it. i using group in 1 of previous queries. if put data temp table , run update off temp table, gets around error. answer found @ https://www.fmsinc.com/microsoftaccess/query/non-updateable/index.html

android - ActionBar Fill Entire Bar (No Grey Background) -

need help i can't title bar/action bar change colour red (#ff0000), remains grey. styles: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="themeselector" parent="android:theme.holo.light"> <item name="android:actionbarstyle">@style/actionbar</item> </style> <style name="actionbar" parent="android:style/widget.holo.actionbar"> <item name="android:background">#ff0000</item> </style> </resources> update: (mainfest) <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.twostarii.actionbardemo" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="11" android:targetsdkversion="19" /> <application android:allowbackup="true" android:icon="

How to pass parameters to parent class with type() in python? -

class parent(object): def __init__(self, first): self.first = first class child1(parent): def __init__(self): parent.__init__(self, 'a') i have parent class , want make 12 similar classes inherit parent class, same signature , no parameters. how define child1, using type() ? far have child1 = type('child1', (rank,), dict()) how can pass first parent class? you use attributes dictionary. think should trick. def genericinit(self): parent.__init__(self, 'a') type('child1', (rank,), {'__init__': genericinit}) updated per comments: use functools.partial attrdict = {'init': functools.partial(parent.__init__, first='a')} but bad code. don't want calling init anywhere other init because it's confusing using class.

sql - Ignore null values in select statement -

i'm trying retrieve list of components via computer_system, if computer system's graphics card set null (i.e. has onboard), row isn't returned select statement. i've been trying use coalesce without results. i've tried , or in clause, returns computer system different kinds of graphic cards. relevant code: select computer_system.cs_id, computer_system.cs_name, motherboard.name, motherboard.price, cpu.name, cpu.price, gfx.name, gfx.price public.computer_case , public.computer_system, public.cpu, public.gfx, public.motherboard, public.ram computer_system.cs_ram = ram.ram_id , computer_system.cs_cpu = cpu.cpu_id , computer_system.cs_mb = motherboard.mb_id , computer_system.cs_case = computer_case.case_id , computer_system.cs_gfx = gfx.gfx_id; <-- ( or computer_system.cs_gfx null) returns: 1;"computer1";"fractal design"; 721.00; "msi z87"; 982.00; "core i7 i7-4770k "; 2147.00; "crucial gamer&quo

android - AlertDialog: Why can't I show Message and List together? -

does know why alertdialog doesn't show list of items when add message .setmessage() ? negative , positive buttons shown, not list. when delete line .setmessage() works. this code: alertdialog.builder myalertdialog = new alertdialog.builder(this.getactivity()); myalertdialog.settitle("options"); myalertdialog.setmessage("choose color."); charsequence[] items = {"red", "blue", "green" }; myalertdialog.setsinglechoiceitems(items, -1, new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { // stuff } }); myalertdialog.setnegativebutton("no",new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { // stuff } }); myalertdialog.setpositivebutton("yes",new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) {

Dart intl library resolving with incorrect path -

i've started dart application (using angulardart). when import angulardart package see console error in dartium. import 'package:angular/angular.dart'; if comment out angulardart import don't see error. it appears though intl library being resolved web directory root. (e.g. web/packages/intl/src/temporary_debugging.dart instead of packages/intl/src/temporary_debugging.dart ). i see same error untouched version of angulardart tutorial i'm wondering if bug. i've played around tutorial before , haven't seen error until now. in describing error found in using built in server in webstrom 8 (eap) see error, when using webstorm 7 error doesn't occur. i'm going file bug intellij.

Regex expression to mach one of many strings in php -

i totally new regex , want match if value 1 of following cs,ch,es,ee,it,me till have tried if (preg_match("/^[cs|ch|es|ee|it|me]{2}$/",$val)) echo "true"; else echo "false"; its working fine true cases returns true reverse of them sc,hc etc. helpful if refer source/books learn php. remove character class [] regex , wrap them using () . remove {2} not necessary anymore. if (preg_match("/^(cs|ch|es|ee|it|me)$/",$val)) and you.

asp classic - IIS 6 is throwing a "500 - Internal Server Error" for some users but not others -

i had written mini app in asp classic week. worked on test server connecting test data base. yesterday evening moved test server live server updating connection strings live db. i published application default website in default app pool. tested , worked perfectly. this morning both myself , user receive 500 -internal server error when try , save changes database(there appears no issue reading db) yet 2 other collogues have no issue @ all. even more odd same thing happening on test server code hasn't been changed in weeks. morning cannot commit db there either. i have attempt enable more detailed error tracking , logging property options server seem unavailable when tried set custom active server pages (asp) error pages off online tutorials. the server used lot of people wondering permission issue depending on user restricts writting database. or else may have changed allow users write data , others receive error. im knew iis may glaringly obvious haven't consi

python - GeoIPIPSP.dat Invalid datebase type -

we have commercial maxmind-subscribtion obtain geoip-database isp-information (geioipipsp.dat). however, when try query file, keep getting following error: geoiperror: invalid database type, expected org, isp or asnum i'm using python-api: geo = geoip.open("/geoipipsp.dat", geoip.geoip_standard) isp = geo.name_by_addr(ip) # or isp_by_addr pygeoip when use api ask database-type (geo._type) "1" ... same value when open regular geoip.dat. i'm wondering if there's wrong geoipisp.dat, it's recent file maxmind's customer-download-page. any insights appreciated! it turns out there problem database-file indeed. after re-download works supposed to. i switched pygeoip though , access database this: import pygeoip geo_isp = pygeoip.geoip("/usr/share/geoip/geoipipsp.dat") isp = geo_isp.isp_by_addr("8.8.8.8")

Java Recursion compilation error -

i fresh student in computer science , study java recursion. unfortunately, academy explains following regarding topic: what recursion means. there 2 types of cases when using recursive algorithm: base cases , recursive cases , purpose. an example of factorial , fibonacci implementation using recursion. now got following exercise: two integer numbers called "strangers" if greatest common divisor (aka gtc) only 1". example, numbers 8 , 9 "strangers" because gtc 1. however, 8 , 9 not "strangers" because gtc 2. please implement recursive method receives array of integers, , returns "true" if every pair numbers in array strangers, , "false" otherwise. method signature must follows: public boolean checkgcd(int[] values) for example: {3, 5, 7, 11} -> method returns true. {4, 7, 8, 9} -> method returns false because 4 , 8 not strangers. for assistance, can use following method fin

c# - HTTP 400 Bad Request - CORS enabled WCF Service -

Image
i trying use cors on wcf cross domain calls service. have of things working, when try call function gives me error - http 400 bad request i used fiddler capture error , says this when tried find solutions, saw people suggesting use bodystyle=webmessagebodystyle.bare . tried , service giving errors because have more 1 parameters. [operationcontract] [webinvoke(method = "post", bodystyle=webmessagebodystyle.wrapped, requestformat=webmessageformat.json, responseformat=webmessageformat.json, uritemplate = "/getdata")] //[webget(bodystyle = webmessagebodystyle.bare, requestformat = webmessageformat.json, responseformat = webmessageformat.json, uritemplate = "/getdata/{value}/")] string getdata(string value, string val2); i not sure how solve problem. appreciated. if need @ more, config please let me know , can share it. service call: var d

mysql - php warning when logging in website folder by cpanel -

i writing php script in cpanel. when access website folder (e.g. www.bbbbbb.com/folder/) give warning that. warning: mysqli::mysqli() [mysqli.mysqli]: (hy000/2005): unknown mysql server host 'host07.portalwebhosting' (1) in /home/restaur/public_html/restaurant/variables/variables.php on line 7 warning: mysqli::set_charset() [mysqli.set-charset]: couldn't fetch mysqli in /home/restaur/public_html/restaurant/includes/connect_database.php on line 3 warning: mysqli::stmt_init() [mysqli.stmt-init]: couldn't fetch mysqli in /home/restaur/public_html/restaurant/includes/login_form.php on line 45 fatal error: call member function prepare() on non-object in /home/restaur/public_html/restaurant/includes/login_form.php on line 46 and use default account admin access, gives me same result. and here php coding <?php // database configuration $host ="host07.portalwebhosting.com"; $user ="user"; $pass ="password"; $database = "m

ios - Can't change property of self in asynchronous block -

i'm trying change properties of self, can't change in asynchronous block. here code: __weak typeof(self) weakself = self; nsurlsessiondatatask *posttask = [session datataskwithrequest:request completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { if (response == nil) { // } else { // else dispatch_async(dispatch_get_main_queue(), ^{ nsstring *markername = [nsstring stringwithformat:@"public-%@",[weakself.pad getmarkernameforcategory:weakself.categorylabel.text]]; weakself.pad.markername = markername; [weakself.navigationcontroller popviewcontrolleranimated:yes]; }); } }]; [posttask resume]; } if i'm setting breakpoint after assignment weakself.pad.markername = markername markername not being set, still old value. some project details: ios 7, arc enabled edit changed first line __block typeof(self) weakself = self; problem still

javascript - jQuery add list with images instead of text characters when typing -

i have input , when i'm typing, let's say: a , want result <li class="a"><img src="a.png" /> if space => <li class="space"></li> . list appends ul.text . also when press backspace need last item removed. i have untill now, can't make work: $('input').live('keyup', function(e){ this.value = this.value.touppercase(); var pressedletter = $(this).val().tolowercase(); $('ul.text').append('<li><img src="letters/'+pressedletter+'.png" alt="" /></li>'); }); any help, please? thanks. you're appending new element on each keyup ul element. have change attributes of li and img elements instead. $('input').live('keyup', function (e) { this.value = this.value.touppercase(); var pressedletter = $(this).val().tolowercase(); if( $('ul.text').find('li').length < 1 &am

ios - What is the recommended way to intercept and prevent redirects with AFNetworking 2.0? -

it seems me proper place in afurlsessionmanager , in setting taskwillperformhttpredirection block, unsure of best way handle it. currently, in afhttpsessionmanager subclass, setting redirect block globally requests, , know can prevent redirects returning nil here: - (void)setupredirectblock { [self settaskwillperformhttpredirectionblock:^nsurlrequest *(nsurlsession *session, nsurlsessiontask *task, nsurlresponse *response, nsurlrequest *request) { return nil; }]; } ...but need on specific tasks, , there doesn't appear way information task itself. i guess looking sort of user info dictionary or can use set flag telling method either return request or return nil . currently, looks have string comparison on response/request url in client far away task , path created. so begs question, fighting convention, or there no better way intercept afnetworking 2.0 redirect on task-by-task basis? settaskwillperformhttpredirectionblock best way intercep

Liferay projects building in wrong deploy folder -

working liferay , portlets last 3 weeks. i downloaded bundled liferay server , placed on local drive. did set , able access localhost:8080 properly. i created custom portlets , when build them in eclipse war files getting deployed in path c:/liferay/deploy. now, changed server location, wanted have server in d:/ drive. when did transition, started tomcat server d:/liferay/tomcat/bin/startup.bat , build project, war files still building in c:/ drive. when copy war file manually c:/liferay/deploy d:/liferay/deploy gets deployed successfully. want war file created directly in d:/liferay/deploy folder. can me understand changes need here? if using liferay plugin sdk there file named build.<userid>.properties in plugin sdk.change below properties per new configuration , give try app.server.portal.dir app.server.lib.portal.dir app.server.lib.global.dir app.server.deploy.dir auto.deploy.dir