Posts

Showing posts from January, 2010

javascript - fullpage.js incompatibility issue with mobile.js and camera.js -

while trying setup image gallery encountered issue when calling camera.js (here) , mobile.js (here) along fullpage.js [(by alvaro trigo)]. problem whenever click on of hyperlinks in top navbar, won't work. there's 1 though, redirects page instead of section. works fine without gallery's scripts, , when imported, works except of above. can me out here? thanks in advanced. just in case, here's navbar code: <ul id="menu"> <li data-menuanchor="inicio" class="active normalmenu"><a href="#inicio">inicio</a></li> <li data-menuanchor="descripcion" class="normalmenu submenuact"><a href="#quees">qué es rien pipe</a> <div id="submenuact2"> <ul id="submenu"> <li data-menuanchor="descripcion" class="noborder"><a href="#d

c++ - Qt 5 dds support to save memory and improve rendering -

i load dds files qt 5.1 , have benefit of saving memory , improve rendering performance dds files in many cases less in size (due data destroying compression) png equivalent , stored in more cache friendly rendering structure "tiling" (i.e. http://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/ ) usual raw image data is. but... can't find reference topic when googling find others read dds files , convert them qimage suspect unpacks dds raw rgba giving performance when reading disk keeping bad parts more memory, less efficient texel reading , compression artifacts nothing. have missunderstood how qt handling textures or can dds formats dxt1-5 utilized corretly within qt 5.1? does qimagereader "unpack" dds files raw or loads them directly graphics hardware is? any other suggestions or pointers appreciated. qimage pure software object, not store on graphics card , has no support exotic internal data ordering. internal formats qim

c - When do label declarations and label values make sense? -

the gnu c extensions provide specification of label declarations , labels can assigned variables can used goto s. while acknowledge goto makes sense in situations (e.g. substitute exception handling in higher languages), not understand how goto language extension justified. can provide concrete example, label values provide benefits? the 1 time used effect threaded dispatch. imagine interpreter's inner loop: while (1) { switch ( *instruction_pointer ) { case instr_a: ... break; case instr_b: ... break; ... } ++instruction_pointer; } the biggest performance problem looping construct there's one branch (ideally) in swtich statement handling instructions. branch can never predicted. threaded dispatch add explicit code every case go next: void *instructions[] = { &&instr_a, &&instr_b, ... }; ... goto *instructions[*instruction_pointer]; instr_a: ... goto *instructions[*++instruction_poin

xcode - Building Unreal Engine 4: OS_X -

after downloaded github, run generateprojectfiles.command file, says setting unreal engine 4 project files... generateprojectfiles error: looks youre missing files required in order generate projects. please check youve downloaded , unpacked engine source code, binaries, content , third-party dependencies before running script. ~/udk_4.0/unrealengine logout but have xcode 5.1 , officially have no reference third-party dependencies. ideas try? if enter github site again there should getting started page / readme. need follow links download 2 required files , extract them folder have source / command file.

javascript - How to disable back button in php -

<html> <head> <script type="text/javasscript"> window.history.forward(); function noback() { window.history.forward(); } </script> </head> <body onload="noback();" onpageshow="if(event.persisted) ;" onunload=""> <a href="a1.php">aa</a> </body> </html> this code in html forwards same page when click back, how include script in php code. you can example that: <?php php code ?> html code <?php php code ?> html code <?php php code ?> or <?php php code ... echo "your html code"; ... ?>

date - R select row by year and month -

i have à dataframe head(journalbeart) date vtemperature 1 2012-03-08 10.2938450704225 2 2012-03-09 10.6240559440559 3 2012-03-10 12.4791398601399 4 2012-03-11 14.3567482517483 5 2012-03-12 15.9947622377622 6 2012-03-13 16.1366433566434 and want select line month , year. select rows months between april , june of 2012 have find month, month(journalbeart$date) %in% 3:9 how integrate month , year thanks! unless date column in date format, journalbeart$date <- as.date(as.character(journalbeart$date), "%y-%m-%d") then can use logical argument select date range want: journalbeart[journalbeart$date >= as.date("010412", "%d%m%y") & journalbeart$date <= as.date("300612", "%d%m%y"), ]

Can libgdx Particle Effects use texture regions? -

i have of images libgdx project in single texture. i'm add nice particle effects, documentation implies each type of emitter requires separate graphics file particle. is true? or, there way of specifying region of texture used particle image, may still keep images in single file? yes can but need have texture inside of textureatlas . take @ this article it. here example use textureatlas: m_effect = new particleeffect(); m_effect.load(gdx.files.internal("particle/effects/lightning.p"), this.getatlas()); or in 2 steps: m_effect.loademitters(gdx.files.internal("particle/effects/lightning.p")); m_effect.loademitterimages(this.getatlas()); here whatt loademitterimage does: public void loademitterimages (textureatlas atlas) { (int = 0, n = emitters.size; < n; i++) { particleemitter emitter = emitters.get(i); string imagepath = emitter.getimagepath(); if (imagepath == null) continue; string imagena

ruby on rails - How to access data through many_to_many relation? -

how access data through many_to_many relation? here database creations: the "useres": class createsubgroups < activerecord::migration def change create_table :subgroups |t| t.string :name t.belongs_to :group t.timestamps end end end the relationship: class creatertimespans < activerecord::migration def change create_table :rtimespans |t| t.belongs_to :subgroup_id t.belongs_to :timespan_id end end end the used: class createtimespans < activerecord::migration def change create_table :timespans |t| t.string :name t.text :descrition t.integer :start_h t.integer :start_m t.integer :end_h t.integer :end_m end end end how example access names of timespans, belong 1 subgroup? , vis versa, how can show, subgroups use specific timespan? first question you can whatever find call long instance.

Dynamic Linq Select -How to extract the results -

i have dynamic linq select statement of form var projection = result.asqueryable().select(string.format("new({0},{1})", model.xtabrow, model.xtabcolumn)); this works fine , produces iqueryable of anonymous types. however unable convert ienumerable use linq on asenumerable method seems missing. had use reflection extract field values in end there must better way - great thanks you can try this var projection = result.asqueryable().select(string.format("new({0},{1})", model.xtabrow, model.xtabcolumn)); var enumerableprojection = (from dynamic p in projection select p).asenumerable(); or var projection = result.asqueryable().select(string.format("new({0},{1})", model.xtabrow, model.xtabcolumn)); var enumerableprojection = projection.cast<dynamic>().asenumerable();

javascript - Highcharts: grouped columns with percentages -

my question similar this one or this one , except don't have simple series groups of data. basically, want have chart behaviour of "stacked percentage columns" chart, without stacking column. here example absolute values ( fiddle ) : var data = [ { name : 'a', data : [72, 50, 52] }, { name : 'b', data : [23, 41, 12] }, { name : 'c', data : [18, 9, 11] }, { name : 'd', data : [89, 46, 54] }]; // chart $('#container').highcharts( { chart : { type : 'column' }, xaxis : { categories : ['group 1', 'group 2', 'group 3'] }, yaxis : { title : { text : null } }, tooltip : { shared: true }, plotoptions : { column : { datalabels : { enabled : true } } }, title : {

Clojure DB Connection -

i new clojure. have defined datasource in weblogic 11. have below in code. neither getting error/exception nor able connect database. (def cms-apacdb {:name "apaccmsinterfacedatasource"}) (defn update-or-insert-apacitem [table-name {cms-content-id :cms_content_id :as cms-item}] (with-connection cms-apacdb (update-or-insert-values table-name ["cms_content_id = ?" cms-content-id] (assoc cms-item :updated (now)))) any highly appreciated.

Setting Chrome to render ASP.Net mobile -

i using functionality in asp.net detects if browser on mobile device , redirects page has *.mobile.cshtml. working great long i'm using mobile device, can't seem figure out how chrome or firefox use *.mobile.cshtml files instead of standard .cshtml files. i've tried setting chrome emulation use iphone, still rendering standard pages. is there setting in vs or chrome tell asp.net render mobile version?

php - Converting Procedural code to a class file -

i trying build class file. started out basic proceedural code working fine: the code here calculate minimum , maximum longitude , latitude give center point lon , lat , radius of 100 miles or 160.934 kilometers. $lat = 32.373591; //location latitude $lon = -88.743598; //location longitude $r = (160.934/6371); //radius distance in km $latmin = $lat - $r; //calculate minmum latitude $latmax = $lat + $r; //calculate maximum latitude $latt = asin(sin($lat)/cos($r)); //don't know calculation //$lontri = arccos((cos($r)-sin($latt)*sin($lat))/(cos($latt)*cos($lat)); $lontri = asin(sin($r)/cos($lat)); $lonmin = $lon - $lontri; $lonmax = $lon + $lontri; //calculate min , max longitude echo $lat . " latitude<br><br>"; echo $lon . " longitude <br><br>"; echo $r . " r <br><br>"; echo $latmin . " latitude min<br><br>";

powerpivot - sending a table of data in Microsoft Excel Power Pivot including all calculated fields back to excel as a linked table -

i have used power pivot create calculated fields table of data. then use modified table, calculated fields create pivot charts on excel workbook. in same way linked original dataset (excel table) power pivot, link table in powerpivot calculated fields excel. possible? yoshiserry , best way share powerpivot stuff powerview (excel 2013). if want share table, regular excel file should fine -- people without powerpivot installed able work (with limitations).

javascript - Why does angular $resource add extra objects ($promise, $resolve...) to my data response? -

i return resource url $resource("http://foo.com/bar.json").get(). $promise.then(function(data){ $scope.result = data}, function(error){ $scope.msg = "error" } ); resource returns ["item1"...."item_n",.....,"$promise", "$resolved", "$get", "$save", "$query", "$remove", "$delete"] why objects in data set. i'm guessing $promise returns , waits server response. once have server response can server data without promise jargon? if @ angular source here: https://github.com/angular/angular.js/blob/master/src/ngresource/resource.js#l505 there tojson method on resource prototype chain accomplish you. for example: $resource("http://foo.com/bar.json").get(function(res) { $scope.result = res.tojson(); });

c# - get actual column width -

Image
i building datagridview table programmatically , placing within groupbox on form. i insert data, resize columns automatically fit data. want resize groupbox size of datagridview. each column , row, respective width , height, technically should accurate, , update panel , overall datagridview sizes. the problem column.width returns 100 pixels regardless of actual size (see screenshot: actual column width around 30px, not 100). if manually enter width = 90 pixels, resizing quite accurate! matrix = new datagridview(); //modify behaviour matrix.columnheadersvisible = false; matrix.allowusertoresizecolumns = false; matrix.autosizecolumnsmode = datagridviewautosizecolumnsmode.allcells; matrix.rowheadersvisible = false; matrix.allowusertoresizerows = false; //modify positioning matrix.location = new point(10, 20); //matrix.anchor = (anchorstyles)(anchorstyles.left | anchorstyles.top | anchorstyles.bottom | anchorstyles.right); matrix.dock = dockstyle.fill; //set size of matrix matri

passing variable from a href to pop up box through php -

after click on href, ll pop out form , trying pass variable pop form. in while loop. while($row = mysql_fetch_array($result)) { $id=$row['file_id']; echo '<span class=right><a href="#edit_form?id='.$id.'">[edit]</a> } this pop form code <a href="#x" class="overlay" id="edit_form"></a> <?php $con=mysql_connect("localhost","root",""); mysql_select_db("isiti"); if (mysqli_connect_errno($con)) { echo "failed connect mysql: " . mysqli_connect_error(); } if (isset($_get["id"])) { $id =$_get["id"]; } $result = mysql_query("select * publication file_id='$id'"); $row1 = mysq

javascript - Share simple content on Facebook time line -

i want share simple text content on facebook time line using javascript of html. have tried below unable add content, can me how create below url share content dynamically. key sharing content. facebookshare thanks djrecker try encode url shared, i.e. if using php try call p[url]=urlencode(link) same title , summary

c# - Default text of combobox -

i want default text on combobox have binded combo box list of items...here code of xaml file. <combobox x:name="projectcombobox" text="{binding projectnamebinding}" itemssource="{binding projectlist, elementname=mainwin}" selectedvaluepath="_id" displaymemberpath="_name" selecteditem="{binding projectnamebindingclass, mode=onewaytosource}" width="130" background="white" borderthickness="1" fontfamily="/timesheet;component/resources/#open sans" fontsize="12" canvas.right="159" canvas.top="8" height="47"> <combobox.itemtemplate> <datatemplate> <textblock text="{binding _name}" textwrapping="wrap"/> </datatemplate> </combobox.itemtemplate> </combobox> have tried

php - Is it possible with Swift Mailer to send email message to a different address than is in the TO header? -

it's possible send email 1 address while address listed in email's header. say, envelope-to , header don't have match. makes possible send email have message appear addressed email address, useful if it's forwarded message. my issue, however, i'm not sure how swift mailer. it's easy enough set different addresses in envelope-from , header setsender() , setfrom(), doesn't appear possible same envelope-to , header. am not looking in right spot? possible extend library achieve this, , if so, how?

ios - RTCReporting & pancake.apple.com errors -

Image
yesterday updated xcode version 5.1 (5b130a); simulator's version reads version 7.1 (463.9.41). today started getting these weird errors when beginning playback using avplayer. have never seen such errors in past, can't find info them, , have no idea mean. not fatal , haven't noticed ill effects them. but… what rtcreporting , how did project? what pancake.apple.com have anything? etc. thanks. 2014-03-21 16:16:34.129 0.1[3330:5403] rtcreporting: resolve http://pancake.apple.com/bags/hls?version=4.12 2014-03-21 16:17:17.201 0.1[3330:5403] rtcreporting(getsvrconfig): error resolving lookup server http://pancake.apple.com/bags/hls?version=4.12 2014-03-21 16:17:17.201 0.1[3330:5403] rtcreporting(getsvrconfig): sendsynchronousrequest error error domain=nsurlerrordomain code=-1001 "the request timed out." userinfo=0x10f110d60 {nsunderlyingerror=0x11230ed80 "the request timed out.", nserrorfailingurlstringkey=http://pancake.apple.com/bags/hls?versi

hash - Removing item from list in c++ -

hello writing code hash table , want right delete function deletion of string values in list. void hash::remove(string word) { int i,flag=0; list<string>::iterator it; for(i=0;i<10;i++) { for(it=hashtable[i].begin();it!=hashtable[i].end();it++) { if(word==*it){ hashtable.erase(it); break; } } } } but when compile got error: error: request member ‘erase’ in ‘((hash*)this)->hash::hashtable’, of non-class type ‘std::list > [10]’ i cannot understand this. please me . use hashtable[i].erase(it) instead of hashtable.erase(it) .

bukkit - How to ignore case in replace method java -

this question has answer here: how replace case-insensitive literal substrings in java 6 answers alright trying check , see if string exists don't know case it's going in how use in method? here code if (!p.haspermission("core.chat.curse")){ string message = e.getmessage().tostring().tolowercase().replace(" ", ""); list<string> cursewords = manager.getcursefile().getstringlist("cursewords"); (string badword : cursewords){ badword = badword.tostring().tolowercase(); if (message.contains(badword)){ string crossout = ""; (int x = 0; x < badword.length(); x++){ crossout += "*"; } e.setmessage(e.getmessage().replace(badword, crossout)); //i need //replace ignore case here } } } .repla

visual studio - Unable to determine application identity call? How to track down? -

Image
i making windows phone 8 application , in designer view in both blend , vs "unable determine application identity call" error dialog box. from read on stack propably because of isolated storage getting run , designer can't handle it. i wondering there away can line numbers or errors happening instead of having manually go through code? by time see message box late, exception caught , handled. have catch when exception raised. not easy @ design time. one technique that's worth shot use debugger debug visual studio itself. start again , use tools + attach process. locate first devenv.exe in list of processes , select it. set attach to: setting "managed (v4.5, v4.0)" , click ok. let trundle find pdbs (takes while). debug + exceptions, tick thrown checkbox clr exceptions. switch original instance of vs , whatever did before trigger error. 2nd instance break in when exception thrown. luck you'll see code on call stack window.

java - Increase a char value by one -

i have app edittext , button named "forward". want when type "a" in edittext , click button, word "b" typed in edittext , "c" if pressed again , on. have tried: value = edt.gettext(); edt.settext(value + 1); but of course print initial string followed number "1". ideas? lot tested , works all letters can represented ascii values. if cast letters int , add 1, , cast char , letter increase 1 ascii value (the next letter). for example: 'a' 97 'b' 98 so if input 'a' , casted int , 97 . add 1 , 98 , , cast char again , 'b' . here example of casting: system.out.println( (int)('a') ); // 97 system.out.println( (int)('b') ); // 98 system.out.println( (char)(97) ); // system.out.println( (char)(98) ); // b so, final code might this: // first char in input string char value = et.gettext().tostring().charat(0); int nextvalue = (int)value + 1; // find int

xaml - LongListSelector Turnstile effect isn't working -

i have added wp-toolkit project, pages' animation , lls tilt effect working, not turnstile effect. instead of animating each list items separately, animates whole page @ same time. xaml: <phone:phoneapplicationpage x:class="szegedimenetrend.v2.v2megallo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone.controls.toolkit" mc:ignorable="d" d:datacontext="{d:designdata v2.xaml}" fontfamily="{staticresource phonefontfamilynormal}" fontsiz

numpy - I get neither output, nor an error using np.linalg.pinv -

i have tried , worked fine: phi = np.zeros((len(traindata),3)) phi[:,0] = 1 phi[:,1] = traindata[:,0] phi[:,2] = traindata[:,1] wml = np.dot(np.dot((np.linalg.pinv(np.dot((phi.t),phi))),(phi.t)), y_train) print wml, "weight selection" [[ -1.08778441e+01] [ -3.61672723e-02] [ -4.38518378e-03]] weight selection but when try same more columns following: phi = np.zeros((len(traindata),5)) phi[:,0] = 1 phi[:,1] = traindata[:,0] phi[:,2] = traindata[:,1] phi[:,3] = traindata[:,2] phi[:,4] = traindata[:,3] wml = np.dot(np.dot((np.linalg.pinv(np.dot((phi.t),phi))),(phi.t)), y_train) print wml, "weight selection" i did not obtain result or error. missing or doing wrong? have tried different datasets , different sizes , seems works fine until 3 columns 4 columns nothing shows up. thank in advance!

osx - Android Studio "No tests were found" -

Image
has been able tests run in android studio (from gui , not terminal), have been unable run tests gui. everytime try run tests through gui following message: i able run tests terminal using following command: ./gradlew connectedandroidtest i running android studio 0.5.2 gradle 1.11 plugin 0.9.0 on mac osx my project structure follows; myproject/ src/ androidtest/ java/ com.myproject.app.test/ … (tests source code) … main/ java/ com.myproject.app/ … (source code) … res/ … (resources code) … build.gradle my build.gradle file looks similar following: … android { compilesdkversion 19 buildtoolsversion "19.0.1" defaultconfig { versioncode 12 versionname "2.0" minsdkversion 9 targetsdkversion 19 testpackagename "com.test.foo" testinstrumentationrunner "and

node.js - NodeJS uploading Object to S3 using IAM Roles -

folks, trying nodejs upload s3 object. trying use iam roles instead of hard-coding creds. i've created bucket policies link instance launched via role, there should no issues.... code: function uploadtos3 (callback) { var newfile = '/dev/shm/uploads/'+req.query.mid; var s3 = new aws.s3(); var params = { acl: 'public-read', bucket: 'foobucket', key: req.query.mid } s3.putobject(params, function (err, data) { if (err) { console.log(err, err.stack); callback(err); } else { callback(); } }) }, anything potentially missing? user error, had incorrect arn in s3 bucket policy.

wso2 - Exchange SAML Token for OAuth Token, -

Image
i trying exchange saml token oauth token, i using code thing, defaultbootstrap.bootstrap(); string responsemessage = (string) request.getparameter("samlresponse"); byte[] decoded = base64.decode(responsemessage); bytearrayinputstream = new bytearrayinputstream(decoded); documentbuilderfactory documentbuilderfactory = documentbuilderfactory.newinstance(); documentbuilderfactory.setnamespaceaware(true); documentbuilder docbuilder = documentbuilderfactory.newdocumentbuilder(); document document = docbuilder.parse(is); element element = document.getdocumentelement(); unmarshallerfactory unmarshallerfactory = configuration.getunmarshallerfactory(); unmarshaller unmarshaller = unmarshallerfactory.getunmarshaller(element); xmlobject responsexmlobj = unmarshaller.unmarshall(element); response responseobj = (response) responsexmlobj; // saml2 assertion part res

java - Automated testing using selenium with firefox browser -

i downloaded code below , used tests , u=it ran yesterday since today code stopped working. tests failing not happening before. throws error saying org.openqa.selenium.elementnotvisibleexception: element not visible cannot interact element. package org.openqa.selenium.example; //import org.openqa.selenium.browserlaunchers.locators.googlechromelocator; //import java.util.regex.pattern; import java.util.concurrent.timeunit; import org.junit.*; import static org.junit.assert.*; //import org.openqa.selenium.*; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; //import org.openqa.selenium.chrome.*; import org.openqa.selenium.firefox.*; import org.openqa.selenium.firefox.firefoxdriver; //import org.openqa.selenium.support.ui.select; //import org.openqa.selenium.net.urlchecker; import static org.junit.assert.assertequals; import org.junit.test; public class kongaurltest { private webdriver driver; private s

javascript - Dynamic segments with default routes in Iron Router? -

in meteor, using iron-router, i'm trying implement route mapping has dynamic segment , fallback route if dynamic segment not match items in collection. example, have url so: http://foobar.com/harold i first check if harold matches ids in posts collection. if there match should take me postpage template. if there no matches, router should render harold matches items. i've searched through iron-router documentation, can't seem figure out right approach. wonder if there this.next() cancels current route mapping , goes next route mapping. here's attempt try it: router.map(function () { this.route('postpage', { // matches: '/mfls6akqqrz2jgz9q' // matches: '/81zbqge85aafjk1js' path: '/:postid', before: function () { //check if segment matches post id post = posts.findone(this.params.postid); if (!post) { //if no matches, go next route //something this.next()? } },

sql - mysql select after where -

i have sql: select count(*) table_a a, table_b b a.something=0 , b.active=1 , (select c.avg(rating) table_rating c c.id=a.id)>=$rating this part doesn't seem work and (select c.avg(rating) table_rating c c.id=a.id)>=$rating how can fix it? edit: problem here select c.avg(rating) should select avg(rating) try this select count(*) table_a a, table_b b a.something=0 , b.active=1 , ( select avg(c.rating) table_rating c c.id=a.id ) >= $rating

java - LWJGL BufferedImage White Picture -

i have problem loading image , rendering lwjgl. here code loading: bufferedimage image = imageio.read(file); int[] pixels = new int[image.getwidth() * image.getheight()]; image.getrgb(0, 0, image.getwidth(), image.getheight(), pixels, 0, image.getwidth()); bytebuffer buffer = bufferutils.createbytebuffer(image.getwidth() * image.getheight() * 3); for(int y = 0; y < image.getheight(); y++){ for(int x = 0; x < image.getwidth(); x++){ int pixel = pixels[y * image.getwidth() + x]; buffer.put((byte) ((pixel >> 16) & 0xff)); // red component buffer.put((byte) ((pixel >> 8) & 0xff)); // green component buffer.put((byte) (pixel & 0xff)); // blue component byte red = (byte)((pixel >> 16) & 0xff); byte green = (byte)((pixel >> 8) & 0xff); byte blue = (byte)(pixel >> 8 & 0xff); system.out.println("pixel " + x + "x" + y

VHDL - why do we need to declare signals for processes? -

just revisiting vhdl , wondering inside processes example, why need declare signal clock example? later on in code assign port entity... example vhdl: signal clk_int: std_logic := '1'; begin clkgen: process(clk_int) begin clk_int <= not clk_int after 50ns end process ckgen ck_l <= clk_int; in example ck_l physcial port d flip flop yet create , mess around clk int return value ck the reason port ck_l in case declared direction out , cannot read from. if want read it, need if want have process sensitive it, need use signal or declare port inout or buffer .

java - Are you able to call 3 for loops in a specific order? -

at moment have 3 loops, possible call them 1 time instead of 3? problem lies in fact loop 1 has finished before loop 2 can work, , loop 2 has finished before loop 3 can run. @ moment it's this. public void handling() { (object object : code.objects) { handle_one(object); } (object object : code.objects) { handle_two(object); } (object object : code.objects) { handle_three(object); } } if try doesn't work because being called @ same time , has ordered. public void handling() { //code doesn't work... (object object : code.objects) { handle_one(object); handle_two(object); handle_three(object); } } is there way around this, way fix it? have been trying while , nothing...having 3 loops bad in situation , causing problems. (and sadly way can working) edit: reason bad in case because loop can reach 300 sometimes. (as code.objects, represents how many connections there are, 100, meaning i

c# - Complexity limits of Linq queries -

i'm big fan of linq, , have been enjoying power of expression trees etc. have found whenever try clever queries, hit kind of limitation in framework: while query can take short time run on database (as shown performance analyzer), results take ages materialize. when happens know i've been fancy, , start breaking query smaller, bite sized chunks - have solution that, though might not optimal. but i'd understand: what pushes linq framework on edge in terms of materializing query results? where can read mechanism of materializing query results? is there measurable complexity limit linq queries should avoided? what design patterns known cause problem, , patterns can remedy it? edit: requested in comments, here's example of query measured run on sql server in few seconds, took 2 minutes materialize. i'm not going try explaining stuff in context; it's here can view constructs , see example of i'm talking about: expression<func<staff, te

javascript - div overlay disables google maps function -

i'm making website want show search results on top af googlemaps. want make possible scroll through these search results when cursor on search results or when cursor on map. implemented fine making div-structure this: <div class="map" id="parent" > <div id="googlemap"></div> <div id="mapcontainer"> <div id="searchcontainer"> <!-- searchresults --> </div> </div> </div> i disabled scroll-functionality in googlemaps. still drag map, isn't possible because of div laying on it. how solve this? my work visible here: http://www.veylau.be/testzone/wcb/searchtwee.html (click searchbutton better view) there still positioning problems, don't mind them, they'll solved after problem. thanks in advance helping me out! appreciate this! to allow interaction map, need uncover portions of map being covered search portion. if change padding

javascript - protractor howto test last item'class on a list -

in application have list of items, can add new item it,i can check list got new item, test if new item has class 'nuovo', test case: it("should add item address list class 'nuovo'",function(){ ptor.findelements(protractor.by.repeater('a in customer.lives_in')).then(function(arr) { expect(arr.length).toequal(2); var initial_length = arr.length; // set values new address ptor.findelement(protractor.by.model('street')).sendkeys('via'); ptor.findelement(protractor.by.model('city')).sendkeys('g'); ptor.findelement(protractor.by.model('number')).sendkeys('xx'); ptor.findelement(protractor.by.model('use')).sendkeys('n'); element(by.id('addaddressbutton')).click(); //check 1 address more ptor.findelements(protractor.by.repeater('a in customer.lives_in')).then(function(arr) { expect(

javascript - How to hide a tab from a tabpanel when it gives the output through a php foreach -

i using joomla latest version integrated particular component. there can add custom tab fields. inserted custom fields shows below mentioned while standard custom fields named such "tab-1", "tab-2". <?php foreach($tabsgroup $t): ?> <li rel="<?=$t->getelementvalue('alias')?>"> <a class="jd-tab-text"><?=$t->getelementvalue('name')?></a> </li> <?php endforeach; ?> i have inserted 4 custom fields , need hide 1 tab according user packages. please advice on this. thank you

java - Sorting class fileds while conversion it to json using Gson -

i create class json representation: class myclass { public long a; public string c; public string b; @override public tostring(){ return new gsonbuilder().create().tojson(this) } } i use it: myclass c = new myclass(); c.a = 10; c.b = "b"; c.c = "c"; string json = c.tostring(); i have json next: {"c":"c","b":"b", "a":10} but want have: {"a":10, "b":"b", "c":"c"} how can sort field in json? (using gson or other methods) in real project have more complex structure inheritance , lists of other objects.

sql - How to check the file path exists in sybase? -

how check filename exists in sybase sql anywhere11 , return error message if not in sql anywhere11 ? i have textbox , submit button in front end. user can enter file path textbox , click submit . the submit button call procedure , want check in beginning of procedure weather file exists or not , return value if not exists. example: d:/hello/world.csv path name. so need check d:/hello valid path , world.csv exist in specified path. thanks

iTextSharp - How to extract PDF pages with various columns -

can provide code snippet lets open pdf file , read page starts 1 column , change 2 columns? for example (the lines can vary): page 1 - line 1 10 - 1 column - line 11 end- 2 columns each page can vary number of columns. ps: know width of each column (if necessary). thank you,

objective c - Library not found for lAddThis -

i have added test flight 3.0.0 sdk . type of error coming. ld: warning: directory not found option '-l"/users/hsa1/desktop/debtorsproject 2 20 mar 2014 backup copy/addthis"' ld: warning: directory not found option '-f"/users/hsa1/desktop/debtorsproject 2 20 mar 2014 backup copy/../../documents/facebooksdk"' ld: warning: directory not found option '-f"/users/hsa1/desktop/debtorsproject 2 20 mar 2014 backup copy/addthis/thirdpartylibs/fbconnect/facebooksdk"' ld: library not found -laddthis clang: error: linker command failed exit code 1 (use -v see invocation) what shall this?

core animation - Why does order of transforms matter in Xcode? -

these 2 sequences give 2 different results in image layer transform applied to. don't seem reason why... can give explanation this? /* first sequence of transformation */ cgaffinetransform transform = cgaffinetransformidentity; transform = cgaffinetransformrotate(transform, m_pi / 180 * 30); transform = cgaffinetransformtranslate(transform, 100, 0); /* second sequence of transformation */ cgaffinetransform transform = cgaffinetransformidentity; transform = cgaffinetransformtranslate(transform, 100, 0); transform = cgaffinetransformrotate(transform, m_pi / 180 * 30); short (technical) answer: because transform matrix , when concatenate 2 transforms, 2 matrices multiplied. matrix multiplication isn't commutative , meaning 𝐀⨉𝐁 (a b) not same 𝐁⨉𝐀 (b a). in other words, order matters. i have written combining translations , rotations , the math behind transforms (i.e. matrix mathematics). these 2 can resources if want learn more how transforms work. there n

html - MySQL INSERT not inserting expected value using PHP -

i trying saved image server, have on code using php , mysql..i got error image location not appear on db following appears on table location: ''photos/" not save image name. how can ? here code : // uploading image file , store specific folder & save location db $image= addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name= addslashes($_files['image']['name']); move_uploaded_file($_files["image"]["tmp_name"],"photos/" . $_files["image"]["name"]); $location="photos/" . $_files["image"]["name"]; //storing path db $save=mysql_query("insert photos (location) values ('$location')"); your error handling bad. use following code instead; foreach ($_files["image"]["error"] $key => $error) { if ($error == upload_err_ok) { $tmp_name = $_files["image"]["tmp_name&

java - Android application fetch data from SQLite -

i new android programming , trying fetch data sqlite , display in list view. getting , displaying data datahandler handler=new datahandler (getbasecontext()); handler.open(); cursor c=handler.returndata_schedule(); list<scheduledata> arr=new arraylist<scheduledata>(); if(c.movetofirst()){ do{ string date=c.getstring(0); string time=c.getstring(1); string food=c.getstring(2); scheduledata mydata=new scheduledata(date,time,food); arr.add(mydata); }while(c.movetonext()); } scheduleadapter myadapter=new scheduleadapter(this,r.layout.schedule_list,arr); listview listview=(listview)findviewbyid(r.id.listview1); listview.setadapter(myadapter); this fetch function. public cursor returndata_schedule() { return db.query(table_schedule,new string[] {date,time,food},null,null,null,null,null); } this adapter class public class scheduleadapter extends arrayadapter<scheduledata> { contex

c# - Is there any open source wrapper around UnityEngine.GL namespace that would provide System.Drawing.Graphics alike intereface? -

i love see system.drawing.graphics methods drawpath(pen, path) , translatetransform(dx, dy, order) , scaletransform(sx, sy, order) wrapped around unityengine.gl (or @ least other opengl library create own port). there such wrapper/library? assuming want draw on texture use in unity, here simpliest example using cairo build bitmap directely usable texturing opengl. wrapper mono.cairo using system; using cairo; namespace cairotests { class program { static void main(string[] args) { int height = 512; int width = 512; int stride = 4 * width; int bmpsize = stride * height; byte[] bmp = new byte[bmpsize]; using (imagesurface surf = new imagesurface(bmp, format.argb32, width, height, stride)) { using (context ctx = new context(surf)) { ctx.setsourcergb(1, 0, 0); c

snmp - LLDP In wirelss port -

currently designing layer 2 topology discovery application. lldp protocol helps me discover layer 2 neighbor devices. far have observed lldp available in layer 2 device lan ports wirless port not provides lldp information. as per lldp, if more neighbor device connected same port (i.e of hub ) on local device, may not give neighbor information. may not suitable wireless device, because wlan ap device connects many more client on same port. also, wlan ap provides connected client information on private mibs , wlan client device says current wlan ap. sufficient know neighbor device , no need of lldp in wlan port. please me know, assumption correct? , there wireless port provides lldp information?

java - displaying portlet in another portlet without popup -

is there way in display 1 portlet in other portlet ? problem facing have 2 portlets in liferay,i want's display complete second portlet in reserved div area of first portlet,so can use functionality of second portlet in first one(i don't want use popup particular scenario). or in other words wants nested portlet have google didn't find helping material ,now question scenario possible in liferay? helping appreciated. hi use nested portlet. emded portlet example or use web content display portlet inside can display portlet or can use liferay portlet sharing java script code.. i have small following snippet render portlet in div wont peforn actions because static content the following example snippet load portlet in div aui().use('aui-base','aui-node','aui-dialog','aui-io-request', 'aui-io','liferay-portlet-url','aui-dialog-iframe', function(a) { var url =liferay.portleturl.createrenderurl();

Blurred 1dip shape lines (borders) on Android -

Image
here screenshot app: it's taken samsung galaxy note 10.1 ( mdpi 149 ppi ). my client thinks border line around bottom buttons , rounded rectangle above blurred. i'm using shape background looks this: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="8dp" /> <stroke android:width="1dp" android:color="@color/dark_gray" /> <solid android:color="@color/sepia_bright" /> </shape> when use simple view line 1dp height this: <view android:background="@color/bright_gray" android:layout_width="match_parent" android:layout_height="1dp" /> it's sharp can see on next screenshot: simple horizontal lines ok, rectangle around graph blurred again. what doing wrong? thanks help. my first guess problem bi-linear filtrati

android - EveryPlay causing a major Frame Rate dip for our game, has anyone else experienced this? -

hello in app studio developing planning on using everyplay record , share videos amongst our users . ran major optimization pass removed shader giving performance headaches. when had shader game running @ 40 fps , when recorded everyplay recall frame rate remaining stable . yet removed shader , running @ 60 fps recording everyplay dropping our frame rate 60 fps 20 , once stop everyplay recording frame rate rises again 50 -60 fps . has else had similar experience or know how solve issue ? right experimenting everyplay on android know still young sdk , sent message everyplay support e-mail . especially android version still has plenty of room improvements , there's been few releases fine-tuning , optimizing issues. most times performance differences between devices due different gpu vendors, mali/adreno working pretty already. nvidia's tegra, there's still bunch of gpu specific optimizations under development should work ok simpler games update

Proper way to crop an SVG? -

Image
i'm totally baffled svg images. want crop image core content. want crop specifying viewbox and/or viewport and/or else except not want change of points in polyline elements. image as-is renders this. (note border illustration purposes. border not part of svg.) and want crop looks this. (note border again illustration purposes only) given svg xml how crop it? <?xml version="1.0" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" > <polyline points="39,340 42,338 47,333 54,322 68,308 83,292 91,277 100,259 106" style="fill:none;stroke:black;stroke-width:3"/> <polyline points="71,299 82,303 95,304 109,302 120,301" style="fill:none;stroke:black;stroke-width:3"/> <polyline points="212,275 228,254 233,233 240,208 239,246 188,278 174,306 158,334 149,351 144,358 140,362 139,362 139,340 179,313 186" styl