Posts

Showing posts from March, 2015

Eclipse: Can I Dock The "Open Resource" Dialog? -

i'm using eclipse 3.7.2 ( comes , integrated weblogic 11g ) is possible dock "open resource" dialog box ( ctrl + shift + r )? i'm migrating on ide. i'm used to/am looking "open resource" dialog being docked on left side, can type name of file it..........without having go menu or opening dialog box. is there such thing in eclipse? if not, there plugin similar? thanks steve that's not possible. generally, if can invoke functionality via keyboard shortcut from everywhere , there no benefit in having alternative implementation consumes screen space , view must focused first run same command. other alternatives "navigate" main menu, or toolbar, can place button functionality (using "customize perspective" menu).

canvas - Why are images being drawn in the wrong place? -

the following code attempts draw image button selected in toolbar canvas @ mouse position. based on printed coordinates position correctly calculated, images placed in wrong place. code: import 'dart:html'; class test { imageelement toolbar_selected_element = null; canvaselement canvas; num mousex = null, mousey = null; void main() { canvas = query("#canvas"); canvas.onclick.listen(canvas_onclick); (var toolbutton in queryall('.toolbutton')) { toolbutton.onclick.listen((e) => toolbar_selected_element = query("#${e.target.id}")); } } void canvas_onclick(mouseevent event) { num x,y; var clientboundingrect = canvas.getboundingclientrect(); mousex = event.clientx - clientboundingrect.left; mousey = event.clienty - clientboundingrect.top; window.requestanimationframe(draw); } void draw(num _) { canvasrenderingcontext2d context = canvas.context2d; context.clearrect(0, 0, canvas

How to ensure a kdb partitioned table data is not duplicated? -

i created partitioned db gets data daily stored files. works fine i'm worried kdb add duplicate rows if run partition script twice same day files. should use 'key' check existence of partitioned tables or there simpler way insure kdb not duplicate stored data? i'm not sure if issue 1) you're afraid you'll load same file more once, or 2) multiple files may contain same data, don't want subsequent loads create duplicates. for 1), if daily stored files use create db not updated , have unique names, possibly track files have been loaded , skip these on subsequent runs. 2) though cannot physically key table, have "key" columns, e.g. sym, date, time, side etc. can check if "key" values of chunk loading appear in date partition. if do, drop records, while keeping others.

kml - gx:Track icon quickly appears then disappears at the origin when timeline is up. Is there a way to fix this? -

i have researched exhaustively , still haven't found solution. when have multiple tracks (cars on roads) in google earth, when track ends icon appear disappear (flash) @ origin location. gets very distracting when have hundreds of tracks displayed @ same time. attaching example kmz, notice once track completes icon flashes @ origin. does know how solve issue icon not flash @ origin when track complete? thanks can offer, driving me crazy. sample kmz file showing problem: https://groups.google.com/group/kml-support-advanced/attach/5d1ba540ca564b13/googleearthpaths.kmz?part=4&authuser=0&view=1 this seems bug in google earth. i've tested out on lot of existing tracks use icons - , see same issue. had never noticed before. however, tested out on tracks had model elements defined, , don't see "flash" @ origin of track once track animation has completed. i'd recommend putting in bug report.

php explode text from mysql database into table -

i have text field in database new item, or subject separated using "-" i have exploded text , made appear in table each item, or subject displayed in new row. the problem have want able code no matter how many items in text field script echo number of rows - blank cells echoed.. for example there text field is: "- hello - - name - - something" fill top 5 rows, leaving others displaying blank. thanks in advance! echo "<table border=1 cellpadding=5 width=60% style='border-collapse:collapse; height:auto; font-size:small; float:left;'> <tr> <th style='background-color:#ffffcc';>this weeks objectives</th> </tr>"; // split data use of "-" seperate rows while ($row3 = mysql_fetch_assoc($objective)) { $str = $row3['objectives']; $splitstr = explode('-', $str);

c# - ODBC connection to MS Access database with SQLServer linked tables via DSN -

Image
so have msaccess database couple linked tables point sql server database via dsn username , password built in. in .net app need connect access database, , run queries on linked tables. have tried oledb , odbc methods, neither seem work linked tables point sql server, linked tables pointing other access tables fine. error such as: odbc--- connection 'thisdsn' failed. is there way connect access database can run queries , doesn't matter if linked table sql server or access table? what describe can done, need check of details in setup. i have following access database local table [expenses] , linked table [dbo_accountcodes] i have saved query named [expensedetails] pulls data [expenses] , uses join retrieve related [accountdescription]: select expenses.*, dbo_accountcodes.accountdescription expenses inner join dbo_accountcodes on expenses.accountid = dbo_accountcodes.accountid; i can run saved access query c# application using normal oledb method

intel - TBB concurrent_queue errors -

can't seem compile program mention of concurrent_queue. code contains this #include <tbb/concurrent_queue.h> and second add anywhere in code concurrent_queue<int> tbbqueue; this error on compile. able compile other tbb related code using tasks etc, reason not working. g++ -o3 -wall -pthread -std=c++11 -ltbb -o tbbqueue.o tbbqueue.cpp tbbqueue.cpp: in function ‘void* agent(void*)’: tbbqueue.cpp:46:10: warning: unused variable ‘elements’ [-wunused-variable] tbbqueue.cpp:47:9: warning: unused variable ‘elementssize’ [-wunused-variable] /tmp/ccqg8okz.o: in function `tbb::strict_ppl::internal::concurrent_queue_base_v3<int>::~concurrent_queue_base_v3()': tbbqueue.cpp:(.text._zn3tbb10strict_ppl8internal24concurrent_queue_base_v3iied2ev[_zn3tbb10strict_ppl8internal24concurrent_queue_base_v3iied5ev]+0x10): undefined reference `tbb::internal::nfs_free(void*)' /tmp/ccqg8okz.o: in function `tbb::strict_ppl::concurrent_queue<int, tbb::cache_alig

c# - Search for an Array or List in a List -

have list<byte> lbyte have byte[] searchbytes how can search lbyte not single byte index of searchbytes? e.g. int32 index = lbyte.firstindexof(searchbytes); here brute force came with. not performance looking for. public static int32 listindexofarray(list<byte> lb, byte[] sbs) { if (sbs == null) return -1; if (sbs.length == 0) return -1; if (sbs.length > 8) return -1; if (sbs.length == 1) return lb.firstordefault(x => x == sbs[0]); int32 sbslen = sbs.length; int32 sbscurmatch = 0; (int = 0; < lb.count; i++) { if (lb[i] == sbs[sbscurmatch]) { sbscurmatch++; if (sbscurmatch == sbslen) { //int index = lb.findindex(e => sbs.all(f => f.equals(e))); // fails find match indexofarray = - sbslen + 1; return; } } else { sbscurmatch = 0; } } return -

css - Add rule to SourceCookifier plugin for notepad++ -

Image
i trying add rule in sourcecookifier css language. currently shows tree list of classes selectors identities but want add own rule, i add comments, like: /* start reset */ -- css rules here /* end reset */ /* start sidebar */ -- css rules here /* end sidebar */ and want show own function tree called section thanks fro help i'm not confident understand question, here believe you're looking for. bring language settings css , add new tag type. set description "section" (or whatever like). for input, use: /* start (\w+) for output, use: \1 if apply rule file contains sample code provided, create sections called "reset" , "sidebar." effect you're trying achieve?

c# - Can I access properties of a ListViewItem.Tag rather than just the "ToString" method? -

be patient, not sure how best ask 1 ... i have listview control on windows form , add items names of text files in directory. each of files loaded object "resultfile" , assigned many properties based on text within - "string type", "int numberoflines", "bool isgeneric" etc. a user can select/deselect freely make decisions based on text file type have selected already. rough idea, if have selected 1 "type=="x1" don't want them able select one. if select 2 or more isgeneric==true, want give them warning ... i started extending listviewitem this public class mylistviewitem : listviewitem { public string type { get; set; } public int numberoflines { get; set; } public bool isgeneric { get; set; } public mylistviewitem(string s) : base(s) { } } i happy first time i've extended control (yes, i'm new this) ... allows me add own types of "listviewitems" , can access prope

android holo everywhere - HoloEverywhere AutoCompleteTextView java.lang.ClassCastException -

i trying holoeverywhere class autocompletetextview work app. main reason want holo theme work on pre 3.0 devices (specifically api levels 8-10) here main activity code: package com.example.testautocomp; import org.holoeverywhere.widget.autocompletetextview; import android.app.activity; import android.os.bundle; import android.widget.arrayadapter; public class mainactivity extends activity { private autocompletetextview m_edit; private static final string[] items = { "lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "morbi", "vel", "augue", "purus", "sitter", "sitting", "sither", "sithar" }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); m_edit = (autocompletete

windows - c++ cli comparing hexadecimal bytes from a file not working -

i have file called ab.exe contains in hexadecimal 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bbaae8cafdffff83c408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054aae8cafdffff83c40800000000000000000000000000000000000000000000000000000000000000000000000000aae8cafdffff83c4088d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 i have code in c++ suppose detect if string of hexadecimal in file or not , if add list box. array<byte>^ target1 = { 0xaa,0xe8,0xca,0xfd,0xff,0xff,0x83,0xc4,0x08,0x8d }; array<byte>^ target2 = { 0x54,0xaa,0xe8,0xca,0xfd,0xff,0

declaration - Verilog - individual output arrays -

this first time on stackoverflow.com , new verilog coding. may use terms incorrectly if please correct me can clearer in future posts. i using altera fpga board there 7 ledg lights can triggered on , off. project making bcd adder ledg [7] turns on when bcd value not 0 - 9. however, don't want declare outputs [6:4]. ledg[3:0] displays binary equivalent of summation of 2 inputs. i thought use 2 separate declaration statements tells me ledg declared is. tried combine using brackets complained that. there way simplify code. below examples of i've tried. example 1: module bcd (..., ledg, ...); output reg [3:0] ledg; output reg [7] ledg; endmodule example 2: module bcd (..., ledg, ...); output reg ({[3:0], [7]} ledg); endmodule any appreciated! in advance. :-) what you're trying not possible, if you're going output bus must specify single contiguous range. you should declare output reg [7:0] if need output [7] , [3:0]. you can leave u

r - "guides", "colourbar" and "keyheight" in ggplot2 -

using ggplot2 made barplot in each bars filled gradient. problem concerns legend of plot. bar filled same colour gradient: scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), "colourbar") when wanted change height of legend bar tried instead: scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), guides("colourbar", guide_legend(keyheight = 2)) but nothing changed. , when precise height of bar without colour gradient, height correct. scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), guide = guide_legend(keyheight = 2)) what did wrong when mentioning both "colourbar" , "height" in "guides"?

json - ios: Compare NSString to "<null>" not working -

i consuming web service returns json . 1 of values "< null >" . when run follwoing code if statment still executed when not suppposed to. any reason why? nsdictionary *location = [dictionary valueforkey:@"geolocation"]; //get product name nsstring *latitude = [location valueforkey:@"latitude"]; nslog(@"%@", latitude); nsstring *longitude = [location valueforkey:@"longitude"]; if (![latitude isequal: @"<null>"] && ![longitude isequal: @"<null>"]) { nslog(@"%d", i); cllocationcoordinate2d coordinate; coordinate.longitude = [latitude doublevalue]; coordinate.longitude = [longitude doublevalue]; [self buildmarketslist:coordinate title:title subtitle:nil]; //build browse list product } i consuming web service returns json. 1 of values "< null >" aha. 2 possibilities: i. json doesn't contain latitude , longitud

string - C - Passing multiple pointers as parameters to pthread_create -

i new c , these concepts of pointers extremely confusing me. trying seems simple, getting lot of compilation errors. i want spawn new thread , pass multiple pointers parameters (seems way can use global variables in c through pointers), created struct hold these pointers, wont seem compile no matter change. here code (i took out of code, except problem seems be) //want store pointers in pointers, when change pointer changes "global" variable void request_handler(params *parameters) { params parameter = *parameters; int *numberofotherservers = parameter.numberofservers; int *clientsock = parameter.clientsock; char ***serverlist = parameters.serverlist; struct function **functionlist[10] = parameters.functionlist[10]; } typedef struct { int *clientsock; int *numberofservers; char **serverlist; struct function *functionlist[10]; } params; struct function { char name[20]; int parameternumer; int cando; char *otherse

c# - WPF multiple checkbox check/uncheck -

i have 4 checkboxes 1 check , other 3 subcheckboxes. wanted check 3 subcheckboxes when check check , when deselect 1 check box main checkbox check unchecked only. <window x:class="checkboxwpf.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid name="grdone"> <checkbox content="check" checked="checkbox1_checked" unchecked="checkbox1_unchecked" height="16" horizontalalignment="left" margin="39,23,0,0" name="checkbox1" verticalalignment="top"> </checkbox> <checkbox content="one" unchecked="checkbox2_u

objective c - Unable to force device to change UIOrientation -

i have vc modally adds image picker controller, , goes same vc when pic selected. after obtain image via pickercontroller, add image screen, , want device automatically change landscape if pic landscape, , portrait if pic portrait. i have unsuccessfully tried both of these approaches force device landscape 1. [[uiapplication sharedapplication] setstatusbarorientation:uiinterfaceorientationlandscapeleft]; 2. [uiviewcontroller attemptrotationtodeviceorientation]; -(nsuinteger)supportedinterfaceorientations { if (!isportrait) //isportrait false when pic landscape return uiinterfaceorientationmasklandscape; } alternatively, i'm wondering if it's best instantiate separate vc picture. i've avoided far after question my guess have call [[uiapplication sharedapplication] setstatusbarorientation: inside viewwillappear: method of viewcontroller presenting uiimagepickercontroller . for need know first image orientation, can this: - (bool)shoulda

android - Use ImageView with a GridView to set number of images displayed in the rows and columns -

Image
i want layout 8x8 grid of images, 40x40px icons, within gridview layout using imageview class. i have tried playing around setlayoutparams , setscaletype methods of imageview class have not been able achieve desired affect. here have, experimenting 3x3 grid of small icons until hang of it. main acitvity: package com.topherwilso.ropasci; import android.os.bundle; import android.app.activity; import android.view.menu; import android.widget.gridview; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); gridview gv = (gridview) findviewbyid(r.id.gridview); gv.setadapter(new imageadapter(getapplicationcontext())); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); ret

c# - Unknown Database Connector Error -

i have problem in server computer when click button show report(crystal) this error have been shown: unknown database connector error error in file list_vagozari_ensheab_ab {6b911dd4-2b53-4005-9372-522c74b17ad0}.rpt: unknown database connector error when right click in database fields--->database expert... , click on oledb(ado) following error has been appears : unknown database connector errore. , cant create or see connections... thanks. crystal report files fill datatable rows , must adjust connection properties on connection object. checking steps : 1- application connect server ( if not check server , client options such firewalls , antivirus , dbms server , connetion string , ... ) 2- commanad server fine ( syntax , result) please determine programming language

Django haystack with elasticsearch, indexing issue -

im using django-haystack elasticsearch there problem indexing. when rebuilding index python manage.py rebuild_index following error raised: traceback (most recent call last): file "/home/palo/.virtualenvs/toro/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 210, in handle_label self.update_backend(label, using) file "/home/palo/.virtualenvs/toro/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 256, in update_backend do_update(backend, index, qs, start, end, total, self.verbosity) file "/home/palo/.virtualenvs/toro/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 78, in do_update backend.update(index, current_qs) file "/home/palo/.virtualenvs/toro/local/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 177, in update self.conn.bulk_index(self.index_name, 'modelresult',

hibernate - Could not determine type for: java.util.List -

i'm rather new hibernate , turns out it's not simple technology learn... in project use hibernate version 4.2.0.cr1. i'm trying create base class database entities, supposed contain identifier , date of creation. weird @ first, crated class user , userpicture without base class , worked fine , added it, though it's supposed work before, doesn't o_o , keeps on throwing weird exception list of pictures, not thrown before... keep on getting following stacktrace: org.hibernate.mappingexception: not determine type for: java.util.list, @ table: user, columns: [org.hibernate.mapping.column(profilepicture)] @ org.hibernate.mapping.simplevalue.gettype(simplevalue.java:314) @ org.hibernate.mapping.simplevalue.isvalid(simplevalue.java:292) @ org.hibernate.mapping.property.isvalid(property.java:239) @ org.hibernate.mapping.persistentclass.validate(persistentclass.java:469) @ org.hibernate.mapping.unionsubclass.validate(unionsubclass.java:61) @ org.hibernate.cfg.configurat

c# - Combine gridview rows and eliminate duplicates -

i have 2 tables: table 1 id question customerid 1 bla1 1 2 bla2 2 table 2 id customerid key value 1 1 firstname john 2 1 lastname doe 3 2 firstname billy 4 2 lastname jones i need gridview show: row 1: john doe bla1 row 2: billy jones bla2 currently shows: (but dont want this): row 1: john bla1 row 2: doe bla1 row 3: billy bla2 row 4: jones bla2 i think have tried , use help! thanks. select [firstname],[lastname], question ( select a.question, b.[key], b.[value] table1 inner join table2 b on a.customerid = b.customerid ) org pivot ( max([value]) [key] in ([firstname],[lastname]) ) pvt sqlfiddle demo output ╔═══════════╦══════════╦══════════╗ ║ firstname ║ lastname ║ qu

php - Oauth header issue with twitter api 1.1 -

i've been trying access new twitter api (1.1) 3 days now, new oauth system , not compatible. want grab 3 of latest tweets (which public why need oauth on simple rss annoying) <?php $header = 'get /statuses/user_timeline.json?screen_name=name&count=3&include_rts=false http/1.1 host: https://www.twtter.com:443 authorization: oauth realm="https://https://www.twtter.com/statuses/user_timeline.json", oauth_consumer_key="key", oauth_token="mytoken", oauth_nonce="", oauth_timestamp="0", oauth_signature_method="hmac-sha1", oauth_version="1.0", oauth_signature="o4yjhqnylxmp5u97rj%2f4uuljh84%3d"'; $url = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=name&count=3&include_rts=false"; $options = array( curlopt_httpheader => $header, curlopt_header => false, curlopt_url => $ur

c# - Video recording in portrait orientation is 90 degree rotated in windows phone 8 -

i using xaml in app record video , play .everything working fine except video coming in 90 degree rotated form. : <phone:phoneapplicationpage x:class="recoedvedio.mainpage" 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" mc:ignorable="d" fontfamily="{staticresource phonefontfamilynormal}" fontsize="{staticresource phonefontsizenormal}" foreground="{staticresource phoneforegroundbrush}" supportedorientations="portraitorlandscape" orientation="portrait"

c++ - Align text and change amount of spaces -

i'm trying format string, becouse have 2 strings 1 contain: "1" , second contain: "test" , want output whole string space as: 1 test i did saying: printf("%-10s %s", "1", "test"); but how change space " %-10s " without changing format? int amount_of_space = 10; like: printf("%-*s %s", "1", "test", amount_of_space) how do that??? in c or c++, please me out printf("%-*s %s", amount_of_space, "1", "test" ) ; the * comes first in format string - hence parameter amount_of_space has come first after comma. i.e in format string order *, s & s - after comma, need whatever fills in *, first string , 2nd string.

c# - FTP upload gives time out, but does upload the file -

i'm trying figure out element, have made ftp module several actions work perfectly, except upload method. in fact work, still returns error. so time out error after time, when check on ftp, file added succesfully. can't understand feature.. my code: public static boolean upload(string remotefile, string localfile, string applicatie_url) { boolean returnbool = false; try { ftpwebrequest ftprequest; ftpwebresponse ftpresponse = null; stream ftpstream = null; ftprequest = (ftpwebrequest)ftpwebrequest.create(host + "/" + remotefile); ftprequest.credentials = new networkcredential(user, pass); ftprequest.usebinary = true; ftprequest.usepassive = true; ftprequest.keepalive = true; ftprequest.method = webrequestmethods.ftp.uploadfile; // upload byte[] b = file.readallbytes(localfile); ftprequest.contentlength = b.le

sitecore - In xslt, select item with id, which value is in variable -

i have item id variable. , in apply template want select item id. how can it? i've tried this, doesn't work: <xsl:variable name="myid"> <xsl:value-of select="sc:fld('field',.,'id')"/> -//(this item id) </xsl:variable> <xsl:apply-templates mode="summary" select="sc:item('$myid',.)" /> thanks in advance. you should not enclose variable reference in quotes: <xsl:apply-templates mode="summary" select="sc:item($myid,.)" /> note can set value of variable directly this: <xsl:variable name="myid" select="sc:fld('target',.,'id')"/>

SQL Server Getting where an data object was based in a Period of Time given Track Info -

i have doubt on how conclude in sql server 2008 r2. i have table has inputs , inputs have parent tag , timestamp. sometimes these objects have parent tag changed in timestamp. parent tag can change time time. let´s suppose have table below. current table has millions of data different objectids. seeing table, easy see parentid changed in timestamps 3 4, 6 7 , 8 9. productid parentid dateid value -------- --------- ------- ------------- 100 1 1 325,2 100 1 2 326,2 100 1 3 329,6 100 2 4 335,2 100 2 5 336,5 100 2 6 338,3 100 3 7 339,2 100 3 8 342,1 100 1 9 343,7 100

javascript - AngularJS bootstrap popover with another directive Object [object Object] has no method 'popover' -

i have button trigger bootstrap popover. works fine except need popover have directive in (basically popover contains list of items). i have found article http://tech.pro/tutorial/1360/bootstrap-popover-using-angularjs-compile-service following doesn't seem work me well. i made custom directive .directive('popoverhtml', function ($compile) { return { restrict: 'a', transclude: true, template: "<span ng-transclude></span>", scope: { }, link: function (scope, element, attrs) { console.log($(element)); var options = { content: "<br><br>hey", placement: "right", html: true, title: "hey", trigger: "click" }; $(element).popover(options); } } and following html mark up <button type="butto

.net - DateTimeOffset resolution in c# and SQL Server -

docs state in both .net , sql server resolution 100ns. the time component of datetimeoffset value measured in 100-nanosecond units called ticks - c# accuracy - 100 nanoseconds - sql server however sql seems drop last digit (e.g. i'm trying save 2013-08-15 09:19:07.2459675 -04:00, , sql saves 2013-08-15 09:19:07.2459670 -04:00 - notice last digit changes.) this happens on same machine, not hardware dependent. not need resolution, makes comparing dates harder.. , i'm curious. i'll problem yours... little code show: namespace test { using system; using system.data; using system.data.sqlclient; using system.globalization; /// <summary> /// /// </summary> public class program { /// <summary> /// /// </summary> public static void main() { // change connection string specify server. // won't need initial catalog because

Implementing Active Record Caching in Laravel 4? -

any how can implement codeigniter active record caching ( http://ellislab.com/codeigniter/user-guide/database/active_record.html#caching ) in laravel 4? you cannot implement codeigniter caching in laravel 4 . but can implement laravel caching in laravel 4 . please see caching docs here . there specific docs caching queries here . in principle do $users = db::table('users')->remember(10)->get(); where 10 number of minutes cache result for.

java - split in android is not working good -

i have string "ok[separador]2272[dato]hospital issste 2 [dato]ok, realizado correctamente[fila]48612[dato]cfe yucalpeten[dato]ok, realizado correctamente[fila]48687[dato]impresos publicitarios[dato]ok, realizado correctamente[fila]" first step need have 2 string split [separador] need these 2 string: ok 2272[dato]hospital issste 2 [dato]ok, realizado correctamente[fila]48612[dato]cfe yucalpeten[dato]ok, realizado correctamente[fila]48687[dato]impresos publicitarios[dato]ok, realizado correctamente[fila] then in code have this: string[] arregloresultado=resultado.split("[separador]"); but array these values [", k[, , , , , , , , , ]2272[, , t, ]hospital issste 2 [, , t, ]ok, r, , liz, , , c, , , , ct, m, nt, [fil, ]48612[, , t, ]cfe yucalpeten[, , t, ]ok, r, , liz, , , c, , , , ct, m, nt, [fil, ]48687[, , t, ]impresos publicitarios[, , t, ]ok, r, , liz, , , c, , , , ct, m, nt, [fil, ]"] how can resu

caching - Django Filename Generation Issue -

i have django based media server accepts variety of video formats upload. while uploading large .wmv file, noticed strange behavior. first time uploaded video, took 5 minutes convert , upload. thereafter, sort of caching occurred, , video merely point 1 had uploaded. don't understand why happening. when video uploaded, file name extension checked conversion purposes, , ffmpeg command executed carry out conversion. run asynchronously, using django-celery rabbitmq message broker. don't see reason why ffmpeg conversion command not execute again. here code celery task handles upload. (this initial reasoning, @ edit correct error diagnosis) @celery.task def handlefileuploadasync(update, m, file_type, video_types): filename = m.file.name.replace(' ', '\\ ') if video_types[file_type] == 'wmv': os.system( "ffmpeg -i " + media_root + filename + " -strict experimental -vcodec libx264 -profile:v baseline " +

python - How to Resize and Position Buttons in PySide? -

i writing application using pyside , have added 2 buttons 2 it. however, when run program buttons scale length of window not want. want button of small size , positioned right. how do this? there method use? i don't know layout you've used or want use, maybe help: using box layout: #!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- import sys pyside import qtgui class sample(qtgui.qwidget): def __init__(self): super(sample, self).__init__() self.initui() def initui(self): self.setgeometry(300, 300, 800, 600) self.setwindowtitle('sample') btn1 = qtgui.qpushbutton("button 1") hbox = qtgui.qhboxlayout() hbox.addstretch(1) hbox.addwidget(btn1) self.setlayout(hbox) self.show() def main(): app = qtgui.qapplication(sys.argv) ex = sample() sys.exit(app.exec_()) if __name__ == '__main__': main()

Initializing function arguments in the global environment R -

i'm looking simple function speed ability write , debug r functions. consider following blocks of code: # part a: myfun = function(a, b = 5, out = "hello"){ if(a>b) print(out) return(a-b) } # part b: b = 5 out = "hello" # part c: do.args = function(f){ #intialize arguments of myfun in parent environment ??? } the function myfun trivial example of bigger problem: have complicated function many arguments. efficiently write , debug such function, find useful initialize arguments of function, , 'step through' function line-by-line. initializing arguments, in part b above, hassle, when there lots of arguments, , prefer have function in part c, takes string myfun arguments , produces same effect running part b in current environment. this works functions arguments defined. in other words, myfun has have value defined in function. some.func <- function(infunc){ forms <- formals(infunc) for(i in 1:l