Posts

delphi - Bypass function "out" parameters -

some functions need variable send out value. don't need value , don't want define variable use function out parameter. this: procedure test(out somevar: string); begin //... end; i want execute safely: test; you can create wrapper: procedure test(); overload; var somevar : string; begin test(somevar); end; note: you'll have mark other version overload , or can call wrapper other test , , remove overload . another option: declare dummy variable somewhere (at top of unit, maybe): var dummystr : string; then don't have declare new variable every time want call function. test(dummystr);

char - Returning wrong file pointer -

for reason when send argv gets sends wrong file pointer. example if send string argv of getty.txt sends shakes file pointer , if send genesis.txt char array sends getty.txt. how send right file pointer back? for (i = 3; < argc; i++) { printf("%s\n", argv[i]); pattern(determinefile(argv[i]), argv[2]); } file* determinefile(char* file) { if (strcmp(file,"getty.txt")) return getty; else if (strcmp(file, "shakes.txt")) return shakes; else if (strcmp(file, "genesis.txt")) return genesis; else return null; } input: grep getty.txt genesis.txt shakes.txt output: getty.txt shakes.txt: word's stage, shakes.txt: , men , women merely players. shakes.txt: have exits , entrances; genesis.txt getty.txt: 4 score , 7 years ago our fathers brought forth, upon this getty.txt: continent, new nation, conceived in liberty, , dedicated the shakes.txt...

ruby on rails - What does TRANSFER stand for in VPS spedifications? -

i planning deploy rails app on linode vps. vps specification has column named transfer. transfer: 5 tb. stand , , how relevant app? it means amount of data can downloaded (or transferred) vps. it's hard estimate how transfer might use entirely depends on kind of app you're serving , how many users have. i wouldn't worry unless you're serving large files such video, in case you'd want store elsewhere.

sql - How do I 'hardcode' a select field value when there is no join to the other table -

i have no idea if title makes sense, or if relates sql or tsql relatively new sql , come vba background, below 1 half of have (i amended it, bi package sql reader created basic select/from/where's.. , appears use rather join). if helps in understanding, use populate olap cube..so there 1 value being read , whole lot of associated field needed too. i've managed learn bit on here (hence why i'm thinking may tsql), i'm stuck one. i getting value *dbo.gl_acct_detail.db_amt_cc - dbo.gl_acct_detail.cr_amt_cc* , associated month (form accouting_period), org_code, acc_code , mkt_segment mkt_segment comes prj_phase table, 'joined' acct_detail table prj_code , phase_code. problem acct_code's there no prj_code or phase_code..they null..so there can no link prj_phase table , no mkt_segment. in situation want use hardcoded/default value in place of mkt_segment value (that can't obtained). tried using case when mkt_segment in select statement didn't wor...

sitecore6 - Sitecore index rebuild "job ended unexpectedly" -

in our sitecore project (6.6.0 rev. 130404), facing issue when trying rebuild large indexes using sitecore control panel. there index contains more 650,000 items. half-way through index rebuilding operation, process stops error "job ended unexpectedly" being displayed on index-rebuild dialog box. when analyzing sitecore logs, can't find recorded exceptions related this. because didn't know when index rebuild stopped, searched sitecore logs word "exception" couldn't find related this. we face same issue quicksearch index (even larger index our own) well. in logs, see "index rebuild job started" message nothing related being ended or interrupted. what can possible causes of this? , how can find evidence using sitecore logs? (ps. have sought indexing practices on post, haven't implemented suggestions): sitecore index rebuilding practices ) if have permission so: try eventlogs on server hosting solution on. also, see logs ...

android - Unable To Access library activity in another project -

i trying access library activity project(in tabhost , each tab call different activity.) throwing exception caused by: android.content.activitynotfoundexception: unable find explicit activity class {com.themontcalm.droid.activity/com.themontcalm.droid.lib.activity.reservationtab}; have declared activity in androidmanifest.xml? where :- com.themontcalm.droid.lib.activity.reservationtab library project. , com.themontcalm.droid.activity launcher project accessing library activity code accessing project library:--- package com.themontcalm.droid.activity; import android.app.tabactivity; import android.content.intent; import android.content.res.resources; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.imagebutton; import android.widget.tabhost; public class homescreen extends tabactivity implements onclicklistener { tabhost tabhost; imagebutton location, contacts, explore; int...

Random data generator mathing a regex in python -

in python, looking python code can use create random data matching regex. example, if regex is \d{1,100} i want have list of random numbers random length between 1 , 100 (equally distributed) there 'regex inverters' available (see here ) compute possible matches, not want, , extremely impracticable. example above, example, has more 10^100 possible matches, never can stored in list. need function return match random. maybe there package available can used accomplish this? need function creates matching string regex, not given 1 or other, maybe 100 different regex. cannot code them myself, want function extract pattern return me matching string. if expressions match not have "advanced" features, look-ahead or look-behind , can parse , build proper generator treat each part of regex function returning something (e.g., between 1 , 100 digits) , glue them @ top: import random string import digits, uppercase, letters def joiner(*items): # shou...